All of lore.kernel.org
 help / color / mirror / Atom feed
From: Werner Sembach <wse@tuxedocomputers.com>
To: Benjamin Tissoires <bentiss@kernel.org>
Cc: "Armin Wolf" <W_Armin@gmx.de>, "Pavel Machek" <pavel@ucw.cz>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	dri-devel@lists.freedesktop.org, jelle@vdwaa.nl,
	jikos@kernel.org, lee@kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	miguel.ojeda.sandonis@gmail.com, ojeda@kernel.org,
	onitake@gmail.com, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 devices
Date: Tue, 8 Oct 2024 12:45:03 +0200	[thread overview]
Message-ID: <82a6eca1-728c-436f-8c4d-073d8a43ee27@tuxedocomputers.com> (raw)
In-Reply-To: <sih5i2ausorlpiosifvj2vvlut4ok6bbgt6cympuxhdbjljjiw@gg2r5al552az>


Am 08.10.24 um 11:53 schrieb Benjamin Tissoires:
> On Oct 07 2024, Werner Sembach wrote:
>> Hi,
>>
>> Am 02.10.24 um 10:31 schrieb Benjamin Tissoires:
>>> On Oct 01 2024, Werner Sembach wrote:
>>>> Hi Benjamin,
>>>>
>>>> Am 01.10.24 um 15:41 schrieb Benjamin Tissoires:
>>>>> [...]
>>>>> PPS: sorry for pushing that hard on HID-BPF, but I can see that it fits
>>>>> all of the requirements here:
>>>>> - need to be dynamic
>>>>> - still unsure of the userspace implementation, meaning that userspace
>>>>>      might do something wrong, which might require kernel changes
>>>> Well the reference implementetion for the arduiono macropad from microsoft
>>>> ignores the intensity (brightness) channel on rgb leds contrary to the HID
>>>> spec, soo yeah you have a point here ...
>>> Heh :)
>>>
>>>>> - possibility to extend later the kernel API
>>>>> - lots of fun :)
>>>> You advertise it good ;). More work for me now but maybe less work for me
>>>> later, I will look into it.
>>> Again, I'm pushing this because I see the benefits and because I can
>>> probably reuse the same code on my Corsair and Logitech keyboards. But
>>> also, keep in mind that it's not mandatory because you can actually
>>> attach the BPF code on top of your existing driver to change the way it
>>> behaves. It'll be slightly more complex if you don't let a couple of
>>> vendor passthrough reports that we can use to directly talk to the
>>> device without any tampering, but that's doable. But if you want to keep
>>> the current implementation and have a different layout, this can easily
>>> be done in BPF on top.
>>>
>>> Cheers,
>>> Benjamin
>>>
>>>
>>> [0] https://lore.kernel.org/linux-input/20241001-hid-bpf-hid-generic-v3-0-2ef1019468df@kernel.org/T/#t
>> Thinking about the minimal WMI to HID today, but found a problem: a HID
>> feature report is either strictly input or output afaik, but the WMI
>> interface has both in some functions.
> Not sure you are talking about feature reports, because they are
> read/write. It's just that they are synchronous over the USB control
> endpoint (on USB).

I'm confused about the split between get and send feature reports 
https://www.kernel.org/doc/html/latest/hid/hidraw.html

I guess then a get feature report can also carry input data and the difference 
is that a send feature report doesn't wait for a reply? but then what is it's 
reason of existence in contrast to an output report?

>
> An input report is strictly directed from the device, and an output
> report is from the host to the device.
>
> But a feature report is bidirectional.
>
>> How would I map that?
> Depending on the WMI interface, if you want this to be synchronous,
> defining a Feature report is correct, otherwise (if you don't need
> feedback from WMI), you can declare the commands to WMI as Output
> reports.
Thanks for reminding me that output reports exist xD.
>
>> If I split everything in input and output the new interface wouldn't
>> actually be much smaller.
> The HID report descriptor doesn't need to be smaller. The fact that by
> default it exposes only one or two LEDs so we don't have the micrometers
> arrays is the only purpose.
>
> But if we also implement a not-full HID implementation of LampArray, we
> should be able to strip out the parts that we don't care in the LED
> class implementation, like the exact positioning, or the multiupdate.
>
>> Also what would I write for the usage for the reserved padding in the report
>> descriptor. Usage: 0x00?
> padding are ignored by HID. So whatever current usage you have is fine.
>
> However, if you are talking about the custom WMI vendor access, I'd go
> with a vendor collection (usage page 0xff00, usage 0x08 for the 8 bytes
> long WMI command for instance, 0x10 for the 16 bytes long one).
>
> Side note: in drivers/hid/bpf/progs/hid_report_helpers.h we have some
> autogenerated macros to help writing report descriptors (see
> drivers/hid/bpf/progs/Huion__Dial-2.bpf.c for an example of usage). It's
> in the hid-bpf tree but I think we might be able to include this in
> other drivers (or do a minimal rewrite/move into include).
> I'm not asking you to use it on your code right now, but this has the
> advantage of becoming less "binary blob" in your code, and prevent
> mistakes where you edit the comments but not the values.

I will look into it.

Since the interface is fixed I don't need to flesh out the whole descriptor 
(which i thought i must do) and usage page (0xff42, because NB04 and the wmi has 
2 other ec controlling wmi interfaces besides the AB one), report usage 
(matching the wmi comand id's) and report size should be enough.

Regards,

Werner

>
> Cheers,
> Benjamin
>

  reply	other threads:[~2024-10-08 10:45 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 17:44 [PATCH 0/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 Werner Sembach
2024-09-26 17:44 ` [PATCH 1/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 devices Werner Sembach
2024-09-26 18:39   ` Armin Wolf
2024-09-27  6:59     ` Werner Sembach
2024-09-27 11:24       ` Werner Sembach
2024-09-27 17:18         ` Armin Wolf
2024-09-28  7:40           ` Werner Sembach
2024-09-27 17:15       ` Armin Wolf
2024-09-28  7:36         ` Werner Sembach
2024-09-27  8:59   ` kernel test robot
2024-09-27  9:20   ` kernel test robot
2024-09-27 12:18   ` kernel test robot
2024-09-27 21:01   ` Pavel Machek
2024-09-27 22:21     ` Armin Wolf
2024-09-28  7:27       ` Benjamin Tissoires
2024-09-28  8:23         ` Werner Sembach
2024-09-28 10:05           ` Benjamin Tissoires
2024-09-30 15:35             ` Werner Sembach
2024-09-30 16:15               ` Benjamin Tissoires
2024-09-30 16:35                 ` Werner Sembach
2024-09-30 17:06                   ` Benjamin Tissoires
2024-10-01 12:21                     ` Werner Sembach
2024-10-01 12:23                     ` Werner Sembach
2024-10-01 12:28                       ` Werner Sembach
2024-10-01 13:41                       ` Benjamin Tissoires
2024-10-01 16:45                         ` Armin Wolf
2024-10-01 19:32                           ` Werner Sembach
2024-10-02  8:42                             ` Benjamin Tissoires
2024-10-02  9:27                               ` Armin Wolf
2024-10-03 16:01                                 ` Benjamin Tissoires
2024-10-01 19:18                         ` Werner Sembach
2024-10-02  8:31                           ` Benjamin Tissoires
2024-10-07 17:57                             ` Werner Sembach
2024-10-08  9:53                               ` Benjamin Tissoires
2024-10-08 10:45                                 ` Werner Sembach [this message]
2024-10-08 12:18                                   ` Benjamin Tissoires
2024-10-08 14:51                                     ` Werner Sembach
2024-10-08 15:21                                       ` Benjamin Tissoires
2024-10-09  9:51                                         ` Werner Sembach
2024-10-09  9:55                                         ` Werner Sembach
2024-10-11 12:14                                           ` Armin Wolf
2024-10-11 15:26                                             ` Pavel Machek
2024-10-21 20:26                                               ` Armin Wolf
2024-10-22  7:58                                                 ` Hans de Goede
2024-10-22  8:51                                                   ` Benjamin Tissoires
2024-10-22  9:37                                                     ` Pavel Machek
2024-10-22 15:02                                                       ` Armin Wolf
2024-10-23 17:54                                                         ` Werner Sembach
2024-10-22  9:47                                                   ` Pavel Machek
2024-10-22 15:18                                                     ` Armin Wolf
2024-10-22 19:15                                                       ` Pavel Machek
2024-10-23  7:03                                                         ` Armin Wolf
2024-10-23 17:14                                                         ` Werner Sembach
2024-10-23 17:47                                                           ` Pavel Machek
2024-10-23 16:38                                                     ` Werner Sembach
2024-10-22  9:05                                           ` Benjamin Tissoires
2024-10-23 17:23                                             ` Werner Sembach
2024-10-01 21:03                         ` Pavel Machek
2024-10-02  8:13                           ` Benjamin Tissoires
2024-10-02  9:53                             ` Pavel Machek
2024-10-02 10:21                               ` Benjamin Tissoires
2024-10-03 10:59                                 ` Pavel Machek
2024-10-03 12:54                                   ` Benjamin Tissoires
2024-10-11 15:23                                     ` Pavel Machek
2024-09-28  8:09       ` Werner Sembach
2024-10-01 20:47         ` Pavel Machek
2024-09-28  7:55     ` Werner Sembach
2024-09-27 16:08 ` [PATCH 0/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 Benjamin Tissoires
2024-09-27 21:03   ` Pavel Machek
2024-09-28  7:31   ` Werner Sembach

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=82a6eca1-728c-436f-8c4d-073d8a43ee27@tuxedocomputers.com \
    --to=wse@tuxedocomputers.com \
    --cc=W_Armin@gmx.de \
    --cc=bentiss@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jelle@vdwaa.nl \
    --cc=jikos@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=onitake@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.