Blocking input at driver level

72 views
Skip to first unread message

philhaz

unread,
Mar 27, 2011, 6:42:57 AM3/27/11
to Android Linux Kernel Development
My HTC Hero has developed a fault that makes the system believe the
trackball is being constantly held. I managed to block this at the OS
level, but it still seems to be affecting power management (the device
never goes to sleep, so battery life is abysmal). Reading the
explanation below suggests that I would have to block this input at
the keypad driver level to prevent keypad-scan wakelocks.

http://source.android.com/porting/power_management.html#androidPowerWakeLocks

Examining "/proc/wakelocks" shows that "gpio_kp" has significantly
larger "active since", "total time" "sleep time" and "max time" values
than anything else, which supports my assumption that it is the kepad
driver keeping the phone awake.

I have very little experience when it comes to C and Linux, so I'm
struggling to work out where and how to block these signals. I've
found the "input.h" file under "include/linux", and the problem key is
defined on line 393:

#define BTN_MOUSE 0x110

But here is where I come unstuck. Any help would be greatly
appreciated!

philhaz

unread,
Mar 31, 2011, 7:56:05 AM3/31/11
to Android Linux Kernel Development
Solved it!

To anyone else experiencing the same issue (as unlikely as that may
be) the solution is to add a timeout to the gpio_kp wakelock in "/
drivers/input/misc/spio_matrix.c" (line 438). It hasn't stopped the
button press, but it means that keypad input can't hold its wakelock
forever, so the device will sleep again.



On Mar 27, 11:42 am, philhaz <phil...@gmail.com> wrote:
> My HTC Hero has developed a fault that makes the system believe the
> trackball is being constantly held. I managed to block this at the OS
> level, but it still seems to be affecting power management (the device
> never goes to sleep, so battery life is abysmal). Reading the
> explanation below suggests that I would have to block this input at
> the keypad driver level to prevent keypad-scan wakelocks.
>
> http://source.android.com/porting/power_management.html#androidPowerW...

totokick

unread,
Mar 31, 2011, 12:45:56 PM3/31/11
to Android Linux Kernel Development
"as unlikely as that may be":
I faced the issue as well, but was fixed by a third party update!

Byee

Luka Sinobad

unread,
Sep 25, 2014, 1:21:43 PM9/25/14
to android...@googlegroups.com
Im having the same problem man, gpio_kp is up 95% of the time, my phone never goes to sleep, thou i dont know how to do the time out things, maybe u can explain this to me?
Reply all
Reply to author
Forward
0 new messages