Re: [PATCH 5/8] dt-bindings: usb: usb-device: Add orientation
From: Rob Herring
Date: Fri Apr 04 2025 - 15:37:09 EST
On Thu, Apr 03, 2025 at 07:16:16PM +0000, Ricardo Ribalda wrote:
> For some devices, such as cameras, the OS needs to know where they are
> mounted.
Do you have a usecase that's not a camera?
>
> ACPI has a property for this purpose, which is parsed by
> acpi_get_physical_device_location():
> https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html#pld-physical-location-of-device
>
> In DT we have similar property for video-interface-devices called
> orientation:
> Documentation/devicetree/bindings/media/video-interface-devices.yaml
>
> Add a new property orientation for usb-devices that matches the already
> existing orientation property of video-interface-devices.
>
> Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> ---
> Documentation/devicetree/bindings/usb/usb-device.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml b/Documentation/devicetree/bindings/usb/usb-device.yaml
> index da890ee60ce6e71a11910c565b6f805470782e4f..bbcda28ec7d5695307efa797f57180044afda77f 100644
> --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
This is a binding for *all* USB devices. This property should only be
added for devices where it makes sense.
> @@ -42,6 +42,10 @@ properties:
> port to which this device is attached. The range is 1-255.
> maxItems: 1
>
> + orientation:
> + description: If present, specifies the orientation of the usb device.
> + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
Reference the schema from the top level and drop
'/properties/orientation'.
What about 'rotation'? Seems like you'd want that too.
> +
> "#address-cells":
> description: should be 1 for hub nodes with device nodes,
> should be 2 for device nodes with interface nodes.
> @@ -101,6 +105,7 @@ examples:
> device@2 {
> compatible = "usb123,4567";
> reg = <2>;
> + orientation = <0>;
> };
>
> device@3 {
>
> --
> 2.49.0.504.g3bcea36a83-goog
>