Skip to contentSkip to conversation

HID: Driver for Google Hangouts Meet Speakermic

PATCH Applied Pablo Ceballos 5 participants 11 messages Apr 5, 2022 – May 23, 2022 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: Driver for Google Hangouts Meet Speakermic

This driver works around a problem with the HID usage sent by this device for the mute button. It prevents key events from being generated for that HID usage since they would be incorrect.

---
 drivers/hid/Kconfig            | 12 ++++++++
 drivers/hid/Makefile           |  1 +
 drivers/hid/hid-google-atrus.c | 55 ++++++++++++++++++++++++++++++++++
 drivers/hid/hid-ids.h          |  1 +
 4 files changed, 69 insertions(+)
 create mode 100644 drivers/hid/hid-google-atrus.c
drivers/hid/Kconfig +12 -0
index f5544157576c..d4b6be827d15 100644
@@ -403,6 +403,18 @@ config HOLTEK_FF
 	  Say Y here if you have a Holtek On Line Grip based game controller
 	  and want to have force feedback support for it.
 
+config HID_GOOGLE_ATRUS
+	tristate "Google Hangouts Meet Speakermic"
+	depends on USB_HID
+	help
+	This selects a driver for the Google Hangouts Meet Speakermic.
+
+	This driver works around a problem with the HID usage sent by this
+	device for the mute button. It prevents key events from being generated
+	for that HID usage since they would be incorrect.
+
+	Say Y here if you have a Google Hangouts Meet Speakermic.
+
 config HID_GOOGLE_HAMMER
 	tristate "Google Hammer Keyboard"
 	depends on USB_HID && LEDS_CLASS && CROS_EC
drivers/hid/Makefile +1 -0
index 6d3e630e81af..2ee446b5b953 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_HID_FT260)		+= hid-ft260.o
 obj-$(CONFIG_HID_GEMBIRD)	+= hid-gembird.o
 obj-$(CONFIG_HID_GFRM)		+= hid-gfrm.o
 obj-$(CONFIG_HID_GLORIOUS)  += hid-glorious.o
+obj-$(CONFIG_HID_GOOGLE_ATRUS)  += hid-google-atrus.o
 obj-$(CONFIG_HID_GOOGLE_HAMMER)	+= hid-google-hammer.o
 obj-$(CONFIG_HID_VIVALDI)	+= hid-vivaldi.o
 obj-$(CONFIG_HID_GT683R)	+= hid-gt683r.o
drivers/hid/hid-google-atrus.c new file +55 -0

55 lines not on this page · raw message

drivers/hid/hid-ids.h +1 -0
index 85975031389b..9f6fc5cfbeb9 100644
@@ -506,6 +506,7 @@
 #define USB_DEVICE_ID_GOOGLE_MOONBALL	0x5044
 #define USB_DEVICE_ID_GOOGLE_DON	0x5050
 #define USB_DEVICE_ID_GOOGLE_EEL	0x5057
+#define USB_DEVICE_ID_GOOGLE_ATRUS	0x8001
 
 #define USB_VENDOR_ID_GOTOP		0x08f2
 #define USB_DEVICE_ID_SUPER_Q2		0x007f
Signature · 1 line
2.35.1.1094.g7c7d902a7c-goog
#1 lore raw
Quoted 6 lines · Pablo Ceballos

This driver works around a problem with the HID usage sent by this device for the mute button. It prevents key events from being generated for that HID usage since they would be incorrect.

Following up on this patch request. Please take a look.

maintainer Applied
#2 lore raw
In reply to Pablo Ceballos
Quoted 5 lines · Pablo Ceballos

This driver works around a problem with the HID usage sent by this device for the mute button. It prevents key events from being generated for that HID usage since they would be incorrect.

Applied to hid.git#for-5.19/google. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#3 lore raw
Quoted 10 lines · Jiri Kosina
Quoted 5 lines · Pablo Ceballos

This driver works around a problem with the HID usage sent by this device for the mute button. It prevents key events from being generated for that HID usage since they would be incorrect.

Applied to hid.git#for-5.19/google. Thanks,

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Thanks.

Signature · 1 line
Dmitry
maintainer
#4 lore raw
Quoted 10 lines · Dmitry Torokhov
Quoted 7 lines
Quoted 5 lines

This driver works around a problem with the HID usage sent by this device for the mute button. It prevents key events from being generated for that HID usage since they would be incorrect.

Applied to hid.git#for-5.19/google. Thanks,

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Hmm, good point, using KEY_RESERVED mapping to achieve the key being actually ignored didn't immediately occur to me.

Pablo, could you please verify that it behaves in the expected way, and confirm that we could drop the 'driver' in favor of udev rule?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#5 lore raw
Quoted 9 lines · Jiri Kosina
Quoted 2 lines · Dmitry Torokhov

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Hmm, good point, using KEY_RESERVED mapping to achieve the key being actually ignored didn't immediately occur to me.

Pablo, could you please verify that it behaves in the expected way, and confirm that we could drop the 'driver' in favor of udev rule?

I think I've achieved the same result by adding the following to udev hwdb. Dmitry, is this what you had in mind, or is there a better way of doing this?

evdev:input:b0003v18D1p8001*
KEYBOARD_KEY_b002f=reserved

Pablo

#6 lore raw
Quoted 11 lines · Pablo Ceballos
Quoted 9 lines · Jiri Kosina
Quoted 2 lines · Dmitry Torokhov

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Hmm, good point, using KEY_RESERVED mapping to achieve the key being actually ignored didn't immediately occur to me.

Pablo, could you please verify that it behaves in the expected way, and confirm that we could drop the 'driver' in favor of udev rule?

Quoted 6 lines

I think I've achieved the same result by adding the following to udev hwdb. Dmitry, is this what you had in mind, or is there a better way of doing this?

evdev:input:b0003v18D1p8001*
KEYBOARD_KEY_b002f=reserved

No, that is exactly what I had in mind, thank you. Please submit this entry to upstream systemd/udev project (and we can cherry-pick it into our udev as well).

In general I think we should try to avoid trivial "fixup" HID drivers if it is possible. I also wondered if we could be supplying fixed-up HID descriptors via request_firmware() for HID devices.

Thanks.

Signature · 1 line
Dmitry
#7 lore raw
Quoted 4 lines · Dmitry Torokhov
Quoted 2 lines · Pablo Ceballos
Quoted 1 line · Jiri Kosina

On Thu, 12 May 2022, Dmitry Torokhov wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Hmm, good point, using KEY_RESERVED mapping to achieve the key being actually ignored didn't immediately occur to me.

Pablo, could you please verify that it behaves in the expected way, and confirm that we could drop the 'driver' in favor of udev rule?

Jiri, this driver can be dropped from 5.19. The udev rule works just as well.

Quoted 11 lines
Quoted 7 lines

I think I've achieved the same result by adding the following to udev hwdb. Dmitry, is this what you had in mind, or is there a better way of doing this?

evdev:input:b0003v18D1p8001*
KEYBOARD_KEY_b002f=reserved

No, that is exactly what I had in mind, thank you. Please submit this entry to upstream systemd/udev project (and we can cherry-pick it into our udev as well).

The pull request is here: https://github.com/systemd/systemd/pull/23372

Quoted 4 lines

In general I think we should try to avoid trivial "fixup" HID drivers if it is possible. I also wondered if we could be supplying fixed-up HID descriptors via request_firmware() for HID devices.

Pablo

#8 lore raw
In reply to Dmitry Torokhov
Quoted 20 lines · Dmitry Torokhov
Quoted 11 lines · Pablo Ceballos
Quoted 9 lines · Jiri Kosina
Quoted 2 lines · Dmitry Torokhov

I am curious, could not this be achieved without a kernel driver by simply using udev to map this usage code to KEY_RESERVED?

Hmm, good point, using KEY_RESERVED mapping to achieve the key being actually ignored didn't immediately occur to me.

Pablo, could you please verify that it behaves in the expected way, and confirm that we could drop the 'driver' in favor of udev rule?

Quoted 6 lines

I think I've achieved the same result by adding the following to udev hwdb. Dmitry, is this what you had in mind, or is there a better way of doing this?

evdev:input:b0003v18D1p8001*
KEYBOARD_KEY_b002f=reserved

Quoted 7 lines

No, that is exactly what I had in mind, thank you. Please submit this entry to upstream systemd/udev project (and we can cherry-pick it into our udev as well).

In general I think we should try to avoid trivial "fixup" HID drivers if it is possible. I also wondered if we could be supplying fixed-up HID descriptors via request_firmware() for HID devices.

Just FYI, in case you haven't noticed it :)
I am currently working on supporting exactly this kind of fixups through eBPF. I had in the past a request_firmware() patch for wacom devices, but there were way too much problems raised by that because you basically need to have the API right from the first attempt.

With eBPF, you can programmatically change the report descriptor for this particular use case, or you could blindly load a new one. But the other advantage that eBPF provides is that we can also change the stream of events to accommodate for device mishaps, like a bouncing button or garbage in the data.

Greg KH requested that we embed such fixups in the kernels directly, and so I'm going to try to add that feature too. But we can also have udev rules in userspace that would fix devices based on the context. And the long term plan is also to convert existing simple fixup drivers into eBPF progs that would be shipped by the kernel so we don't lose functionalities.

Cheers,
Benjamin

Quoted 6 lines

Thanks.

--
Dmitry

#9 lore raw

Hi!

Quoted 11 lines
Quoted 7 lines

No, that is exactly what I had in mind, thank you. Please submit this entry to upstream systemd/udev project (and we can cherry-pick it into our udev as well).

In general I think we should try to avoid trivial "fixup" HID drivers if it is possible. I also wondered if we could be supplying fixed-up HID descriptors via request_firmware() for HID devices.

Just FYI, in case you haven't noticed it :)
I am currently working on supporting exactly this kind of fixups through eBPF. I had in the past a request_firmware() patch for wacom

Is that good idea? eBPF is fairly dangerous thing, so I'd preffer basic functionality not depend on it...

Best regards,
Pavel

maintainer
#10 lore raw
Quoted 2 lines · Pavel Machek

Is that good idea? eBPF is fairly dangerous thing, so I'd preffer basic functionality not depend on it...

Although I understand the concern, that ship has already sailed long time ago.

Signature · 2 lines
Jiri Kosina
SUSE Labs