From nobody Sun Feb 8 13:09:04 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