mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: xiaopeitux@foxmail.com
To: syzbot+13f8286fa2de04a7cd48@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, Pei Xiao <xiaopei01@kylinos.cn>
Subject: [PATCH] test: hid_asus
Date: Fri, 30 Jan 2026 15:50:29 +0800	[thread overview]
Message-ID: <tencent_C0A49257DF09D0DC82EB5F840A370F553C06@qq.com> (raw)
In-Reply-To: <697baa8f.a70a0220.9914.001f.GAE@google.com>

From: Pei Xiao <xiaopei01@kylinos.cn>

#syz test
---
 drivers/hid/hid-asus.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 1b9793f7c07e..8e34063216c7 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -354,6 +354,8 @@ static int asus_wmi_send_event(struct asus_drvdata *drvdata, u8 code)
 static int asus_event(struct hid_device *hdev, struct hid_field *field,
 		      struct hid_usage *usage, __s32 value)
 {
+	struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
+
 	if ((usage->hid & HID_USAGE_PAGE) == HID_USAGE_PAGE_VENDOR &&
 	    (usage->hid & HID_USAGE) != 0x00 &&
 	    (usage->hid & HID_USAGE) != 0xff && !usage->type) {
@@ -361,6 +363,12 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field,
 			 usage->hid & HID_USAGE);
 	}
 
+	if (drvdata->quirks & QUIRK_HID_FN_LOCK &&
+		usage->type == EV_KEY && usage->code == KEY_FN_ESC && value == 1) {
+		drvdata->fn_lock = !drvdata->fn_lock;
+		schedule_work(&drvdata->fn_lock_sync_work);
+	}
+
 	if (usage->type == EV_KEY && value) {
 		switch (usage->code) {
 		case KEY_KBDILLUMUP:
-- 
2.25.1


  parent reply	other threads:[~2026-01-30  7:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 18:44 [syzbot] [input?] [usb?] WARNING in asus_remove syzbot
2026-01-30  6:24 ` Sahil Chandna
2026-01-30  7:04   ` syzbot
2026-02-02 20:28   ` Jiri Kosina
2026-02-02 20:47     ` Jiri Kosina
2026-01-30  7:21 ` [PATCH] test: hid_asus xiaopeitux
2026-01-30  7:41   ` [syzbot] [input?] [usb?] WARNING in asus_remove syzbot
2026-01-30  7:50 ` xiaopeitux [this message]
2026-01-30  8:10   ` syzbot
2026-01-30  9:14 ` Hillf Danton
2026-01-30  9:38   ` syzbot
2026-02-03 10:09 ` Sahil Chandna
2026-02-03 13:35   ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_C0A49257DF09D0DC82EB5F840A370F553C06@qq.com \
    --to=xiaopeitux@foxmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+13f8286fa2de04a7cd48@syzkaller.appspotmail.com \
    --cc=xiaopei01@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®