* Annotating USB device Location in DT
@ 2024-12-12 13:42 Ricardo Ribalda
2024-12-12 14:03 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Ribalda @ 2024-12-12 13:42 UTC (permalink / raw)
To: linux-usb, devicetree; +Cc: Yunke Cao
Hi all,
I'm working on a way to annotate the location of a USB device within a
system, specifically whether it's "user-facing" or "world-facing."
There's precedent for this type of annotation:
- ACPI: Uses the '_PLD' property for this purpose
(https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html#pld-physical-location-of-device).
We already leverage this for MIPI camera sensors
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n265).
- Device Tree : Has a property for this within
video-interface-devices.yaml
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/media/video-interface-devices.yaml#n386).
I propose adding a similar property to usb-device.yaml
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb-device.yaml).
The ultimate goal is to have this information consumed by the video
driver and exposed to userspace via the V4L2_CID_CAMERA_ORIENTATION
control (https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-camera.html).
What do you think about this?
Thanks,
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Annotating USB device Location in DT
2024-12-12 13:42 Annotating USB device Location in DT Ricardo Ribalda
@ 2024-12-12 14:03 ` Greg KH
2024-12-12 15:15 ` Alan Stern
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2024-12-12 14:03 UTC (permalink / raw)
To: Ricardo Ribalda; +Cc: linux-usb, devicetree, Yunke Cao
On Thu, Dec 12, 2024 at 02:42:34PM +0100, Ricardo Ribalda wrote:
> Hi all,
>
> I'm working on a way to annotate the location of a USB device within a
> system, specifically whether it's "user-facing" or "world-facing."
>
> There's precedent for this type of annotation:
>
> - ACPI: Uses the '_PLD' property for this purpose
> (https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html#pld-physical-location-of-device).
> We already leverage this for MIPI camera sensors
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n265).
>
> - Device Tree : Has a property for this within
> video-interface-devices.yaml
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/media/video-interface-devices.yaml#n386).
>
> I propose adding a similar property to usb-device.yaml
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb-device.yaml).
>
> The ultimate goal is to have this information consumed by the video
> driver and exposed to userspace via the V4L2_CID_CAMERA_ORIENTATION
> control (https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-camera.html).
>
> What do you think about this?
I think you should copy what ACPI does here, as long as it doesn't
conflict with the existing video-interface-devices.yaml definition.
Will that work?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Annotating USB device Location in DT
2024-12-12 14:03 ` Greg KH
@ 2024-12-12 15:15 ` Alan Stern
0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2024-12-12 15:15 UTC (permalink / raw)
To: Greg KH; +Cc: Ricardo Ribalda, linux-usb, devicetree, Yunke Cao
On Thu, Dec 12, 2024 at 03:03:51PM +0100, Greg KH wrote:
> On Thu, Dec 12, 2024 at 02:42:34PM +0100, Ricardo Ribalda wrote:
> > Hi all,
> >
> > I'm working on a way to annotate the location of a USB device within a
> > system, specifically whether it's "user-facing" or "world-facing."
> >
> > There's precedent for this type of annotation:
> >
> > - ACPI: Uses the '_PLD' property for this purpose
> > (https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html#pld-physical-location-of-device).
> > We already leverage this for MIPI camera sensors
> > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n265).
> >
> > - Device Tree : Has a property for this within
> > video-interface-devices.yaml
> > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/media/video-interface-devices.yaml#n386).
> >
> > I propose adding a similar property to usb-device.yaml
> > (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb-device.yaml).
> >
> > The ultimate goal is to have this information consumed by the video
> > driver and exposed to userspace via the V4L2_CID_CAMERA_ORIENTATION
> > control (https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-camera.html).
> >
> > What do you think about this?
>
> I think you should copy what ACPI does here, as long as it doesn't
> conflict with the existing video-interface-devices.yaml definition.
Right. While the notions of "user-facing" and "world-facing" might make
sense for cameras, they do not make sense for arbitrary USB devices. So
they shouldn't be part of the general USB device description.
Alan Stern
> Will that work?
>
> thanks,
>
> greg k-h
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-12 15:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 13:42 Annotating USB device Location in DT Ricardo Ribalda
2024-12-12 14:03 ` Greg KH
2024-12-12 15:15 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox