From patchwork Tue Apr 16 09:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Jones X-Patchwork-Id: 790606 Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86C6C84D39; Tue, 16 Apr 2024 09:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258265; cv=none; b=SkgbyjXGKwZTHoe4JMaAm7PjuHTPPBj7O/Pid+4psY5I7FNnI2kL8VDzfSYT2Y4Gnt2L+JK2VqBloYHcUw4taNc3vfZXl4QCTl5B4IWr8jPS+hypGN4t11Ag9LzL/mBF3ejOOXNV+XV5gcq+Sb6UW/kSv401r9IfAQVagNLixwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258265; c=relaxed/simple; bh=o8I3Yoi1eQPG8FPJU3fiRb8kC2TEcyxQCVfticFkNUc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qpycT3sFFZ+Plz1exrMtkhR/OoKH5oCEgdkf1Thm5qYeLNvuEG7/zBQVczPmIBGnTsMKRKgELPHfZUIXhjCUGIdarHMT5h4X8pjhI1FI1KrzafaDqSaxt3f7wlCbEDS6PlecnAw0Jh/9fgmepvYHrCY2HH37L4Cx7s+d74ZR+Zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=FzRBJRzq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=PPjleeWj; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="FzRBJRzq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="PPjleeWj" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 94B001380243; Tue, 16 Apr 2024 05:04:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 16 Apr 2024 05:04:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1713258259; x= 1713344659; bh=9l2tkGqTosKZsGdTtSU1QTogUKTwqy1NEzt57TKi+SY=; b=F zRBJRzqu9xZsQD9i1zf3orxO2nL8u7sQAFUPBXMGQnkf0kOmZ2tdqcjjU04LQssk uwXR2U4/PUfCFbIVBFTcIfTPznLFP1tSkzGbdtKw9j3uBND51/fMhRJHHbvuK6fy VeoG5gC2iM7blp4pqrB12R2RGUTCYQSpd/+kb63bm3LY4QNtbqsWs9M1EhULs9QO UdwcZfh+G3N7TxvR3UBgKeAh47/iR18MLcoI5g/tov6cVf0clEb1A3VMoJPoMqHz PbodY+gb5KNarYq03JpFgeYy+VdRC3eLyU0iEZpFqsrtw2sqZBE184i86uQk6uQZ RN4PkZye6PZbpcMmJaHdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713258259; x= 1713344659; bh=9l2tkGqTosKZsGdTtSU1QTogUKTwqy1NEzt57TKi+SY=; b=P PjleeWjqp9nPAQaVFbDe0E5LjChhB3fHeE/nBuBSE1qpUxFyQ+Dej6x26R5xT05m F9Pjfj9j29VPkkIIamAxwstT7H+MZUK0P5cWxgkFj39U7n4nIFe2VHz5tk1KE2pQ YDl/JKzO0Tmgm6QghPcD2xb3lLkUoxY+rQVw2fJJuAmSerwNJWdAXY55TcNT7dDI t3o2z4vsPyv+c7CgKjSPZ2JpxIx7M3T7A5DhKYqpF6Fugjwmsl0j1gqJYXmZkF7k AmwLq7e7h5sNQBvRpBIAA9qWX3gf0prtqQcNIsgCDwEgEYaniygG/HZSz2fZuuoF Isdal1SYpKTK9qLCEaYxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Apr 2024 05:04:17 -0400 (EDT) From: "Luke D. Jones" To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 1/4] HID: asus: fix more n-key report descriptors if n-key quirked Date: Tue, 16 Apr 2024 21:03:59 +1200 Message-ID: <20240416090402.31057-2-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416090402.31057-1-luke@ljones.dev> References: <20240416090402.31057-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Adjusts the report descriptor for N-Key devices to make the output count 0x01 which completely avoids the need for a block of filtering. Signed-off-by: Luke D. Jones --- drivers/hid/hid-asus.c | 51 ++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 78cdfb8b9a7a..d6d8a028623a 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -335,36 +335,20 @@ static int asus_raw_event(struct hid_device *hdev, if (drvdata->quirks & QUIRK_MEDION_E1239T) return asus_e1239t_event(drvdata, data, size); - if (drvdata->quirks & QUIRK_USE_KBD_BACKLIGHT) { + /* + * Skip these report ID, the device emits a continuous stream associated + * with the AURA mode it is in which looks like an 'echo'. + */ + if (report->id == FEATURE_KBD_LED_REPORT_ID1 || report->id == FEATURE_KBD_LED_REPORT_ID2) + return -1; + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { /* - * Skip these report ID, the device emits a continuous stream associated - * with the AURA mode it is in which looks like an 'echo'. + * G713 and G733 send these codes on some keypresses, depending on + * the key pressed it can trigger a shutdown event if not caught. */ - if (report->id == FEATURE_KBD_LED_REPORT_ID1 || - report->id == FEATURE_KBD_LED_REPORT_ID2) { + if (data[0] == 0x02 && data[1] == 0x30) { return -1; - /* Additional report filtering */ - } else if (report->id == FEATURE_KBD_REPORT_ID) { - /* - * G14 and G15 send these codes on some keypresses with no - * discernable reason for doing so. We'll filter them out to avoid - * unmapped warning messages later. - */ - if (data[1] == 0xea || data[1] == 0xec || data[1] == 0x02 || - data[1] == 0x8a || data[1] == 0x9e) { - return -1; - } } - if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { - /* - * G713 and G733 send these codes on some keypresses, depending on - * the key pressed it can trigger a shutdown event if not caught. - */ - if(data[0] == 0x02 && data[1] == 0x30) { - return -1; - } - } - } if (drvdata->quirks & QUIRK_ROG_CLAYMORE_II_KEYBOARD) { @@ -1250,6 +1234,19 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, rdesc[205] = 0x01; } + /* match many more n-key devices */ + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { + for (int i = 0; i < *rsize + 1; i++) { + /* offset to the count from 0x5a report part always 14 */ + if (rdesc[i] == 0x85 && rdesc[i + 1] == 0x5a && + rdesc[i + 14] == 0x95 && rdesc[i + 15] == 0x05) { + hid_info(hdev, "Fixing up Asus N-Key report descriptor\n"); + rdesc[i + 15] = 0x01; + break; + } + } + } + return rdesc; } @@ -1319,4 +1316,4 @@ static struct hid_driver asus_driver = { }; module_hid_driver(asus_driver); -MODULE_LICENSE("GPL"); \ No newline at end of file +MODULE_LICENSE("GPL"); From patchwork Tue Apr 16 09:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Jones X-Patchwork-Id: 789557 Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7934B8526C; Tue, 16 Apr 2024 09:04:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258266; cv=none; b=lKjiO9VNyqOD2ZIeH/owink6AyqlX2ijM4UMYcgxecSRqzBRCCMglL1IjcF4wuVHk8koEFi7SC4qqRW9LjSC8lOkvLDoh9/yVE0/Y+grUi25XLLF/y8a6FzGiTcawXpl9TetYI7/lTi2XfrUEU/qomvDoyxiOpokz14CWI7N+Og= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258266; c=relaxed/simple; bh=khksgLVwfQimzFpzKjcf56Bik5fqMDQ1OHVmttn5CuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GKkOkl64QN5d+56W6ACFN0nbFcC2rJX51zmd1MkSisbG555KbsjTz43Rujzmylt1yTUuySMGVUr3oOPtPR12t/wBWQO59UKUxjXD4ZoQc7CruohrW0YWv3m7MBo5aCmIm7y6FdC8BHtWBoVp0/sulQ/vcksFVkNx/+H37Ah0vjE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=n75wWrJC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ApxXmv1d; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="n75wWrJC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ApxXmv1d" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 82B8B138010D; Tue, 16 Apr 2024 05:04:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 16 Apr 2024 05:04:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1713258262; x= 1713344662; bh=gSRx7mQh8gdUE9jnpHJm2EkzDbubH03thXXqIjS/0i8=; b=n 75wWrJCh0bui1dtb/dIGIRTe4T2Vp8rsg7dEP0waWVmiB+J7k9O0SPEWXn7v85cI JcUOrNJNXwwG8ZjpoSjTbhbKFoyyOGZjW4bepnVgpuu+iNT94Mb1/XYlPUMi5wsB QMZvCs0kmKGKCt3uA+tIO56uR4tI2eOjyBAVP115pE4uqRS61aygCYML5RPdM+WP qGK/UjAYI4krJ46ZtJxmHL0QFnW6uFqleiLsyYnqAljKj4stN53dETck15TlVrNW x2TTXZz1fe121Tqfk0asFnrJbKahkkwvNFPfmCNssO7sk+nKOgIYZhm1aBeG0Gwo lKXAg9Smhoca6KJ0Nckxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713258262; x= 1713344662; bh=gSRx7mQh8gdUE9jnpHJm2EkzDbubH03thXXqIjS/0i8=; b=A pxXmv1dzoB1W1PDOHmAJ2QLsFvU1VHumU4vV5B6iWYJkqBTzNepX/40iq2G6oZgb K5OqvNQwvFEFTYu5bWfb9nFOA7GRTYhg9M7nzbO7RrQC2DuCbrpno7hPRFca8nCM nlwLjxDCKbmnCjJUOiwTOQR0bA2waLeufpT9p9A3EL3UaVnp+eFgP+aRL68uGREb t3KrNIAqRrbqEenHlyHZiEtWggVeM1IUYA7t1s/qBZgwOUb5whtZ9IdSRwp5R2kF Dexl8zgnvpeXUZYYLXb2wmjykjcOQEODIOaCKtRK28HW4aQ/D4d9elAHeAP63650 XGzJROBJ4eIeAq8tv3B3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Apr 2024 05:04:19 -0400 (EDT) From: "Luke D. Jones" To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 2/4] HID: asus: make asus_kbd_init() generic, remove rog_nkey_led_init() Date: Tue, 16 Apr 2024 21:04:00 +1200 Message-ID: <20240416090402.31057-3-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416090402.31057-1-luke@ljones.dev> References: <20240416090402.31057-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the n-key stuff is old and outdated, so make asus_kbd_init() generic to use with other report ID and remove rog_nkey_led_init(). Signed-off-by: Luke D. Jones --- drivers/hid/hid-asus.c | 70 +++++++++++------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index d6d8a028623a..18062f9804fb 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -386,9 +386,9 @@ static int asus_kbd_set_report(struct hid_device *hdev, const u8 *buf, size_t bu return ret; } -static int asus_kbd_init(struct hid_device *hdev) +static int asus_kbd_init(struct hid_device *hdev, u8 report_id) { - const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x41, 0x53, 0x55, 0x53, 0x20, 0x54, + const u8 buf[] = { report_id, 0x41, 0x53, 0x55, 0x53, 0x20, 0x54, 0x65, 0x63, 0x68, 0x2e, 0x49, 0x6e, 0x63, 0x2e, 0x00 }; int ret; @@ -400,9 +400,10 @@ static int asus_kbd_init(struct hid_device *hdev) } static int asus_kbd_get_functions(struct hid_device *hdev, - unsigned char *kbd_func) + unsigned char *kbd_func, + u8 report_id) { - const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 }; + const u8 buf[] = { report_id, 0x05, 0x20, 0x31, 0x00, 0x08 }; u8 *readbuf; int ret; @@ -431,51 +432,6 @@ static int asus_kbd_get_functions(struct hid_device *hdev, return ret; } -static int rog_nkey_led_init(struct hid_device *hdev) -{ - const u8 buf_init_start[] = { FEATURE_KBD_LED_REPORT_ID1, 0xB9 }; - u8 buf_init2[] = { FEATURE_KBD_LED_REPORT_ID1, 0x41, 0x53, 0x55, 0x53, 0x20, - 0x54, 0x65, 0x63, 0x68, 0x2e, 0x49, 0x6e, 0x63, 0x2e, 0x00 }; - u8 buf_init3[] = { FEATURE_KBD_LED_REPORT_ID1, - 0x05, 0x20, 0x31, 0x00, 0x08 }; - int ret; - - hid_info(hdev, "Asus initialise N-KEY Device"); - /* The first message is an init start */ - ret = asus_kbd_set_report(hdev, buf_init_start, sizeof(buf_init_start)); - if (ret < 0) { - hid_warn(hdev, "Asus failed to send init start command: %d\n", ret); - return ret; - } - /* Followed by a string */ - ret = asus_kbd_set_report(hdev, buf_init2, sizeof(buf_init2)); - if (ret < 0) { - hid_warn(hdev, "Asus failed to send init command 1.0: %d\n", ret); - return ret; - } - /* Followed by a string */ - ret = asus_kbd_set_report(hdev, buf_init3, sizeof(buf_init3)); - if (ret < 0) { - hid_warn(hdev, "Asus failed to send init command 1.1: %d\n", ret); - return ret; - } - - /* begin second report ID with same data */ - buf_init2[0] = FEATURE_KBD_LED_REPORT_ID2; - buf_init3[0] = FEATURE_KBD_LED_REPORT_ID2; - - ret = asus_kbd_set_report(hdev, buf_init2, sizeof(buf_init2)); - if (ret < 0) { - hid_warn(hdev, "Asus failed to send init command 2.0: %d\n", ret); - return ret; - } - ret = asus_kbd_set_report(hdev, buf_init3, sizeof(buf_init3)); - if (ret < 0) - hid_warn(hdev, "Asus failed to send init command 2.1: %d\n", ret); - - return ret; -} - static void asus_schedule_work(struct asus_kbd_leds *led) { unsigned long flags; @@ -558,17 +514,27 @@ static int asus_kbd_register_leds(struct hid_device *hdev) int ret; if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { - ret = rog_nkey_led_init(hdev); + /* Initialize keyboard */ + ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID); + if (ret < 0) + return ret; + + /* The LED endpoint is initialised in two HID */ + ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID1); + if (ret < 0) + return ret; + + ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2); if (ret < 0) return ret; } else { /* Initialize keyboard */ - ret = asus_kbd_init(hdev); + ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID); if (ret < 0) return ret; /* Get keyboard functions */ - ret = asus_kbd_get_functions(hdev, &kbd_func); + ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID); if (ret < 0) return ret; From patchwork Tue Apr 16 09:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Jones X-Patchwork-Id: 790605 Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4636685286; Tue, 16 Apr 2024 09:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258271; cv=none; b=c6x2f8t9PmH+TTMF0jGklBOiNuet/liASwyvvo59aM+YrFGrI/+LaKNjUKCoY161ktqO/vAxSWhqStSFIm17IPhqFJECI0VE3zh6WeZsWUck72H+BrSwAa9+XSoecIUsFQbcXUM1irm5pHwk2s4koKBYsVUCilD6j/WjkMXKDyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258271; c=relaxed/simple; bh=HxVQ221L/vE0HrOBV6Jo6DE05cBEweUIncG5yctBRHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cUN30ybdAcAx4QjApHBV+6pJSts3sFh+EJrV7N1AXlUQWWm5TijdNFTvzv9o68q2x6ko4+5+LEw4teBO5DhIIO0TGFe4xknCtf3EE/lTAq48ffazpKiIfY5FryoUOi4f0YwWw/8m0XK8/vPluH4wHRu1cb1I1WjHlFw6G9r6B0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=a8WPsd9C; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Bg8lTRxi; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="a8WPsd9C"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Bg8lTRxi" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 6D770138024B; Tue, 16 Apr 2024 05:04:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 16 Apr 2024 05:04:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1713258265; x= 1713344665; bh=GsqUmpQqoITRUAlXnLehmMF3/uSTge8CmrgzI81ADtE=; b=a 8WPsd9Ct2TBdjU+tdE6YXYLpi4sfzWu+jzoJ7hO8brt8fm5LhqUu71b8jWnsqDUN Xqwkg+rB401fxJDVtVNG5Uujc6T5fSP881kavcZBZuio4I1htOe5orwjLIOGWQp9 ODgnzkDlfGMWqnpN6Wkb2FNqmlmYLGrh9bEove/t6UEOYdXyhQShmKWOUoU4atpr 7ZkB+Sx5wAPNRUc1bUCtt8IYldvFkWq2emUh/IkZ8CYO+2B7I6wdfsBWd/3Hw/5U Yzeutmletq9oAQyFPQ776AGLk3TlFwCRsQI8d8g216AWflcqNhrTJrMYwIHCCg0g dILROqXVczEvd+6YRvnsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713258265; x= 1713344665; bh=GsqUmpQqoITRUAlXnLehmMF3/uSTge8CmrgzI81ADtE=; b=B g8lTRxiooDCle04+5TRbpC70cUqvX9M1JK8/WrWxuodEU19RKZg9lnP5G+4hoMSk j+9g25gJVR9af37bnKVEofegQQHp+jtb75sO4MWP+LOMBfuowseoVUhebUXcSdJP 565FtLIajBkMdCZFFfhWx+C+ax1KGq2PCqaF+uN5tAdYzvL3misMFFAmFKd9jSKl 3pHqf2MiBuoyDJh8Bx0dzvTuGPmJAqu+9mwLnIYnzbIavcQqzBbh0hxB4b6aT2jw Kqt13WZ4OhA2BfYd0hHp4JESZz1GEsw5o9bJMdJuSb/lLRjaiOiS4zTTiCOef+3d NSrnA/AcOlYWz+cZgVyjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgepuden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Apr 2024 05:04:22 -0400 (EDT) From: "Luke D. Jones" To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 3/4] HID: asus: add ROG Ally N-Key ID and keycodes Date: Tue, 16 Apr 2024 21:04:01 +1200 Message-ID: <20240416090402.31057-4-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416090402.31057-1-luke@ljones.dev> References: <20240416090402.31057-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 A handful of buttons on the ROG Ally are not actually part of the xpad device and are instead keyboard keys (a typical use of the MCU that asus uses). We attach a group of F key codes which aren't used much and which the handheld community has already accepted as defaults here. Signed-off-by: Luke D. Jones --- drivers/hid/hid-asus.c | 8 +++++++- drivers/hid/hid-ids.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 18062f9804fb..61820f7a6b25 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -847,7 +847,10 @@ static int asus_input_mapping(struct hid_device *hdev, case 0xb3: asus_map_key_clear(KEY_PROG3); break; /* Fn+Left next aura */ case 0x6a: asus_map_key_clear(KEY_F13); break; /* Screenpad toggle */ case 0x4b: asus_map_key_clear(KEY_F14); break; /* Arrows/Pg-Up/Dn toggle */ - + case 0xa5: asus_map_key_clear(KEY_F15); break; /* ROG Ally left back */ + case 0xa6: asus_map_key_clear(KEY_F16); break; /* ROG Ally QAM button */ + case 0xa7: asus_map_key_clear(KEY_F17); break; /* ROG Ally ROG long-press */ + case 0xa8: asus_map_key_clear(KEY_F18); break; /* ROG Ally ROG long-press-release */ default: /* ASUS lazily declares 256 usages, ignore the rest, @@ -1239,6 +1242,9 @@ static const struct hid_device_id asus_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY), + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD), QUIRK_ROG_CLAYMORE_II_KEYBOARD }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 8376fb5e2d0b..f1e508a7ef06 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -208,6 +208,7 @@ #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30 +#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY 0x1abe #define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 From patchwork Tue Apr 16 09:04:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Jones X-Patchwork-Id: 789556 Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ECB685C76; Tue, 16 Apr 2024 09:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258273; cv=none; b=rOgvoCEQLQZ+Zcz8iNNSenZA0uDYTWqzhHHKgbM+OdsFKKzFis6UsyR0xpmJ+lN/ERriMxxkvohTUXWgSqgAUPbrAoSn7HMKRVD8O5bFjUK5R7xf+oaGCuI2XrQ1nlVyj8dpRo4ihRD0Hr54nMxgYMRyEosDVqM+eFwgBQ0gqo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258273; c=relaxed/simple; bh=dQb7AShGD8SaOB+dpSBrbd+XQBhHaEC69BqBkprUBgY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YxYpE6PhFZuydZj33rDJRUHroDT+HekEX82eufK4kvaQoin/7zcxOeAb8zxLODHAHj/TtPAUiO+SOxzV2xrlZh5zwXP1Me6xU3b5pnOiAnF2JATW4eljDGcyXBO7P0Pp11FhIuWHHPP3IzWm4BFqkajh3JbfLasiWvEmV2Y50s4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=k3Ho+Itd; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=iFQTFJLg; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="k3Ho+Itd"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iFQTFJLg" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 206C2114015A; Tue, 16 Apr 2024 05:04:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 16 Apr 2024 05:04:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1713258268; x= 1713344668; bh=o0VguGvkhfjanmvUkZrSpkY8KS8S4SNFR6TNBXk3LdQ=; b=k 3Ho+ItdpDXP83/Z37rW5CQDefRmQ11lfjJnz05KWiF8wpnCLisJ5FSa1WJfhdHb+ l7m3gYsr86ZXBp9+nIoKr+8Tgk/T7cj4gmRXW0BewM8p5LPmHX0JHYoCWGWqdKEM TlmzGoYT7zA+uR5GP74ln/e9Liqy2lio+UCglZpOqLth5g0XyBw//B4A22cRPaSM cVNxC6PGqW4Y40X8HV92jdf7PEi6PzeCQUscqxNtH/b9xAkq/aRs6OS/8gJOF3kk 5Ug+2384q/DvgllmN+blotR+tnPe8CVnBOI8wwWLoY62rQr03LAkCwLBObeTFTwP ARyNBGx1VEAXUB+Oz3lzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713258268; x= 1713344668; bh=o0VguGvkhfjanmvUkZrSpkY8KS8S4SNFR6TNBXk3LdQ=; b=i FQTFJLg4s10kss/qXxC+Ztbt76VHpEGyhjLWAN90IskvQWKA5kJIJhqXPrK+SklL KeaxXTALtUJWcm9Z5TwYeqxU3hku9hiFMc533Biwcj4flaOxPx9AnqBgjeU+gZE4 p4WxbSTOuhjU8M73sC+FkSG8n65vZfkSDaAwosMybItrlmj0s4WbfrXnVzwksHNu AmbL/zyN+C8nq86eb0OJghoY8gf4xMUukhJw3IJjECC2wgR+auThGEEr7/C713a0 ZbW74BzUPxXDdKljwOr4cLsMKvRm+cgLs5Vb+9sQPNlKBKFfAn/6kSfZHHxvP6pM rL5E+z2Bk3y6QZwGGH5uQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Apr 2024 05:04:25 -0400 (EDT) From: "Luke D. Jones" To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 4/4] HID: asus: add ROG Z13 lightbar Date: Tue, 16 Apr 2024 21:04:02 +1200 Message-ID: <20240416090402.31057-5-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416090402.31057-1-luke@ljones.dev> References: <20240416090402.31057-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add init of the lightbar which is a small panel on the back of the ASUS ROG Z13 and uses the same MCU as keyboards. Signed-off-by: Luke D. Jones --- drivers/hid/hid-asus.c | 3 +++ drivers/hid/hid-ids.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 61820f7a6b25..02de2bf4f790 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1242,6 +1242,9 @@ static const struct hid_device_id asus_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR), + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY), QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index f1e508a7ef06..94501dbdd463 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -208,6 +208,7 @@ #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30 +#define USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR 0x18c6 #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY 0x1abe #define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869