HID: google: Get HID report on probe to confirm tablet switch state
authorNicolas Boichat <drinkcat@chromium.org>
Fri, 15 Jan 2021 05:42:16 +0000 (13:42 +0800)
committerJiri Kosina <jkosina@suse.cz>
Tue, 2 Feb 2021 10:30:23 +0000 (11:30 +0100)
commitdf7b622906f24be954beca94e60c195fde65c6d5
treeec631cbde3f2d1d1ff29f8f0e71a673cdc0319ef
parent25221c99c593bf888bd8faa67ca25b40f046e9f8
HID: google: Get HID report on probe to confirm tablet switch state

This forces reading the base folded state anytime the device is
probed, to make sure it's in sync.

This is useful after a reboot, if the device re-enumerates for
any reason (e.g. ESD shock), or if the driver is unbound/rebound
(debugging/testing).

Without this, the tablet switch state is only synchronized after a
key is pressed (since the device would then send a report that
includes the switch state), leading to strange UX (e.g. UI
mode changes when a key is pressed after reboot).

This is not a problem on detachable base attach, as the device,
by itself, sends a report after it is booted up.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-google-hammer.c