From nobody Sat Feb 7 21:14:37 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 A2CCA350287 for ; Wed, 7 Jan 2026 15:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799355; cv=none; b=eWcIGC0Do5br3N3shPHTVwn3dYtpKU+7invKD8JqF0UcA2TpnBqadn2KrQ7mbdQnxo2a0i2WkmfjA+aOGshMTPbWVycUwHzPgwZ/+xjHTP98f9A7NtruOwRsCjeIB2KHrR57ME8qcipmPBbcbQIqUngLvjN1pN9ObztunfPsygw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799355; c=relaxed/simple; bh=WeExB8/grjxLUFEigkWewtNCvA12STz7GgZKX8vemec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M3d5eTNxrrIlwsDY+8AlOd674Rz3C4HUO4h3bJw9Rn3+UmVUYdxCyDl4oJYSAY9LM/xM253h0w9iCIf06k8I+ikxH+oj2HDA3Y+PswPSVOw/4YNRLaxcyRwN81D7yDUCkeJ8tvVgucQT9yq/2lpP2Zm5haxYXKa7s8zhtcxVX+Q= 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=CLIe8NtN; arc=none smtp.client-ip=209.85.128.52 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="CLIe8NtN" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-477563e28a3so7513805e9.1 for ; Wed, 07 Jan 2026 07:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767799352; x=1768404152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QdbM9ndfMi2CZNeCF8/8zbcP3/V0I17HI/boLt75HwI=; b=CLIe8NtNhbrlR6Ajrs0wFIZFWhln5gEN6iKG0y4sWL3PqRuOivu1coxw0d97dd/fei mHpuAeRdv7aAdBwyZHnC257C0uDm6D9vsbPvrlQ1rnBtBDun9HJYIYOSgInTlqzd8SY/ qVUVV2L1dq9OIHfAIy0k/ZkgMF6F5bctF2vqfpl6pIeYXoLFMrjcCo1Q0+bybBrgSEI1 HnnAY0SIrmg2tmZbuSZ+1TBY0ii7SyMrZr3Ss234FV7+6qAExyDBZ7gjushZMVpVX61q Vl4J4n1zEf22DAweMCYxlpKSIGsGJb+6DxdDVhsuS77J6kn2T/anoPgr8Zmd69Gj1yfW 2MXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767799352; x=1768404152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QdbM9ndfMi2CZNeCF8/8zbcP3/V0I17HI/boLt75HwI=; b=brfyEkXGj7o8dPqUnO2yLSrdPyD6leVrgwplmOUaaVF9S+VWHHFNGSDSsXxGRDcCY/ rGmCGMCmy1leG7eVobOnFZZNAczYwEyHlk8JmYdKALK7OQXh52xD+Oxd2Fci55wJ34Rx JoGnNpP4AD6CgMoy2W4/VxUNTwCw82HiG4Euf3YZcE7mIBHjH9DcUEDiq2hLM8joTGUV gD+1POE14kzOwHrvY9ARm9AptrsElBVMWkxhh8+eM6G0POXr6EnFOwSdmhN7fT6JpcIc 5Z36JfeKCAxsAAFP1CkXyBX/9ilQiWvN0yFtMS3KSDen44M+uM3vrPtkaZbwap+/eZSF vPqw== X-Forwarded-Encrypted: i=1; AJvYcCXcZZseXKYD4MoO465qe0sBGWVdFin5YkG8P6N821JF8sl1HAT4zesrneBPjxU2Q+JMgqJtILa3YYmIP94=@vger.kernel.org X-Gm-Message-State: AOJu0YyTT3n8l9PFsoRLYqVAsYLN57DbfO61HXNlwR47n9M/brKFA9rs anTYsEKnIDPUf6qMvL9BRbxrEoMzldbZqQsBDmns7uxItnB+0eEgFBz2+AYWtA== X-Gm-Gg: AY/fxX5ki5kvgTnTA5hyblNtMpNyZaNDtEmTZQdFHCLeuu9O79cRgNsoHCBC0K7vxR8 lEecbch8zyK2O0T6zE3AAq93p/CIuB3+M1j9dzRKHUNnc4fdkfwsbYRdwNdywEBmLLwrUBebJhO f3TAOJrPqwmhLoPFQm+huXU3uvf4aGm5FD1V84E/Gk8A97NNIFkeBjscJZFqYTTJDj4DT6qMZVH JANxwC+SYS5XRej4YflnQC1rEU+29mSV9HE23TQ0I4EXPhwIc54bMxTm/JaV6mc2dpO0hicxAH7 NjidjUZgaae/zO8LUH33IOEpw9Rb11p8G2nswWZREkoaiwg4fVTRt9wErjkj0exQsEMML38Rwna 4Jsqw5PVxJr1Acoh48+L2qSY4Wo1RyXtl47yrH1jjTAYycFISXg6Vxu1iWNUOoI8HdcfPVTiHMz TZqlBVhS3iBdFVJi0hUtz+DJisMoSyB7hNXwsVw2g= X-Google-Smtp-Source: AGHT+IFW4v1M23MnWZOGq2XuWv/7NQ6xbzgVsqtYbBW5KB8zdRPqUl1XfyZAIJ8gab2N+RgaYYTqNQ== X-Received: by 2002:a05:600c:681b:b0:477:a219:cdc3 with SMTP id 5b1f17b1804b1-47d8486d5e6mr34816615e9.12.1767799351941; Wed, 07 Jan 2026 07:22:31 -0800 (PST) Received: from ionutnechita-arz2022.local ([2a02:2f0e:ca09:7000:33fc:5cce:3767:6b22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f410c6csm112064125e9.1.2026.01.07.07.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 07:22:31 -0800 (PST) From: "Ionut Nechita (Sunlight Linux)" To: benato.denis96@gmail.com, jikos@kernel.org, bentiss@kernel.org Cc: ionut_n2001@yahoo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sunlightlinux@gmail.com, superm1@kernel.org Subject: [PATCH v3 1/4] HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant Date: Wed, 7 Jan 2026 17:22:12 +0200 Message-ID: <20260107152213.143247-4-sunlightlinux@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com> References: <20260107152213.143247-2-sunlightlinux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ionut Nechita Use the existing HID_UP_ASUSVENDOR constant instead of the magic number 0xff310000 for better code clarity and maintainability. Reviewed-by: Denis Benato Signed-off-by: Ionut Nechita --- drivers/hid/hid-asus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 472bca54642b9..eb14b9d13823b 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -317,7 +317,7 @@ static int asus_e1239t_event(struct asus_drvdata *drvda= t, u8 *data, int size) static int asus_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { - if ((usage->hid & HID_USAGE_PAGE) =3D=3D 0xff310000 && + if ((usage->hid & HID_USAGE_PAGE) =3D=3D HID_UP_ASUSVENDOR && (usage->hid & HID_USAGE) !=3D 0x00 && (usage->hid & HID_USAGE) !=3D 0xff && !usage->type) { hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n", --=20 2.52.0 From nobody Sat Feb 7 21:14:37 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 EE3EB3557E1 for ; Wed, 7 Jan 2026 15:22:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799364; cv=none; b=fbL3eWKyx5XQv7C/eAiqha5ZQeKi3kUDW6E23x+Iu+jbGeBHm7LPeC52RgKdk6JCB7jGkwrSWVENfICdQC058QKP2NFV+izX++Wg5rhK1v2TKPTEDX+qkb4wwWJ0cNvUbPMd6KZXpyS1zzePe8/Tr0HWK0C7mYX6L3DQ3Vqnpl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799364; c=relaxed/simple; bh=5JDdGl+quViVSh5qS3L0JGYIdYs74ZyF6u5b0yPu52E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QOZ+kybjo94gdMmSYrw5bX8eMBzrT0YVbMdByFkFPqH2lC3S802go1aT18ZRqMYDo/bX75K9v31kg9DDLjbjCGgJROrhA1BbTCiw54iTJnQWKzhtw1jbrrIZOgHetkYf2TlEyjEUv6Joquuy8g+PO6ILP2Cpye85/6lY0X2nm9c= 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=eTynPtg3; arc=none smtp.client-ip=209.85.128.44 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="eTynPtg3" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4775e891b5eso10490945e9.2 for ; Wed, 07 Jan 2026 07:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767799361; x=1768404161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UlZqCvlR28QUY2P8NX6QpqNVUlqFNPjRtevgdWt+0i8=; b=eTynPtg3F1CnMYz2HyfoPQjk5E/iqD1Ztug2wWHVAml6PeVBh5X9YvByljTE3j8UH9 hZgmP1PV9vyWDKKCahVgNWC+x6zjIOrmKiyzsA7v4UQQ1xJCrjpflMvJgb6dqYPBCfVP +jf7LnWPv/2M9kmDbMGh1B8QAX5rmCKT6fLMaFCCXkf5TeAjDQVZm8/fgySkXgADqND2 OUeNMUMr5T3y3EMXmhxw/bGQcxJxEOFcbs9pd83+H+1Qj3TYlo5YnIYajg1Qf608YRTv 58pZIuJlLMPzRtFPCkLcekLcS4qA5xqMCnDiYVACi9Nw/Yb903a6taaIb4YWqxaNLbQS wHZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767799361; x=1768404161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UlZqCvlR28QUY2P8NX6QpqNVUlqFNPjRtevgdWt+0i8=; b=luCBONr0BbvNG/gkel5a8Tc9s7ir62zKPfW98h7roK6URBFnLXcbIZfyrcCsxcDddu bh6KrQKFGwCQyR+p/hO6iDns0HBfdP2ntsuz+kLiE5X1utKpJ6YOT/HWBYokR8GYB2kL DLv//MYssQVlD8Knzfx0GmBxV2IfFI/QFfn16QdA4ejHr6LRtT9zasYgn20e4oHgE1kM GQtyMSp0KZeislf7+snIksJOHgg0ylLS83XP4JZb4vANW7GHe1P12Vd+hQif/nga8s6E yG0K9AeLnltWdXuKaDw+biGNhL2WSl2Vl7C5JVOoO1owLAOs6k4plxqEqN+ihzyNfdA+ 7FhQ== X-Forwarded-Encrypted: i=1; AJvYcCVzZCyBPFHQoYILNl9Pn0ZWy616WuhsLuGJODbW9A7yluAB+M87re6i4oj0R4JtxypKCSrh3y4ukiy/yzw=@vger.kernel.org X-Gm-Message-State: AOJu0YyGltizVyoGsZe6jqfnZdyBW2PKDnVWi9ym/8y69foqtjTv6kQl KGYukM8GeBnWIVomt+Id3qmqgwttdg5SwRwkwly7qmMUw371wEgXmfJp X-Gm-Gg: AY/fxX4B8gpUxrILLzSPQ8j7k0flxz0YjMoiwTKQs+oF7F6QN19LDGGt1Ai1Wf2VFZp IJkUmBiNCCr+FO3X1SO5GCm36tDBtpTxCu2cuUsBelxPUf4fOWCcfYKqsWDco/Dy/R673+2t0vF 5ylm9ARCz0+ym0pJkJPHGCBoAKOgasEFAl21Vdweo/HupdpK9mgpJDoV2DcxDBbbDuNsqnvgfks cduQ6gI8w2dRM3KKT1aRHXjBueIXRVUFNAlOxNmswS0Xw4Pmw3SYXoQZzsNPPws71n/MKuob3Bc 4GzFAXutpmluIdZ0HtYyC2vGCaJTGDoIz2/KxkqbpAagQkZ8nPVXONJM7wvpzy+x3OBlZBai+Ee YKsTbj2N6shQUQBFmMgt8lpO34Td5KtEp4pEYgds741h8YdnThv/rsdVYjvGD72nJK9x4ndgCnb TBJTSYonFm178I6VwhbLSaIiK5Eaa0fcTwf8l+Ua4= X-Google-Smtp-Source: AGHT+IHj+Mp+36EGlLrtCpsqPagsOpWY2Ltglsq01/QVZWSlfcTdsf7vkUKXFWdu+p6jeFTZ5tOqoA== X-Received: by 2002:a05:600c:444c:b0:477:9f34:17b8 with SMTP id 5b1f17b1804b1-47d84b0a9e5mr35154215e9.1.1767799361270; Wed, 07 Jan 2026 07:22:41 -0800 (PST) Received: from ionutnechita-arz2022.local ([2a02:2f0e:ca09:7000:33fc:5cce:3767:6b22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f410c6csm112064125e9.1.2026.01.07.07.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 07:22:41 -0800 (PST) From: "Ionut Nechita (Sunlight Linux)" To: benato.denis96@gmail.com, jikos@kernel.org, bentiss@kernel.org Cc: ionut_n2001@yahoo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sunlightlinux@gmail.com, superm1@kernel.org Subject: [PATCH v3 2/4] HID: asus: Filter spurious HID vendor codes on ROG laptops Date: Wed, 7 Jan 2026 17:22:14 +0200 Message-ID: <20260107152213.143247-6-sunlightlinux@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com> References: <20260107152213.143247-2-sunlightlinux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ionut Nechita On Asus ROG laptops, several HID vendor usage codes (0xea, 0xec, 0x02, 0x8a, 0x9e) are sent during normal operation without a clear purpose, generating unwanted "Unmapped Asus vendor usagepage code" warnings in dmesg. Add definitions for these codes and filter them out in asus_raw_event() to prevent kernel log spam. Tested on Asus ROG series laptops. Reviewed-by: Denis Benato Signed-off-by: Ionut Nechita --- drivers/hid/hid-asus.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index eb14b9d13823b..15c24d5812763 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -57,6 +57,13 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); #define ROG_ALLY_X_MIN_MCU 313 #define ROG_ALLY_MIN_MCU 319 =20 +/* Spurious HID codes sent by QUIRK_ROG_NKEY_KEYBOARD devices */ +#define ASUS_SPURIOUS_CODE_0XEA 0xea +#define ASUS_SPURIOUS_CODE_0XEC 0xec +#define ASUS_SPURIOUS_CODE_0X02 0x02 +#define ASUS_SPURIOUS_CODE_0X8A 0x8a +#define ASUS_SPURIOUS_CODE_0X9E 0x9e + #define SUPPORT_KBD_BACKLIGHT BIT(0) =20 #define MAX_TOUCH_MAJOR 8 @@ -348,6 +355,21 @@ static int asus_raw_event(struct hid_device *hdev, if (report->id =3D=3D FEATURE_KBD_LED_REPORT_ID1 || report->id =3D=3D FEA= TURE_KBD_LED_REPORT_ID2) return -1; if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { + /* + * ASUS ROG laptops send these codes during normal operation + * with no discernable reason. Filter them out to avoid + * unmapped warning messages. + */ + if (report->id =3D=3D FEATURE_KBD_REPORT_ID) { + if (data[1] =3D=3D ASUS_SPURIOUS_CODE_0XEA || + data[1] =3D=3D ASUS_SPURIOUS_CODE_0XEC || + data[1] =3D=3D ASUS_SPURIOUS_CODE_0X02 || + data[1] =3D=3D ASUS_SPURIOUS_CODE_0X8A || + data[1] =3D=3D ASUS_SPURIOUS_CODE_0X9E) { + return -1; + } + } + /* * G713 and G733 send these codes on some keypresses, depending on * the key pressed it can trigger a shutdown event if not caught. --=20 2.52.0 From nobody Sat Feb 7 21:14:37 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 4E26B359F9D for ; Wed, 7 Jan 2026 15:22:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799375; cv=none; b=vD3M6sa8NhoLlnzRYgsiMODJ2tSo8I3WDmX57C9Dx5zEVb3fPaKmcQ44ZI3KRHySIo5FWnToVvobeR+ANJs3dtd5OAwVVemDRJlkfJURuByty8BHOJ4KLTgeL5888bgRNLUJNC7IAPwhnX/XZKdEBQ2ify0V43KrYIC19BHl1ew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799375; c=relaxed/simple; bh=Pv8jQooqQwwRgS+1ky5fPJuF8aqFpOZErR83Pk1FNqM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZpcBjXfyW8/taoGFlbmU6UqrpyeKt3vRXupvpfA8BRuw2W5GMVRa2PaIE/2yQg4d7XM20VbyYP65AqVBwrG9rQ47O1/lxrLYma/o7EEnIZji+IaK1G+c5hS35AbzFy0w59zE/X7M9QADk8yZuHRVhuHxU2dejyIarb27aIRQ9wM= 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=dugbNg6h; arc=none smtp.client-ip=209.85.128.46 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="dugbNg6h" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4779adb38d3so15722195e9.2 for ; Wed, 07 Jan 2026 07:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767799373; x=1768404173; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iUIt/sO1RSwjy4XN+S75T2hUS/mf6dX+wbl35RhyNjc=; b=dugbNg6hJ6gBoYIb/0XH4Miwz8DxjUhw3rMkSACk2kRrhdebJadMhaDPgKpqXzpFHA nhPC7O4kCXjxpXRmNRl2j6vXhBR5GSYylz6/YBeJ1cCO+Uv8hD10mCoBGxn0yteI2vrE OLYmfUciN5LQwY02fZmI7tcCPp2pxlzB/F9zk1gua3w35U1eLwto6y/tn/GWZ6lwggKt YjUvn4RKGl8rkwVS/k5yl7kLfLB20WySawwfCfv/8yLiQ4qQ6Gwj+8k9UOyRa/5EwclT /b5wZJdEkfjvOcw8EWuU3qN59zK9Ig0CMwobtZFTknKzMnBkRptIfGuKYwwK/iCjGYpr vCBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767799373; x=1768404173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iUIt/sO1RSwjy4XN+S75T2hUS/mf6dX+wbl35RhyNjc=; b=jkIlr+IY4AmJk+WHI2U4a4Etb6ORfeWOI80tiJPgFq6FxNCeH94W4SSTQUEvOO+zbN RAX19RGJsKCl92z1oudkFQna6XM0VpTvjDqy2KSxynlkuwx4VD8zOuMwbkv7bAAOZIlq YtgiiSyukfroR/Kd69bGk7NfDf8U3MzpLRgzaM+yhHZyEip0MD9ZoZB06jod9R6Er6G4 4L+r92mMKp1i12th4cSC5tqQfdjrTkK9s+ReZMkAmpH5AYvJw6T153t6KOY0U0wWqjfO 9cNjIGG4HAMmS5cGlRy/M+UquUmxQJPP4ErrO6YfdF/tOd2v0DddQk8RRUEA9Ocx4lWa p+9A== X-Forwarded-Encrypted: i=1; AJvYcCUEpoAfH7tl8I5Z3phlX8N5t5v/szQIYfK8qEb1HdCLD/e3NfaYtgNq8RMtMONI4InuWdjnQ/YxR6KTTL8=@vger.kernel.org X-Gm-Message-State: AOJu0YxAtxame13eUbpR+mstp5yPBqOFKTzpSkC2oY4TVvlPAb7akqxY jXryj1/A9eu6KhnqgoXicibkE4zPHR08V2YsCq70SSfnVcAWffUKUoGi X-Gm-Gg: AY/fxX45QV/vWtfo+Nr3nXgjwmanXQzic6eP1CS960i8h0YG8Vmd8WBjklUyG7xYr4v 0s+Xns6Nk1UGt4K7y/gBlBvpx3i1I3PWzGAh/UIJj/w2D7a213fqpwgP9o+bdjCmGSK6YuYrOl4 AVBH+4pCXNQ/rTEuIpeXsX6r8hhMJp9T+Jvf2n2zLlAVWo7K6cFjcJWd1GzdPsDZln9X+3L2PdD rnv25FLTLI3KJYoCgdLALQzxlFH227NWw7p78WvyvnUCrVoSfVu0lAsmd4p5uftoH+mtyVk7AuA rRzkVFpDkbslKDTebLtAetm0fMs952YJcB5oYWKLPWilxi83ijHtvcRPU2ShdXrgjhUd8HQm7Mk 14wGTBvTUtdTNcVeE9LPiGmNSd4A8i2FB/4NJTb1d6f09KqEgRtxvlFfKNdxbam1Z5mUeC+oNY+ 0z7dLrUFR2/XmD1LigxqeGNpD8doQCEq3mw83FgQ4= X-Google-Smtp-Source: AGHT+IGnY4XEo2RrD0Uidn/yzsdFKlhJKKAiclW+Dx0qagvb6rcfQW+8MYTWVKNSs6RXnfjDSJEccA== X-Received: by 2002:a05:600c:c117:b0:46f:d682:3c3d with SMTP id 5b1f17b1804b1-47d84b2125cmr28649915e9.13.1767799372581; Wed, 07 Jan 2026 07:22:52 -0800 (PST) Received: from ionutnechita-arz2022.local ([2a02:2f0e:ca09:7000:33fc:5cce:3767:6b22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f410c6csm112064125e9.1.2026.01.07.07.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 07:22:52 -0800 (PST) From: "Ionut Nechita (Sunlight Linux)" To: benato.denis96@gmail.com, jikos@kernel.org, bentiss@kernel.org Cc: ionut_n2001@yahoo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sunlightlinux@gmail.com, superm1@kernel.org Subject: [PATCH v3 3/4] HID: asus: Add WMI communication infrastructure Date: Wed, 7 Jan 2026 17:22:16 +0200 Message-ID: <20260107152213.143247-8-sunlightlinux@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com> References: <20260107152213.143247-2-sunlightlinux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ionut Nechita Add infrastructure for the HID driver to communicate with the asus-wmi driver for handling special keys that require WMI communication. This includes: - Define ASUS_WMI_METHODID_NOTIF method ID in asus-wmi.h - Implement asus_wmi_send_event() function with proper conditional compilation guards for when asus-wmi is not available Reviewed-by: Denis Benato Signed-off-by: Ionut Nechita --- drivers/hid/hid-asus.c | 31 ++++++++++++++++++++++ include/linux/platform_data/x86/asus-wmi.h | 1 + 2 files changed, 32 insertions(+) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 15c24d5812763..8828a3b3054fa 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -23,6 +23,7 @@ /* */ =20 +#include #include #include #include @@ -321,6 +322,36 @@ static int asus_e1239t_event(struct asus_drvdata *drvd= at, u8 *data, int size) return 0; } =20 +/* + * Send events to asus-wmi driver for handling special keys + */ +#if IS_REACHABLE(CONFIG_ASUS_WMI) +static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code) +{ + int err; + u32 retval; + + err =3D asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS, + ASUS_WMI_METHODID_NOTIF, code, &retval); + if (err) { + pr_warn("Failed to notify asus-wmi: %d\n", err); + return err; + } + + if (retval !=3D 0) { + pr_warn("Failed to notify asus-wmi (retval): 0x%x\n", retval); + return -EIO; + } + + return 0; +} +#else +static inline int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 cod= e) +{ + return -ENODEV; +} +#endif + static int asus_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/pla= tform_data/x86/asus-wmi.h index 419491d4abca1..516538b5a527e 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -29,6 +29,7 @@ #define ASUS_WMI_METHODID_KBFT 0x5446424B /* KeyBoard FilTer */ #define ASUS_WMI_METHODID_INIT 0x54494E49 /* INITialize */ #define ASUS_WMI_METHODID_HKEY 0x59454B48 /* Hot KEY ?? */ +#define ASUS_WMI_METHODID_NOTIF 0x00100021 /* Notify method */ =20 #define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE =20 --=20 2.52.0 From nobody Sat Feb 7 21:14:37 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 73A63364EAB for ; Wed, 7 Jan 2026 15:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799388; cv=none; b=lcyYCZYStYYCP/J3m7JbWTXk8MsougB57mUFrjYgIRUjeTf4v2QT84o9A43h5ulodtzoayKygn9mYHeydmfLjfrRV5BpFpLZxgAuNNXj2Yqw4/xKbSxg5lV/G2PdJzO9Q++gprQibTrtxTym6c01RmdG+/dqUIQW8ONyhr8KSa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767799388; c=relaxed/simple; bh=kEVatJuhwcribwS5phTkXXGYCZjzzAaM4rM6+EokEf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DvOqCHowOYTLUYtgO/VqQI3KjbSBkWjC1aslZOiGjOO1zwmweDxlRslGEzoRRekxvF8wV6E5/nMMvuIewB28UwMHzq8bCeZ++ALYUXLwG2LMMnzjvxLQWyu+4pP3NFS/lX8MqE+ZBjfRmd0JPf8yZp59AhivmUPS+T/OsVCAz9o= 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=guj3/wwK; arc=none smtp.client-ip=209.85.128.53 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="guj3/wwK" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so19545835e9.3 for ; Wed, 07 Jan 2026 07:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767799383; x=1768404183; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D3hredH+/A3P6nqyWdZvG4QdgvBANjzpG0Fb/Zydwu8=; b=guj3/wwKGRQOLYI4bThUuApGAkCNjBHMty7RIOhi7crI/EDyjkb1RXhTLXXxBHO8qy YpyECEuY7fo5F1od2E5R3vyZfx6JrsT+4coka3dEK4gqmqu5ZRczGC5TVEd4mmqN4PVG EMdCr8++UCYcSX4ePmrm8biECd1jusR6l/gNHJQ4Nvr4m+KgEBJWNf5Ac4mSLyCbDvuE sLj6Bupp1zhjva6BhVptNC9k+WQF4vMEbyUkxzHmGxWAJzQ/+N2+khm1zh6Q3Kd4iuRG HI12Q+kJpjRJpyqXpT8TiZemJey4LX7nGzyI/NI1SBYmMGksZcMjUyHgvSQENbOxfI9n 6mQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767799383; x=1768404183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D3hredH+/A3P6nqyWdZvG4QdgvBANjzpG0Fb/Zydwu8=; b=cXDTwaJy3+OGQRwin4CqPb5kGjVm6rpBSf4PsS8PyOp17enhVTYs6WVvn4PRWahADI WenbIgiB0VRbXobd/SaEUXgAAub6kcPj0ecMt8UBDmFNIRI2crSJl3zIts0UjgUUVUot rBifX5kApPyNL+dPq7SyeOUP326sE3PtP5ukBs//s45Jri1Ug6odoSy89cVWtbNyqI65 XYadWDHLv9ilX3SxGsqpVbVVngl4TsCguD+B7cJvWduDGxjmi3bQbhO3vZ2mXGQx8CpC PVFlc2ixdZHS8hfekDk91uUX2TA1QlnSrtynKpJnkH+MsS3AauZ/4N+NNKjJMcSISapy DPEw== X-Forwarded-Encrypted: i=1; AJvYcCW4cXhtLh8J3fJeqW3JAC6BIFua/eO8o/8aPz50PlQn58RypYUH4VwSotkjECJ/NXaibd1oEMP0aEcR39E=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7mu3LvZKQ26UMuIlgYvdG1/bhefQ6334vK4vl6C+efCgjZkOd MoqYr08ESWBmm9dpzxAoV7R3oKIXdQze61x0/kxsNfCCQkjp07ecqO7z X-Gm-Gg: AY/fxX7vmFdiM7mSCUxpoumOyJE3JoxKDdHOdP/BF/R/nJRXz7CbLUHOKICuDaEZUNm xUWD4MX7sCmnMmv3wn50FcyA9Icy14AjdtnYggYFDcnFVkcej7oVhrj3CILyZsvwR44wBXbWEyO CvPLuWD8WU7Eptj0+g8HkKRqCMiv8IQ00HNHcFjtI9XCKfY5iKqVmWuKZKYFHMYRLPCmuiJjgqD ffylZiX+jBHJEeEF1R3mjRXTGyMsMHZxIRmTsQ6LIowUJFOQYJCnfO65wtjrWzLjEmgBgZJ+tCr Z4ysJclEp3lmDz+5VbXnDYAQtDWYfyQTm07y9qWjGSUKZdq22MG6mX296FiwM3UTLwYBSAeadEq 4mzBRqvoqN7pk+lIpiQYg8eWANJgQi7mtki3YhtvHqNqOlIhzYpRG7dwrz1Dj6ivZ2iTpHmH5Ft P9Bxmw0ugXCc/+O1AvX3LUWzDrgjBXMgkB0Dejm2U= X-Google-Smtp-Source: AGHT+IEe8VovSuB+Rs2+NhvpCXGunJPI34W+th/f89j8LhAZOES8IZy1xFqOTOzblsupIhgJ249PEg== X-Received: by 2002:a05:600c:1d14:b0:477:97c7:9be7 with SMTP id 5b1f17b1804b1-47d84b0a7bdmr32486395e9.1.1767799382542; Wed, 07 Jan 2026 07:23:02 -0800 (PST) Received: from ionutnechita-arz2022.local ([2a02:2f0e:ca09:7000:33fc:5cce:3767:6b22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f410c6csm112064125e9.1.2026.01.07.07.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 07:23:02 -0800 (PST) From: "Ionut Nechita (Sunlight Linux)" To: benato.denis96@gmail.com, jikos@kernel.org, bentiss@kernel.org Cc: ionut_n2001@yahoo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sunlightlinux@gmail.com, superm1@kernel.org Subject: [PATCH v3 4/4] HID: asus: Implement Fn+F5 fan control key handler Date: Wed, 7 Jan 2026 17:22:18 +0200 Message-ID: <20260107152213.143247-10-sunlightlinux@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107152213.143247-2-sunlightlinux@gmail.com> References: <20260107152213.143247-2-sunlightlinux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ionut Nechita On Asus ROG laptops, the Fn+F5 key (HID code 0xae) is used to cycle through fan modes. This key press needs to be forwarded to the asus-wmi driver to actually change the fan mode. Add ASUS_FAN_CTRL_KEY_CODE define and implement the handler in asus_raw_event() to send WMI events when this key is pressed. When asus-wmi successfully handles the event, it is blocked from reaching userspace. If asus-wmi is unavailable or fails, the event is passed to userspace via evdev, allowing userspace implementations of fan control. Tested on Asus ROG G14/G15 series laptops. Reviewed-by: Denis Benato Signed-off-by: Ionut Nechita --- drivers/hid/hid-asus.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 8828a3b3054fa..d6f0050fd441b 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -65,6 +65,9 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); #define ASUS_SPURIOUS_CODE_0X8A 0x8a #define ASUS_SPURIOUS_CODE_0X9E 0x9e =20 +/* Special key codes */ +#define ASUS_FAN_CTRL_KEY_CODE 0xae + #define SUPPORT_KBD_BACKLIGHT BIT(0) =20 #define MAX_TOUCH_MAJOR 8 @@ -386,12 +389,34 @@ static int asus_raw_event(struct hid_device *hdev, if (report->id =3D=3D FEATURE_KBD_LED_REPORT_ID1 || report->id =3D=3D FEA= TURE_KBD_LED_REPORT_ID2) return -1; if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) { - /* - * ASUS ROG laptops send these codes during normal operation - * with no discernable reason. Filter them out to avoid - * unmapped warning messages. - */ if (report->id =3D=3D FEATURE_KBD_REPORT_ID) { + /* + * Fn+F5 fan control key - try to send WMI event to toggle fan mode. + * If successful, block the event from reaching userspace. + * If asus-wmi is unavailable or the call fails, let the event + * pass to userspace so it can implement its own fan control. + */ + if (data[1] =3D=3D ASUS_FAN_CTRL_KEY_CODE) { + int ret =3D asus_wmi_send_event(drvdata, ASUS_FAN_CTRL_KEY_CODE); + + if (ret =3D=3D 0) { + /* Successfully handled by asus-wmi, block event */ + return -1; + } + + /* + * Warn if asus-wmi failed (but not if it's unavailable). + * Let the event reach userspace in all failure cases. + */ + if (ret !=3D -ENODEV) + hid_warn(hdev, "Failed to notify asus-wmi: %d\n", ret); + } + + /* + * ASUS ROG laptops send these codes during normal operation + * with no discernable reason. Filter them out to avoid + * unmapped warning messages. + */ if (data[1] =3D=3D ASUS_SPURIOUS_CODE_0XEA || data[1] =3D=3D ASUS_SPURIOUS_CODE_0XEC || data[1] =3D=3D ASUS_SPURIOUS_CODE_0X02 || --=20 2.52.0