View Single Post
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#75
Originally Posted by andrei1089 View Post
I hacked a bit on the headphoned code adding another watch for the file /sys/devices/platform/nokia-av/detect but it doesn't detect any change

Then I've tried with inotifywait for both files /sys/devices/platform/nokia-av/detect and /sys/devices/platform/gpio-switch/headphone/state
I've been surprised to see that a change is detected only for the latter. So I think there's no other way than polling the file.
Yeah, that's what I thought of doing originally, but then after playing around a bit more (my kernel hacking knowledge is pretty much limited to printk's) I realized that all sysfs does is call a relevant piece of code in the driver, that value doesn't exist until you actually read it.

Making a replacement /usr/lib/ohm/libohm_accessories.so that would register the headset in the first place as a headset wouldn't be hard work (riiiight...) thanks to IDA Pro and the examples of plugins found in the OHM package but there's no point when you can just modify nokia-av.ko to not disable the button, which is what I will be doing soon. **** you, Nokia, and your stupid decisions.
I looked over nokia-av.c and I probably missed the code that actually handles the disabling... I ended up wading through twl-madc before eventually going to bed. It would be awesome to finally be able to use the damn button... Good luck
 

The Following 5 Users Say Thank You to cb22 For This Useful Post: