CHERRY-PICK: power: Add global hover support for touchpads

This CL expands powerd's understanding of how "hover detection" can work
on ChromeOS touchpads.  Previously powerd has been set up to look for
events coming out of the touchpad which are reporting specific fingers
before they actually touch the touchpad (hovering over it) and turning
on the keyboard backlight when this happens.  This currently only works
if the touchpad can sense and report individual fingers as usualy before
they even touch the pad.

Not all "hover-enabled" touchpads report this way.  Specifically, some
may simply report a global hover state, that simply indicates if
something is hovering over the pad -- as opposed to having the hover
state tied to a specific finger.

This CL expands the logic of powerd to include this situation.  It now
keeps track of this global ABS_DISTANCE value and takes it into
consideration in addition to the ABS_MT_DISTANCE values that are tied
to specific fingers.

BUG=chrome-os-partner:53064
TEST=manually built and deployed on a Cave with customized FW that
generates the events in question.  With this patch applied the keyboard
backlight behaved as expected.

Change-Id: Ia97150a85c35426cfd959b9636b9d5f01167503a
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/323840
Reviewed-by: Dan Erat <derat@chromium.org>
(cherry picked from commit a3e6bf450289617f8f6ac45008f2d01e4659ac60)
Reviewed-on: https://chromium-review.googlesource.com/362741
Commit-Queue: Shasha Zhao <Sarah_Zhao@asus.com>
Tested-by: Shasha Zhao <Sarah_Zhao@asus.com>
4 files changed