Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp241398pxf; Wed, 10 Mar 2021 05:28:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq3cq5S9PeO/jaznmgETyBIgm+MgEuXRXYCbaiCZsp/IMq2l42bfd2m6Ie2Si//S0EASeJ X-Received: by 2002:a17:906:684b:: with SMTP id a11mr3506185ejs.329.1615382882011; Wed, 10 Mar 2021 05:28:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615382882; cv=none; d=google.com; s=arc-20160816; b=qsCVRuEjuTrk/as16++D6WLWZnartWPccKlz1lz6fdQ7ba7epQhv1fJ42q8F659l+u Un94xsxiA3gjLyEcZCT43XovF2R699epZeNIhHD49CwPN/GOXmweaAWm1QDdWmuSwZou afmchX+hQeRIM2tPSbv7pUhsFXtGmrDaydrAXf8CLLJGP3hlKih0Dd5Sw3EOWtddR5wc 5X32yejXedO1UvlQLNHfVRFMHl1wnaruH8M0KKreZYrreLpeEgKnY56LEkfccL22BYXr hW81du40ypxW6iyK5KWMlnmJrEqQ+2HJRcNXJ0fHn407UaXHYcWFboa1WbpaH51cC1sU POFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RiGSde5soyMGHEeQJoFomKhmpDNRYYFllRd3eH1AeJI=; b=av5xg6cQzAudK5upadjhXIOgiia0MczfAxGZqaTGjWFU6/rywTruiVaxIRu41V+D2e xB9m1h5X6JIAkfXqYVlmZAi3nZ2KspEwSNb5RYKMwTjHq8Y9nffU1LeflGVlaU2h7Ht3 0rHio/MZmcx1EEIHtbyptihzdzVeRv9XteBmlsl4k5NKiraW3N01sW48TPDziB9KJC63 U5JAstTRO7ihXvIz/jrLApXstgj/TAplVn0sx33z+XGSkFgSVVdbByA0JlDGv/kGbwWF 7m6mraI2nkp85lslaYGMKLvl0IevElanFnhFFYx+iI2ravktDNe9SdJCX1nWKik9Os4t 0Tww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZBjxpXKO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb16si11019479ejb.190.2021.03.10.05.27.36; Wed, 10 Mar 2021 05:28:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZBjxpXKO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233832AbhCJN0P (ORCPT + 99 others); Wed, 10 Mar 2021 08:26:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:46178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbhCJNYq (ORCPT ); Wed, 10 Mar 2021 08:24:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0078964FF7; Wed, 10 Mar 2021 13:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382686; bh=psaYIB6lq41ch79udc/xan5AurY492mvcrN3dCynPu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZBjxpXKObsbG+qjUX7QmRXrg43xt1T89UginXrXq29TWGkgx2bkgHY1QR3Ree1uM/ SSus/J59fPt2XwA75Q2nAWC8oZr6yp7Xc7Virw41Jlv6kZUP24Oxejdxj/srrw58fP pad0iNoFNURUJSlZMC80Bi1OZXSgmhRbkyZ4alzE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Jiri Kosina , Sasha Levin Subject: [PATCH 5.11 29/36] HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch 10E Date: Wed, 10 Mar 2021 14:23:42 +0100 Message-Id: <20210310132321.425135602@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.510840709@linuxfoundation.org> References: <20210310132320.510840709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Hans de Goede [ Upstream commit b7c20f3815985570ac71c39b1a3e68c201109578 ] The Acer Aspire Switch 10E (SW3-016)'s keyboard-dock uses the same USB-ids as the Acer One S1003 keyboard-dock. Yet they are not entirely the same: 1. The S1003 keyboard-dock has the same report descriptors as the S1002 keyboard-dock (which has different USB-ids) 2. The Acer Aspire Switch 10E's keyboard-dock has different report descriptors from the S1002/S1003 keyboard docks and it sends 0x00880078 / 0x00880079 usage events when the touchpad is toggled on/off (which is handled internally). This means that all Acer kbd-docks handled by the hid-ite.c drivers report their touchpad being toggled on/off through these custom usage-codes with the exception of the S1003 dock, which likely is a bug of that dock. Add a QUIRK_TOUCHPAD_ON_OFF_REPORT quirk for the Aspire Switch 10E / S1003 usb-id so that the touchpad toggling will get reported to userspace on the Aspire Switch 10E. Since the Aspire Switch 10E's kbd-dock has different report-descriptors, this also requires adding support for fixing those to ite_report_fixup(). Setting the quirk will also cause ite_report_fixup() to hit the S1002/S1003 descriptors path on the S1003. Since the S1003 kbd-dock never generates any input-reports for the fixed up part of the descriptors this does not matter; and if there are versions out there which do actually send input-reports for the touchpad-toggle then the fixup should actually help to make things work. This was tested on both an Acer Aspire Switch 10E and on an Acer One S1003. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-ite.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c index 22bfbebceaf4..14fc068affad 100644 --- a/drivers/hid/hid-ite.c +++ b/drivers/hid/hid-ite.c @@ -23,11 +23,16 @@ static __u8 *ite_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int hid_info(hdev, "Fixing up Acer Sw5-012 ITE keyboard report descriptor\n"); rdesc[163] = HID_MAIN_ITEM_RELATIVE; } - /* For Acer One S1002 keyboard-dock */ + /* For Acer One S1002/S1003 keyboard-dock */ if (*rsize == 188 && rdesc[185] == 0x81 && rdesc[186] == 0x02) { - hid_info(hdev, "Fixing up Acer S1002 ITE keyboard report descriptor\n"); + hid_info(hdev, "Fixing up Acer S1002/S1003 ITE keyboard report descriptor\n"); rdesc[186] = HID_MAIN_ITEM_RELATIVE; } + /* For Acer Aspire Switch 10E (SW3-016) keyboard-dock */ + if (*rsize == 210 && rdesc[184] == 0x81 && rdesc[185] == 0x02) { + hid_info(hdev, "Fixing up Acer Aspire Switch 10E (SW3-016) ITE keyboard report descriptor\n"); + rdesc[185] = HID_MAIN_ITEM_RELATIVE; + } } return rdesc; @@ -114,7 +119,8 @@ static const struct hid_device_id ite_devices[] = { /* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, USB_VENDOR_ID_SYNAPTICS, - USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003) }, + USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003), + .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT }, { } }; MODULE_DEVICE_TABLE(hid, ite_devices); -- 2.30.1