Skip to content

Commit b543db4

Browse files
dtorJiri Kosina
authored andcommitted
HID: google: whiskers: signal tablet mode on connect
When we receive "keyboard position" event from Whiskers we can conclude that the base is attached, even if we did not get EC event for that. We may miss EC event because 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. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 79085c7 commit b543db4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/hid/hid-google-hammer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,16 @@ static int hammer_event(struct hid_device *hid, struct hid_field *field,
402402
usage->hid == WHISKERS_KBD_FOLDED) {
403403
spin_lock_irqsave(&cbas_ec_lock, flags);
404404

405+
/*
406+
* If we are getting events from Whiskers that means that it
407+
* is attached to the lid.
408+
*/
409+
cbas_ec.base_present = true;
405410
cbas_ec.base_folded = value;
406411
hid_dbg(hid, "%s: base: %d, folded: %d\n", __func__,
407412
cbas_ec.base_present, cbas_ec.base_folded);
408413

409-
/*
410-
* We should not get event if base is detached, but in case
411-
* we happen to service HID and EC notifications out of order
412-
* let's still check the "base present" flag.
413-
*/
414-
if (cbas_ec.input && cbas_ec.base_present) {
414+
if (cbas_ec.input) {
415415
input_report_switch(cbas_ec.input,
416416
SW_TABLET_MODE, value);
417417
input_sync(cbas_ec.input);

0 commit comments

Comments
 (0)