linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 0/1] HID: input: map battery system charging
@ 2022-11-24 17:59 José Expósito
  2022-11-24 17:59 ` [PATCH RESEND 1/1] " José Expósito
  2022-12-20 14:31 ` [PATCH RESEND 0/1] " Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: José Expósito @ 2022-11-24 17:59 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, rydberg, linux-input, linux-kernel,
	José Expósito

Hi everyone,

This patch adds support for reporting battery status (charging/discharging)
for devices with a charging usage in their HID descriptor:

	0x05, 0x85,         /*      Usage Page (Battery System),    */
	0x09, 0x44,         /*      Usage Page (Charging),          */

I tested it on Apple hardware (mouse, trackpad and keyboard) as well as
on UCLogic tablets with battery [1].

On other hardware (HID_DC_BATTERYSTRENGTH or digitizers with battery)
discharging should be reported for backwards compatibility.
I did my best to keep the old behaviour by adding KUnit tests; However,
I don't own any of those devices, so I'd appreciate any help testing
the patch from someone with the actual hardware.

Best wishes,
José Expósito

[1] https://lore.kernel.org/linux-input/20221029161240.15548-2-jose.exposito89@gmail.com/

José Expósito (1):
  HID: input: map battery system charging

 drivers/hid/.kunitconfig     |  1 +
 drivers/hid/Kconfig          |  1 +
 drivers/hid/hid-input-test.c | 80 ++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-input.c      | 36 +++++++++++++++-
 include/linux/hid.h          |  2 +
 5 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 drivers/hid/hid-input-test.c

-- 
2.38.1


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

end of thread, other threads:[~2022-12-20 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 17:59 [PATCH RESEND 0/1] HID: input: map battery system charging José Expósito
2022-11-24 17:59 ` [PATCH RESEND 1/1] " José Expósito
2022-12-20 14:31 ` [PATCH RESEND 0/1] " Jiri Kosina

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).