HID: google: whiskers: signal tablet mode switch on disconnect
authorDmitry Torokhov <dtor@chromium.org>
Fri, 13 Sep 2019 22:03:16 +0000 (15:03 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 1 Oct 2019 14:13:49 +0000 (16:13 +0200)
commit79085c7dd24b7acd546f5b283d3f2319a9edbbd8
treedcc26f651d33fb96a576e28aaca1b292d519820b
parent38e57f0693ad1b9a785b4f542ec019c5fdf91d57
HID: google: whiskers: signal tablet mode switch on disconnect

Currently, the tablet mode switch that takes two signals as its input:
base attached switch from the EC and some GMR signal from whiskers when
it's folded over. This tablet mode switch is then sent to Chrome, which
changes the UI.

However, there are some units which have a lot of leakage on the ADC
pins that the EC uses to determine whether or not a base is attached.
This can result in the base being physically detached, but the EC
thinking that it's still attached. The user would then be stuck in
laptop mode and wouldn't be able to rotate their display.

To work around this let's send "tablet mode" signal when we remove HID
interface, which normally happens when we physically disconnect
whiskers.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-google-hammer.c