linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Writing a Driver for Xinmeng M71 Keyboard (Battery Status Support)
@ 2025-06-22 11:32 Saalim Quadri
  2025-06-22 21:02 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Saalim Quadri @ 2025-06-22 11:32 UTC (permalink / raw)
  To: lains; +Cc: jikos, bentiss, gregkh, linux-input, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-23 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-22 11:32 [RFC] Writing a Driver for Xinmeng M71 Keyboard (Battery Status Support) Saalim Quadri
2025-06-22 21:02 ` Jiri Kosina
2025-06-23 13:03   ` Saalim Quadri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).