Re: [PATCH] HID: Driver for Google Hangouts Meet Speakermic

Benjamin Tissoires
2022-05-16T18:24:15Z

On Fri, May 13, 2022 at 12:48 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Thu, May 12, 2022 at 03:35:00PM -0700, Pablo Ceballos wrote:
> > On Thu, May 12, 2022 at 3:53 AM Jiri Kosina <jikos@kernel.org> wrote:
> > > On Thu, 12 May 2022, Dmitry Torokhov wrote:
> > > > 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
>
> 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

>
> Thanks.
>
> --
> Dmitry
>