Skip to contentSkip to conversation

Input: cros_ec_keyb: add support for base attached event

PATCH In review Ting Shen 2 participants 2 messages Jan 19, 2024

Subsystems (3)
lore
Share & tools
lore

Ting Shen

author
#0 lore raw

PATCH v2 1/1 Input: cros_ec_keyb: add support for base attached event

There is a new type of ChromeOS detachable keyboard that talks to the host via CrOS EC host command interface, rather than the USB interface.

To trigger the firmware update daemon (hammerd) on this keyboard, a signal is required to replace the typical USB hotplug event. This patch addresses this by mapping the EC's BASE_ATTACHED event to SW_DOCK.

---

Changes in v2:
- update commit message

 drivers/input/keyboard/cros_ec_keyb.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/input/keyboard/cros_ec_keyb.c +5 -0
index 30678a34cf647..d2e0d89d4ffdf 100644
@@ -128,6 +128,11 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = {
 		.code		= SW_TABLET_MODE,
 		.bit		= EC_MKBP_TABLET_MODE,
 	},
+	{
+		.ev_type	= EV_SW,
+		.code		= SW_DOCK,
+		.bit		= EC_MKBP_BASE_ATTACHED,
+	},
 };
 
 /*
Signature · 1 line
2.43.0.429.g432eaa2c6b-goog
maintainer
#1 lore raw
Quoted 7 lines · Ting Shen

There is a new type of ChromeOS detachable keyboard that talks to the host via CrOS EC host command interface, rather than the USB interface.

To trigger the firmware update daemon (hammerd) on this keyboard, a signal is required to replace the typical USB hotplug event. This patch addresses this by mapping the EC's BASE_ATTACHED event to SW_DOCK.

I think emitting an uevent on attachment might make more sense here, SW_DOCK is to signal attachment of a legacy docking station.

Thanks.

Signature · 1 line
Dmitry