From 23ddeb0e35fbb14b8248490ac27f83d06d26dd02 Mon Sep 17 00:00:00 2001 From: Dj <43033058+DjDeveloperr@users.noreply.github.com> Date: Mon, 26 Oct 2026 02:34:22 -0400 Subject: [PATCH] HID: dockchannel: Enable T6050 keyboard reports on open Enable T6050 keyboard reports when the first HID consumer opens an announcing MTP session. Retained sessions that already stream input keep their existing handoff behavior. Source snapshot: t6050-gpu ee68abb105200e99636a5edfc647a5cfc1d89954 Integration base: 9cbdd0734d9e186c5f5f5949a21b909d10c2571b Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com> --- drivers/hid/dockchannel-hid/dockchannel-hid.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/hid/dockchannel-hid/dockchannel-hid.c b/drivers/hid/dockchannel-hid/dockchannel-hid.c index 11450d904fc8a..bf54e527bef35 100644 --- a/drivers/hid/dockchannel-hid/dockchannel-hid.c +++ b/drivers/hid/dockchannel-hid/dockchannel-hid.c @@ -170,6 +170,7 @@ struct dchid_iface { bool deferred; bool starting; bool open; + bool reports_enabled; struct completion ready; void *hid_desc; @@ -803,6 +804,28 @@ static int dchid_open(struct hid_device *hdev) if (READ_ONCE(iface->dchid->stopping)) return -ESHUTDOWN; + /* + * Announcing MTP firmware can send keyboard READY during enumeration + * without streaming input. Enable it when the first HID consumer opens, + * after interface creation, and require a fresh readiness notification. + * A live bootloader handoff already has keyboard reporting enabled. + */ + if (!strcmp(iface->name, "keyboard") && !iface->reports_enabled && + of_property_read_bool(iface->dchid->dev->of_node, "apple,no-stm") && + of_property_match_string(iface->dchid->helper_link->supplier->of_node, + "apple,rtkit-handoff", "mtp-live-v1") < 0) { + reinit_completion(&iface->ready); + ret = dchid_enable_interface(iface); + if (ret < 0) + return ret; + if (!wait_for_completion_timeout(&iface->ready, + msecs_to_jiffies(START_TIMEOUT_MS))) { + dev_err(iface->dchid->dev, "keyboard input enable timed out\n"); + return -ETIMEDOUT; + } + iface->reports_enabled = true; + } + if (!completion_done(&iface->ready)) { ret = dchid_start_interface(iface); if (ret < 0)