Linux USB
 help / color / mirror / Atom feed
* [PATCH v4 0/2] usb: gadget: f_hid: allow setting different interval for each speed
@ 2026-08-31 13:57 Arthur Crepin Leblond
  2026-08-31 13:57 ` [PATCH v4 1/2] " Arthur Crepin Leblond
  2026-08-31 13:57 ` [PATCH v4 2/2] docs: ABI: testing: document hid interval attributes Arthur Crepin Leblond
  0 siblings, 2 replies; 3+ messages in thread
From: Arthur Crepin Leblond @ 2026-08-31 13:57 UTC (permalink / raw)
  To: linux-usb
  Cc: Krishna Kurapati, Ben Hoff, Greg Kroah-Hartman, linux-kernel,
	Arthur Crepin Leblond

Hi,

I am using the HID USB gadget on a system that can be plugged in to
different machines with different USB speeds (high or full).

Since the HID polling interval unit depends on the USB speed:
 - Full speed: the units are in milliseconds
 - High/Super speed: the units are in micro-frames of 0.125ms

Exposing directly the bInterval means that I would need to know
which speed is currently in use and have to convert it accordingly.

I propose a solution to to expose the interval for each speed:
 - interval_fs: bInterval for full-speed
 - interval_hs: bInterval for high-speed
 - interval_ss: bInterval for super-speed
 - interval: legacy attribute that takes precedence over the per-speed
attributes and sets the same bInterval for each speed to keep backward
compatibility.

Thank you for your reviews!

Arthur Crepin Leblond

Signed-off-by: Arthur Crepin Leblond <arthur@marmottus.net>
---
Changes in v4:
- Update documentation against 7.4
- Removed unused struct f_hidg::interval
- Edit cover letter
- Link to v3: https://patch.msgid.link/20260804-usb_hid_interval-v3-1-975a9fec2d7b@marmottus.net

Changes in v3:
- Use sysfs_emit
- Link to v2: https://patch.msgid.link/20260727152705.79384-1-arthur@marmottus.net

Changes in v2:
- Expose a specific interval attribute per USB speed
- Use a define for the default values
- Update ABI documentation
- Link to v1: https://patch.msgid.link/20260716144921.1120265-1-arthur@marmottus.net
---
Arthur Crepin Leblond (2):
      usb: gadget: f_hid: allow setting different interval for each speed
      docs: ABI: testing: document hid interval attributes

 Documentation/ABI/testing/configfs-usb-gadget-hid |  18 ++
 drivers/usb/gadget/function/f_hid.c               | 194 +++++++++++++---------
 drivers/usb/gadget/function/u_hid.h               |   9 +-
 3 files changed, 143 insertions(+), 78 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-31 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 13:57 [PATCH v4 0/2] usb: gadget: f_hid: allow setting different interval for each speed Arthur Crepin Leblond
2026-08-31 13:57 ` [PATCH v4 1/2] " Arthur Crepin Leblond
2026-08-31 13:57 ` [PATCH v4 2/2] docs: ABI: testing: document hid interval attributes Arthur Crepin Leblond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox