Skip to contentSkip to conversation

Support for side buttons of Xiaomi Mi Dual Mode Wireless Mouse Silent Edition

PATCH Superseded Ilya Skriblovsky 2 participants 2 messages Sep 16, 2021 HID

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support for side buttons of Xiaomi Mi Dual Mode Wireless Mouse Silent Edition

Hello,

Please take a look on my patch that enables side-buttons of Xiaomi Bluetooth mouse (specifially Xiaomi Mi Dual Mode Wireless Mouse Silent Edition).

The mouse sends invalid button count in its HID Report Descriptor and this patch just replaces its descriptor with corrected one. With this driver side buttons work as expected acting like Back/Forward buttons.

Best regards,
Ilya

---
 drivers/hid/Kconfig      |   7 +++
 drivers/hid/Makefile     |   1 +
 drivers/hid/hid-xiaomi.c | 103 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+)
 create mode 100644 drivers/hid/hid-xiaomi.c
drivers/hid/Kconfig +7 -0
index 76937f716fbe..d09abc63290e 100644
@@ -467,6 +467,13 @@ config HID_VIEWSONIC
 	help
 	  Support for ViewSonic/Signotec PD1011 signature pad.
 
+config HID_XIAOMI:
+	tristate "Xiaomi"
+	depends on HID
+	help
+	Adds support for side buttons of Xiaomi Mi Dual Mode Wireless
+	Mouse Silent Edition
+
 config HID_GYRATION
 	tristate "Gyration remote control"
 	depends on HID
drivers/hid/Makefile +1 -0
index 1ea1a7c0b20f..c89a25b9c4b9 100644
@@ -126,6 +126,7 @@ hid-uclogic-objs		:= hid-uclogic-core.o \
 obj-$(CONFIG_HID_UCLOGIC)	+= hid-uclogic.o
 obj-$(CONFIG_HID_UDRAW_PS3)	+= hid-udraw-ps3.o
 obj-$(CONFIG_HID_LED)		+= hid-led.o
+obj-$(CONFIG_HID_XIAOMI)	+= hid-xiaomi.o
 obj-$(CONFIG_HID_XINMO)		+= hid-xinmo.o
 obj-$(CONFIG_HID_ZEROPLUS)	+= hid-zpff.o
 obj-$(CONFIG_HID_ZYDACRON)	+= hid-zydacron.o
drivers/hid/hid-xiaomi.c new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.30.2
#1 lore raw

Hi,

drivers/hid/Kconfig config HID_VIEWSONIC · line 470

Quoted 9 lines · Ilya Skriblovsky
drivers/hid/Kconfig +1 -0
index 76937f716fbe..d09abc63290e 100644
@@ -467,6 +467,13 @@ config HID_VIEWSONIC
  	help
  	  Support for ViewSonic/Signotec PD1011 signature pad.
 
+config HID_XIAOMI:

No ending ':' above.

drivers/hid/Kconfig config HID_VIEWSONIC · line 475

Quoted 5 lines
drivers/hid/Kconfig +5 -0
+	tristate "Xiaomi"
+	depends on HID
+	help
+	Adds support for side buttons of Xiaomi Mi Dual Mode Wireless
+	Mouse Silent Edition

End the description with a '.', please.

And the 2 lines of help text should be indented with an extra 2 spaces (although some parts of this Kconfig file are not done like that and other parts are).

drivers/hid/Kconfig config HID_VIEWSONIC · line 476

Quoted 1 line
drivers/hid/Kconfig +1 -0
+

thanks.

Signature · 1 line
~Randy