[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250622113242.183562-1-danascape@gmail.com>
Date: Sun, 22 Jun 2025 17:02:42 +0530
From: Saalim Quadri <danascape@...il.com>
To: lains@...eup.net
Cc: jikos@...nel.org,
bentiss@...nel.org,
gregkh@...uxfoundation.org,
linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC] Writing a Driver for Xinmeng M71 Keyboard (Battery Status Support)
Hello everyone,
I'm currently working with a Xinmeng M71 wireless keyboard, which is recognized by the kernel as a hid-generic device and functions well.
I'd like to extend its support in Linux by writing a driver that can expose its battery status to userspace,
I used hidtools to record descriptors of the keyboards, I discharged my keyboard over the week and charged it and recorded the responses from it,
like when it started charging/discharging, I saw hex values change reporting me the percentage of the charge
E: 000002.772731 20 13 0a 01 00 04 05 63 01 00 00 00 00 00 00 00 00 00 00 00 8b
# ReportID: 19 /Array ['0a', '01', '0xff020002', '04', '05', '63', '11', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '9b']
E: 000005.642942 20 13 0a 01 00 04 05 63 11 00 00 00 00 00 00 00 00 00 00 00 9b
# ReportID: 19 /Array ['0a', '01', '0xff020002', '04', '05', '64', '11', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '0xff020002', '9c']
E: 000005.860767 20 13 0a 01 00 04 05 64 11 00 00 00 00 00 00 00 00 00 00 00 9c
I would appreciate guidance on, how can I continue this, I am familiar with Linux Kernel and writing drivers, but would like to ask some pointers regarding the same.
I saw a reference that logitech HID driver uses it, but it looked quite complex to me.
I'm comfortable writing kernel C code but relatively new to the HID subsystem. Any documentation pointers, example patches, or suggestions to get started would be highly appreciated.
Looking forward to your responses.
Thank you very much,
Sincerely,
Saalim Quadri
Powered by blists - more mailing lists