From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E712C314B73 for ; Thu, 2 Apr 2026 18:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775154587; cv=none; b=tk3Icrde5v9Zc96PGQ2APBYyeD4jKEWj2hRP1jqGaL7jKe2PWrZqYk+EIE/FHRFZk9ZNYSVQ5fJCjYMn1xzdjCP/+FwR+QvmxxlmNr+tvgvERYXJiqqskAzlHNe/h/Qfuu4iccT0z+3v+DmumN4CgWHXewcbmRZjRIyLBXwKOVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775154587; c=relaxed/simple; bh=fkALRlDaCvYw96amaCu4NjwJ0Qdrhwo4g5tT/+jYDbg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OQ29GJkbkzvM1f7a/Y/N0D8qyDW6R0QjpclQ+pczQFmYlD0alvMXj/DkD6MIf4Otf/BuoGpVGaUDUI+VVpkhQ5x1PC9SxQkhFVi7e6TlqLB0x6k38VGj123MZbLAWSbb3QVNslHhbA+RMpBRLGbJGr1sYMzEiQ9miAGI8N6eYoM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RQYx+Fh5; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RQYx+Fh5" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-8cd8576a512so254232785a.0 for ; Thu, 02 Apr 2026 11:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775154585; x=1775759385; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7Vq95h5+ES6NzDCLDOYDrw2F8+izhS35fbgzcadc4Cg=; b=RQYx+Fh5rNJ8i36d4h7xLe3O+NNJfTKateXycUpv0CCyh1hgtA2zlwB+As0qy6h4Xx /+ek3Ph1L8NwongR2rsVWq0XgrPlu2en+oW0ere7ALipUTxlv9xVhdFxAojTEKkxnjEt Cidn6R2Ehoui8FgHNEp/klUKTaDSjIGceaEYhtsTfCOkad9ncCq0Fggm8ONCQofxNh54 UMlA4ePfibfpZVX7cGhNvQkWpizduPngnWViXuLCSShOf8CMXOiHmNtkqLPqzEdGxjaH k8RMq+hDFw7m8gbUvsEus+hzgt4v4thk5PhQ7qUMXGCt9wmA3Qs4yNVNlwSZCqDUv6z6 IgRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775154585; x=1775759385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7Vq95h5+ES6NzDCLDOYDrw2F8+izhS35fbgzcadc4Cg=; b=C4g9r//zHIv84mT0nJ0jvuV6RXk6eeKO9NecaxlDusQl6/ETWpmS+2pvqM+PQYMDVY U2JoF0d6NfWEcbN5F/gHDcsaZ+/Uhijs+IUS5R5qyAA85/W5GyPhapc5QaDNzBf4Aekp jtTPn3E6TyywJh64GkC73vAufUQvkQBp9RF+LxaVoiyELJ+SIgsWycTWdaUvwpSBC2D8 +lmC3itIfK5bzR1IsVv3CM4HF0w9ie3uQQdCS5Y/iB96fVfYtiWkns482m8qmXxOtVoX gXRaBQ+VPzfvJikK5yiReK6OHFsVziJteqEtzhkvCBjgCk7+sfSGmHzSa8bMSO5esiMq 4rzw== X-Forwarded-Encrypted: i=1; AJvYcCU1p2Nn7OV164G6Aq1GZHxkvGQkqf+d6SUMVJg8BTFvO1Ngm8nm+QGtcoYLNENR3ND3hz9jaqCYItR002U=@vger.kernel.org X-Gm-Message-State: AOJu0YxO4D/eQkLAix9nT7npZq5BkGLTfmoEtg1fl6NjjL7eV0H5ptXo mYuQYk2MhxhdtUPlqBEwP61zwqSLZDTuktdjSYPaWBz0aZzDlaVleMSV X-Gm-Gg: ATEYQzyd3aJoBOXt/npMoAX6RS8wYQCmGNZtPHbgIMowO5H5YSnxMmeJm/Efpoe7Q8H /CJAxNhwbDn2yW/vyHzuoLw0R5Os+UGNua9FmUVBPNigStpl3c/M9wpQ8fWzPT3t59HKAt9hW+W GBVh7HaS7Qcpgv5gNkaOhPMUvbgQdGAOO8QjhzZ1mIDxyGMVu0RAirW4ktTUpSSZhY1ZoBgh5UJ TRORYH5B03nEYmQ7J2+5ynnkSEw60d/EP4rUVY+QstCzwldJZJnEP+d1sE9E5ToUdXFM7TnUwhY oaJjCxjPAaszoCU5yF1Hux3DGrG2KgrcyEESEKA0V2yHpkWxS2VqBgEokmDQwzy60PpnypyBmzc bbD4T4aaSUqv1uG69zPjE+7BF0YWJJjeKXxKrgf2Fqrc+qL1SDfoQhEIpzXo0qRgqXsv7zpNVRi Rp8wtf+swbboblyAlGQEAe X-Received: by 2002:a05:620a:4452:b0:8c6:f416:69f8 with SMTP id af79cd13be357-8d42490a6aamr31433185a.15.1775154584826; Thu, 02 Apr 2026 11:29:44 -0700 (PDT) Received: from fedora ([2600:382:6114:1b06:cf32:7ce8:f756:4daf]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a5392ce8sm314825785a.7.2026.04.02.11.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2026 11:29:44 -0700 (PDT) From: Dave Carey To: jikos@kernel.org Cc: bentiss@kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Carey Subject: [PATCH] HID: multitouch: Fix Yoga Book 9 14IAH10 touchscreen misclassification Date: Thu, 2 Apr 2026 14:29:37 -0400 Message-ID: <20260402182937.388847-1-carvsdriver@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The Lenovo Yoga Book 9 14IAH10 (83KJ) uses a composite USB HID device (17EF:6161) where three descriptor quirks combine to cause hid-multitouch to incorrectly set INPUT_PROP_BUTTONPAD on both touchscreen nodes, making libinput treat them as indirect clickpads rather than direct touchscreens. Quirk 1: The HID_DG_TOUCHSCREEN application collection contains HID_UP_BUTTON usages (stylus barrel buttons). The generic heuristic in mt_touch_input_mapping() treats any touchscreen-with-buttons as a touchpad, setting INPUT_MT_POINTER. Quirk 2: A HID_DG_TOUCHPAD collection ("Emulated Touchpad") sets INPUT_MT_POINTER unconditionally in mt_allocate_application(). Quirk 3: The HID_DG_BUTTONTYPE feature report (0x51) returns MT_BUTTONTYPE_CLICKPAD, directly setting td->is_buttonpad = true. These combine to produce INPUT_PROP_BUTTONPAD on the touchscreen input nodes. libinput treats the devices as indirect clickpads and suppresses direct touch events, leaving the touchscreens non-functional under KDE/Wayland. Additionally, the firmware resets if any USB control request is received during the CDC ACM initialization window. The existing GET_REPORT call in mt_check_input_mode() during probe triggers this reset. Fix by extending MT_QUIRK_YOGABOOK9I (already defined for the earlier Yoga Book 9i) to guard all three BUTTONPAD heuristics and skip the HID_DG_BUTTONTYPE GET_REPORT during probe for this device. Signed-off-by: Dave Carey Tested-by: Dave Carey --- drivers/hid/hid-multitouch.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index e82a3c4e5..1bef32b1d 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -549,7 +549,14 @@ static void mt_feature_mapping(struct hid_device *hdev, switch (usage->hid) { case HID_DG_CONTACTMAX: - mt_get_feature(hdev, field->report); + /* + * Yoga Book 9: skip GET_REPORT during probe; the firmware + * resets if it receives any control request before the init + * Output report is sent (within ~1.18s of USB enumeration). + * Logical maximum from the descriptor is used as the fallback. + */ + if (!(td->mtclass.quirks & MT_QUIRK_YOGABOOK9I)) + mt_get_feature(hdev, field->report); td->maxcontacts = field->value[0]; if (!td->maxcontacts && @@ -566,6 +573,10 @@ static void mt_feature_mapping(struct hid_device *hdev, break; } + /* Yoga Book 9 reports Clickpad but is a direct touchscreen */ + if (td->mtclass.quirks & MT_QUIRK_YOGABOOK9I) + break; + mt_get_feature(hdev, field->report); switch (field->value[usage->usage_index]) { case MT_BUTTONTYPE_CLICKPAD: @@ -579,7 +590,9 @@ static void mt_feature_mapping(struct hid_device *hdev, break; case 0xff0000c5: /* Retrieve the Win8 blob once to enable some devices */ - if (usage->usage_index == 0) + /* Yoga Book 9: skip; firmware resets before init if queried */ + if (usage->usage_index == 0 && + !(td->mtclass.quirks & MT_QUIRK_YOGABOOK9I)) mt_get_feature(hdev, field->report); break; } @@ -644,8 +657,11 @@ static struct mt_application *mt_allocate_application(struct mt_device *td, /* * Model touchscreens providing buttons as touchpads. + * Yoga Book 9 has an emulated touchpad but its touch surfaces + * are direct screens, not indirect pointers. */ - if (application == HID_DG_TOUCHPAD) { + if (application == HID_DG_TOUCHPAD && + !(td->mtclass.quirks & MT_QUIRK_YOGABOOK9I)) { mt_application->mt_flags |= INPUT_MT_POINTER; td->inputmode_value = MT_INPUTMODE_TOUCHPAD; } @@ -802,11 +818,15 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, /* * Model touchscreens providing buttons as touchpads. + * Skip for Yoga Book 9 which has stylus buttons inside + * touchscreen collections, not physical touchpad buttons. */ if (field->application == HID_DG_TOUCHSCREEN && (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) { - app->mt_flags |= INPUT_MT_POINTER; - td->inputmode_value = MT_INPUTMODE_TOUCHPAD; + if (!(app->quirks & MT_QUIRK_YOGABOOK9I)) { + app->mt_flags |= INPUT_MT_POINTER; + td->inputmode_value = MT_INPUTMODE_TOUCHPAD; + } } /* count the buttons on touchpads */ @@ -1420,7 +1440,6 @@ static int mt_touch_input_configured(struct hid_device *hdev, */ if (cls->quirks & MT_QUIRK_APPLE_TOUCHBAR) app->mt_flags |= INPUT_MT_DIRECT; - if (cls->is_indirect) app->mt_flags |= INPUT_MT_POINTER; @@ -1432,7 +1451,8 @@ static int mt_touch_input_configured(struct hid_device *hdev, /* check for clickpads */ if ((app->mt_flags & INPUT_MT_POINTER) && - (app->buttons_count == 1)) + (app->buttons_count == 1) && + !(app->quirks & MT_QUIRK_YOGABOOK9I)) td->is_buttonpad = true; if (td->is_buttonpad) -- 2.53.0