From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Andreas Bergmeier <abergmeier@gmx.net>
Cc: linux-input@vger.kernel.org,
USB mailing list <linux-usb@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Jiri Kosina <jikos@kernel.org>
Subject: Re: Litra Glow on Linux
Date: Tue, 25 Oct 2022 09:46:21 +0200 [thread overview]
Message-ID: <CAO-hwJJ7cF-4kd8Mi6bb5n-k5LuMrWbpdMqFs82y7iQOscr-7g@mail.gmail.com> (raw)
In-Reply-To: <CABfF9mPU52OXTGcsbatJCG4nbP4zaPN3iJnttMg+xRyGY6dUEQ@mail.gmail.com>
Hi Andreas,
On Sat, Oct 22, 2022 at 2:48 PM Andreas Bergmeier <abergmeier@gmx.net> wrote:
>
> > Date: Mon, 17 Oct 2022 18:45:30 +0200
> > From: Andreas Bergmeier <abergmeier@gmx.net>
> > To: linux-usb@vger.kernel.org
> > Subject: Litra Glow on Linux
> >
> > On my Ubuntu machine i am running 5.15.0. Now when I plugin in my
> > Logitech Litra Glow, it gets detected and the following shows up in my
> > dmesg:
> >
> > ```
> > input: Logi Litra Glow Consumer Control as
> > /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.0/0003:046D:C900.000B/input/input75
> > hid-generic 0003:046D:C900.000B: input,hiddev0,hidraw2: USB HID v1.11
> > Device [Logi Litra Glow] on usb-0000:00:14.0-4.2/input0
> > ```
> >
> > Via (hardware) buttons you can switch the device on, regulate the
> > color temperature as well as the brightness.
> So I looked into the sources of `hid-input` and `hig-lg` and I hope
> that I have a halfway decent
> understanding why the linux modules/dev nodes handle the way they do.
> What I do not yet understand is how to map the device to input "primitives".
Depending on how the device presents itself, we might have to use
hid-logitech-hidpp, not hid-lg FWIW.
And to answer the question "how to map the device to input
"primitives".", it all depends on how the device exports itself.
> To recap there are 5 hardware buttons and 3 states:
> - State: "Color temperature in range [u, x]" Button: up
> - State: "Color temperature in range [u, x]" Button: down
> - State/Button On/Off
> - State "Brightness in range [y, z]" Button: up
> - State "Brightness in range [y, z]" Button: down
FWIW, you should be able to use hid-recorder[0] (as root) to record
traces of the events, and to parse them on the fly. Also, if you
provide us the output, we can replay the traces locally as if we
virtually plugged in the device.
>
> What would be a best practice to expose these correctly via HID (as
> e.g. ABS_WHEEL?)?
This doesn't look like a wheel at all, but more like simple buttons
from your description. We should let userspace deal with the
representation as a slider by its own.
Also, are the buttons configuring the hardware directly or do you need
some software to actually change the brightness/color?
And FWIW, the device looks like we should probably just export it as a
led class device, with brightness and color support.
> Or at least - what are the canonical options?
>
> Since the exposed Record interface seems "wrong" I assume I need to
> write code to fix the device handling.
> Now, is this better suited in `hid-input` or `hid-lg`?
Again, it depends. If the device speaks the same high level interface
as other consumer Logitech devices (mice, keyboards, etc...)
hid-logitech-hidpp is the best way forward, but if not, hid-lg would
be the place to start.
> The former currently tries to handle the device (wrongly) and the
> latter yet ignores the device but seems to be
> the one stop to fix Logitech devices.
>
>
> > I know of no way to fully control the device from my computer and
> > would like to change that.
> By now I am confident that I will soon have the full device control figured out.
>
Glad to hear that. But again, we need to know the device a little bit more.
FWIW, if the first byte you have to send to control the LED is 0x10,
0x11 or 0x12 then this is a HID++ device that needs to go in
hid-logitech-hidpp and a lot of groundwork is already done in the
kernel for it.
Cheers,
Benjamin
next prev parent reply other threads:[~2022-10-25 7:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 15:17 Litra Glow on Linux Alan Stern
2022-10-19 15:48 ` Bastien Nocera
2022-10-19 15:49 ` Bastien Nocera
2022-10-19 19:40 ` Andreas Bergmeier
2022-10-20 18:22 ` Andreas Bergmeier
2022-10-22 12:42 ` Andreas Bergmeier
2022-10-25 7:46 ` Benjamin Tissoires [this message]
2022-10-26 20:49 ` Andreas Bergmeier
2022-10-27 9:45 ` Benjamin Tissoires
2022-10-29 8:21 ` Andreas Bergmeier
2022-10-31 9:30 ` Benjamin Tissoires
2022-11-04 7:45 ` Andreas Bergmeier
2022-11-04 11:40 ` Pavel Machek
2022-11-09 20:27 ` Andreas Bergmeier
2022-11-10 3:29 ` Andreas Bergmeier
2022-11-10 9:22 ` Benjamin Tissoires
2022-11-10 12:24 ` Andreas Bergmeier
2022-11-10 13:39 ` Benjamin Tissoires
2022-11-19 20:18 ` Andreas Bergmeier
2022-11-27 11:04 ` Andreas Bergmeier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAO-hwJJ7cF-4kd8Mi6bb5n-k5LuMrWbpdMqFs82y7iQOscr-7g@mail.gmail.com \
--to=benjamin.tissoires@redhat.com \
--cc=abergmeier@gmx.net \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).