* [PATCH] dt-bindings: usb: usb-device: Add panel-location
@ 2024-12-12 21:44 Ricardo Ribalda
2024-12-17 14:56 ` Rob Herring
0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2024-12-12 21:44 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus
Cc: linux-usb, devicetree, linux-kernel, linux-media, Ricardo Ribalda
For some devices like cameras the system needs to know where they are
mounted.
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, but it is limited to the requirements of video devices:
Documentation/devicetree/bindings/media/video-interface-devices.yaml
Add a new property for usb-devices that matches the behavior of
ACPI's _PLD.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Documentation/devicetree/bindings/usb/usb-device.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml b/Documentation/devicetree/bindings/usb/usb-device.yaml
index da890ee60ce6..1ce79c1c3b31 100644
--- a/Documentation/devicetree/bindings/usb/usb-device.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
@@ -42,6 +42,20 @@ properties:
port to which this device is attached. The range is 1-255.
maxItems: 1
+ panel-location:
+ description: Describes which panel surface of the system's housing the USB
+ device resides on. It has the same meaning as the `ACPI`'s `_PLD` Panel
+ object.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum:
+ - 0 # Top.
+ - 1 # Bottom.
+ - 2 # Left.
+ - 3 # Right.
+ - 4 # Front (aka as User Facing).
+ - 5 # Back (aka as World Facing).
+ - 6 # Unknown.
+
"#address-cells":
description: should be 1 for hub nodes with device nodes,
should be 2 for device nodes with interface nodes.
---
base-commit: eefa7a9c069908412f8f5d15833901d1b46ae1b2
change-id: 20241212-usb-orientation-8e3717ebb02a
Best regards,
--
Ricardo Ribalda <ribalda@chromium.org>
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-12 21:44 [PATCH] dt-bindings: usb: usb-device: Add panel-location Ricardo Ribalda
@ 2024-12-17 14:56 ` Rob Herring
2024-12-17 15:24 ` Ricardo Ribalda
0 siblings, 1 reply; 13+ messages in thread
From: Rob Herring @ 2024-12-17 14:56 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> For some devices like cameras the system needs to know where they are
> mounted.
Why do you need this and why only this property and not the dozens
others ACPI has?
>
> 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, but it is limited to the requirements of video devices:
> Documentation/devicetree/bindings/media/video-interface-devices.yaml
>
> Add a new property for usb-devices that matches the behavior of
> ACPI's _PLD.
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> Documentation/devicetree/bindings/usb/usb-device.yaml | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml b/Documentation/devicetree/bindings/usb/usb-device.yaml
> index da890ee60ce6..1ce79c1c3b31 100644
> --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> @@ -42,6 +42,20 @@ properties:
> port to which this device is attached. The range is 1-255.
> maxItems: 1
>
> + panel-location:
> + description: Describes which panel surface of the system's housing the USB
> + device resides on. It has the same meaning as the `ACPI`'s `_PLD` Panel
> + object.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum:
> + - 0 # Top.
> + - 1 # Bottom.
> + - 2 # Left.
> + - 3 # Right.
> + - 4 # Front (aka as User Facing).
> + - 5 # Back (aka as World Facing).
> + - 6 # Unknown.
> +
> "#address-cells":
> description: should be 1 for hub nodes with device nodes,
> should be 2 for device nodes with interface nodes.
>
> ---
> base-commit: eefa7a9c069908412f8f5d15833901d1b46ae1b2
> change-id: 20241212-usb-orientation-8e3717ebb02a
>
> Best regards,
> --
> Ricardo Ribalda <ribalda@chromium.org>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-17 14:56 ` Rob Herring
@ 2024-12-17 15:24 ` Ricardo Ribalda
2024-12-19 12:24 ` Rob Herring
0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2024-12-17 15:24 UTC (permalink / raw)
To: Rob Herring
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
Hi Rob
On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > For some devices like cameras the system needs to know where they are
> > mounted.
>
> Why do you need this and why only this property and not the dozens
> others ACPI has?
Userspace needs that information to correctly show it in the UI. Eg;
- User facing camera needs to be mirrored during preview.
- The user facing camera is selected by default during videoconferences
- The world facing camera is selected by default when taking a photo
- User facing camera have different parameter defaults than world facing.
Right now, the only camera driver that expose the ACPI location
information is the IPU from intel
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n258
And they are only using the panel.
If we need more information we can consider adding more parameters in
the future.
>
> >
> > 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, but it is limited to the requirements of video devices:
> > Documentation/devicetree/bindings/media/video-interface-devices.yaml
> >
> > Add a new property for usb-devices that matches the behavior of
> > ACPI's _PLD.
> >
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> > Documentation/devicetree/bindings/usb/usb-device.yaml | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > index da890ee60ce6..1ce79c1c3b31 100644
> > --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > @@ -42,6 +42,20 @@ properties:
> > port to which this device is attached. The range is 1-255.
> > maxItems: 1
> >
> > + panel-location:
> > + description: Describes which panel surface of the system's housing the USB
> > + device resides on. It has the same meaning as the `ACPI`'s `_PLD` Panel
> > + object.
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + enum:
> > + - 0 # Top.
> > + - 1 # Bottom.
> > + - 2 # Left.
> > + - 3 # Right.
> > + - 4 # Front (aka as User Facing).
> > + - 5 # Back (aka as World Facing).
> > + - 6 # Unknown.
> > +
> > "#address-cells":
> > description: should be 1 for hub nodes with device nodes,
> > should be 2 for device nodes with interface nodes.
> >
> > ---
> > base-commit: eefa7a9c069908412f8f5d15833901d1b46ae1b2
> > change-id: 20241212-usb-orientation-8e3717ebb02a
> >
> > Best regards,
> > --
> > Ricardo Ribalda <ribalda@chromium.org>
> >
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-17 15:24 ` Ricardo Ribalda
@ 2024-12-19 12:24 ` Rob Herring
2024-12-19 12:29 ` Sakari Ailus
2024-12-19 12:42 ` Ricardo Ribalda
0 siblings, 2 replies; 13+ messages in thread
From: Rob Herring @ 2024-12-19 12:24 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> Hi Rob
>
> On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> >
> > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > For some devices like cameras the system needs to know where they are
> > > mounted.
> >
> > Why do you need this and why only this property and not the dozens
> > others ACPI has?
>
> Userspace needs that information to correctly show it in the UI. Eg;
>
> - User facing camera needs to be mirrored during preview.
> - The user facing camera is selected by default during videoconferences
> - The world facing camera is selected by default when taking a photo
> - User facing camera have different parameter defaults than world facing.
We already have "orientation" defined for this purpose.
>
> Right now, the only camera driver that expose the ACPI location
> information is the IPU from intel
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n258
>
> And they are only using the panel.
>
> If we need more information we can consider adding more parameters in
> the future.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-19 12:24 ` Rob Herring
@ 2024-12-19 12:29 ` Sakari Ailus
2024-12-19 12:42 ` Ricardo Ribalda
1 sibling, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2024-12-19 12:29 UTC (permalink / raw)
To: Rob Herring
Cc: Ricardo Ribalda, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
Hello,
On Thu, Dec 19, 2024 at 06:24:53AM -0600, Rob Herring wrote:
> On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > Hi Rob
> >
> > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > For some devices like cameras the system needs to know where they are
> > > > mounted.
> > >
> > > Why do you need this and why only this property and not the dozens
> > > others ACPI has?
> >
> > Userspace needs that information to correctly show it in the UI. Eg;
> >
> > - User facing camera needs to be mirrored during preview.
> > - The user facing camera is selected by default during videoconferences
> > - The world facing camera is selected by default when taking a photo
> > - User facing camera have different parameter defaults than world facing.
>
> We already have "orientation" defined for this purpose.
I was thinking of the same. It's defined (for cameras) in
Documentation/devicetree/bindings/media/video-interface-devices.yaml .
>
> >
> > Right now, the only camera driver that expose the ACPI location
> > information is the IPU from intel
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n258
> >
> > And they are only using the panel.
> >
> > If we need more information we can consider adding more parameters in
> > the future.
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-19 12:24 ` Rob Herring
2024-12-19 12:29 ` Sakari Ailus
@ 2024-12-19 12:42 ` Ricardo Ribalda
2024-12-20 22:00 ` Rob Herring
1 sibling, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2024-12-19 12:42 UTC (permalink / raw)
To: Rob Herring
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
On Thu, 19 Dec 2024 at 13:24, Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > Hi Rob
> >
> > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > For some devices like cameras the system needs to know where they are
> > > > mounted.
> > >
> > > Why do you need this and why only this property and not the dozens
> > > others ACPI has?
> >
> > Userspace needs that information to correctly show it in the UI. Eg;
> >
> > - User facing camera needs to be mirrored during preview.
> > - The user facing camera is selected by default during videoconferences
> > - The world facing camera is selected by default when taking a photo
> > - User facing camera have different parameter defaults than world facing.
>
> We already have "orientation" defined for this purpose.
Do you mean orientation from
bindings/media/video-interface-devices.yaml ?
I see a couple of issues:
- Orientation has a very specific meaning for USB typeC. I'd prefer if
we could avoid using that word.
- For other applications different than cameras it might be useful to
know the positions top, bottom, left, right, which are not available
in video-interface-devices
- The value "external" does not makes too much sense for listed usb devices
- It makes our lives easier if dt and acpi have the same meaning (less
conversion)
All that said, for my specific usecase, reusing orientation from
bindings/media/video-interface-devices.yaml works... So if that is
what you all prefer I can send a v2 with that.
Let me know what you think
>
> >
> > Right now, the only camera driver that expose the ACPI location
> > information is the IPU from intel
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/pci/intel/ipu-bridge.c#n258
> >
> > And they are only using the panel.
> >
> > If we need more information we can consider adding more parameters in
> > the future.
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-19 12:42 ` Ricardo Ribalda
@ 2024-12-20 22:00 ` Rob Herring
2025-01-07 10:37 ` Ricardo Ribalda
0 siblings, 1 reply; 13+ messages in thread
From: Rob Herring @ 2024-12-20 22:00 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
On Thu, Dec 19, 2024 at 6:42 AM Ricardo Ribalda <ribalda@chromium.org> wrote:
>
> On Thu, 19 Dec 2024 at 13:24, Rob Herring <robh@kernel.org> wrote:
> >
> > On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > > Hi Rob
> > >
> > > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > > For some devices like cameras the system needs to know where they are
> > > > > mounted.
> > > >
> > > > Why do you need this and why only this property and not the dozens
> > > > others ACPI has?
> > >
> > > Userspace needs that information to correctly show it in the UI. Eg;
> > >
> > > - User facing camera needs to be mirrored during preview.
> > > - The user facing camera is selected by default during videoconferences
> > > - The world facing camera is selected by default when taking a photo
> > > - User facing camera have different parameter defaults than world facing.
> >
> > We already have "orientation" defined for this purpose.
>
> Do you mean orientation from
> bindings/media/video-interface-devices.yaml ?
>
> I see a couple of issues:
> - Orientation has a very specific meaning for USB typeC. I'd prefer if
> we could avoid using that word.
Yes, but this is tied to the class of the device, not the bus. I find
defining the position for USB devices confusing.
> - For other applications different than cameras it might be useful to
> know the positions top, bottom, left, right, which are not available
> in video-interface-devices
Other devices may need some of the 20 other properties in the ACPI
table as well.
> - The value "external" does not makes too much sense for listed usb devices
Then don't use it.
> - It makes our lives easier if dt and acpi have the same meaning (less
> conversion)
We have little to no input into what ACPI does. If we're just going to
copy ACPI, then just use ACPI instead.
> All that said, for my specific usecase, reusing orientation from
> bindings/media/video-interface-devices.yaml works... So if that is
> what you all prefer I can send a v2 with that.
> Let me know what you think
We already have something for cameras. Use it.
Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2024-12-20 22:00 ` Rob Herring
@ 2025-01-07 10:37 ` Ricardo Ribalda
2025-01-08 8:45 ` Sakari Ailus
0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2025-01-07 10:37 UTC (permalink / raw)
To: Rob Herring
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Jacopo Mondi, Sakari Ailus, linux-usb,
devicetree, linux-kernel, linux-media
On Fri, 20 Dec 2024 at 23:00, Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Dec 19, 2024 at 6:42 AM Ricardo Ribalda <ribalda@chromium.org> wrote:
> >
> > On Thu, 19 Dec 2024 at 13:24, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > > > Hi Rob
> > > >
> > > > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > > > For some devices like cameras the system needs to know where they are
> > > > > > mounted.
> > > > >
> > > > > Why do you need this and why only this property and not the dozens
> > > > > others ACPI has?
> > > >
> > > > Userspace needs that information to correctly show it in the UI. Eg;
> > > >
> > > > - User facing camera needs to be mirrored during preview.
> > > > - The user facing camera is selected by default during videoconferences
> > > > - The world facing camera is selected by default when taking a photo
> > > > - User facing camera have different parameter defaults than world facing.
> > >
> > > We already have "orientation" defined for this purpose.
> >
> > Do you mean orientation from
> > bindings/media/video-interface-devices.yaml ?
> >
> > I see a couple of issues:
> > - Orientation has a very specific meaning for USB typeC. I'd prefer if
> > we could avoid using that word.
>
> Yes, but this is tied to the class of the device, not the bus. I find
> defining the position for USB devices confusing.
>
> > - For other applications different than cameras it might be useful to
> > know the positions top, bottom, left, right, which are not available
> > in video-interface-devices
>
> Other devices may need some of the 20 other properties in the ACPI
> table as well.
>
> > - The value "external" does not makes too much sense for listed usb devices
>
> Then don't use it.
>
> > - It makes our lives easier if dt and acpi have the same meaning (less
> > conversion)
>
> We have little to no input into what ACPI does. If we're just going to
> copy ACPI, then just use ACPI instead.
>
> > All that said, for my specific usecase, reusing orientation from
> > bindings/media/video-interface-devices.yaml works... So if that is
> > what you all prefer I can send a v2 with that.
> > Let me know what you think
>
> We already have something for cameras. Use it.
So you are proposing a change like this?
diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
b/Documentation/devicetree/bindings/usb/usb-device.yaml
index da890ee60ce6..5322772a4470 100644
--- a/Documentation/devicetree/bindings/usb/usb-device.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
@@ -37,6 +37,10 @@ properties:
but a device adhering to this binding may leave out all except
for "usbVID,PID".
+ orientation:
+ description: If present, specifies the orientation of the usb device.
+ $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
+
reg:
description: the number of the USB hub port or the USB host-controller
port to which this device is attached. The range is 1-255.
>
> Rob
--
Ricardo Ribalda
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2025-01-07 10:37 ` Ricardo Ribalda
@ 2025-01-08 8:45 ` Sakari Ailus
2025-01-08 8:51 ` Ricardo Ribalda
0 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2025-01-08 8:45 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Rob Herring, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
Hi Ricardo,
On Tue, Jan 07, 2025 at 11:37:18AM +0100, Ricardo Ribalda wrote:
> On Fri, 20 Dec 2024 at 23:00, Rob Herring <robh@kernel.org> wrote:
> >
> > On Thu, Dec 19, 2024 at 6:42 AM Ricardo Ribalda <ribalda@chromium.org> wrote:
> > >
> > > On Thu, 19 Dec 2024 at 13:24, Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > > > > Hi Rob
> > > > >
> > > > > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > > > > >
> > > > > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > > > > For some devices like cameras the system needs to know where they are
> > > > > > > mounted.
> > > > > >
> > > > > > Why do you need this and why only this property and not the dozens
> > > > > > others ACPI has?
> > > > >
> > > > > Userspace needs that information to correctly show it in the UI. Eg;
> > > > >
> > > > > - User facing camera needs to be mirrored during preview.
> > > > > - The user facing camera is selected by default during videoconferences
> > > > > - The world facing camera is selected by default when taking a photo
> > > > > - User facing camera have different parameter defaults than world facing.
> > > >
> > > > We already have "orientation" defined for this purpose.
> > >
> > > Do you mean orientation from
> > > bindings/media/video-interface-devices.yaml ?
> > >
> > > I see a couple of issues:
> > > - Orientation has a very specific meaning for USB typeC. I'd prefer if
> > > we could avoid using that word.
> >
> > Yes, but this is tied to the class of the device, not the bus. I find
> > defining the position for USB devices confusing.
> >
> > > - For other applications different than cameras it might be useful to
> > > know the positions top, bottom, left, right, which are not available
> > > in video-interface-devices
> >
> > Other devices may need some of the 20 other properties in the ACPI
> > table as well.
> >
> > > - The value "external" does not makes too much sense for listed usb devices
> >
> > Then don't use it.
> >
> > > - It makes our lives easier if dt and acpi have the same meaning (less
> > > conversion)
> >
> > We have little to no input into what ACPI does. If we're just going to
> > copy ACPI, then just use ACPI instead.
> >
> > > All that said, for my specific usecase, reusing orientation from
> > > bindings/media/video-interface-devices.yaml works... So if that is
> > > what you all prefer I can send a v2 with that.
> > > Let me know what you think
> >
> > We already have something for cameras. Use it.
>
> So you are proposing a change like this?
>
> diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> b/Documentation/devicetree/bindings/usb/usb-device.yaml
> index da890ee60ce6..5322772a4470 100644
> --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> @@ -37,6 +37,10 @@ properties:
> but a device adhering to this binding may leave out all except
> for "usbVID,PID".
>
> + orientation:
> + description: If present, specifies the orientation of the usb device.
> + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
Do you need this for a camera or for other kinds of USB devices, too?
What about e.g. the rotation property?
> +
>
>
> reg:
> description: the number of the USB hub port or the USB host-controller
> port to which this device is attached. The range is 1-255.
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2025-01-08 8:45 ` Sakari Ailus
@ 2025-01-08 8:51 ` Ricardo Ribalda
2025-01-08 9:13 ` Sakari Ailus
0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2025-01-08 8:51 UTC (permalink / raw)
To: Sakari Ailus
Cc: Rob Herring, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
On Wed, 8 Jan 2025 at 09:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hi Ricardo,
>
> On Tue, Jan 07, 2025 at 11:37:18AM +0100, Ricardo Ribalda wrote:
> > On Fri, 20 Dec 2024 at 23:00, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Dec 19, 2024 at 6:42 AM Ricardo Ribalda <ribalda@chromium.org> wrote:
> > > >
> > > > On Thu, 19 Dec 2024 at 13:24, Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Tue, Dec 17, 2024 at 04:24:27PM +0100, Ricardo Ribalda wrote:
> > > > > > Hi Rob
> > > > > >
> > > > > > On Tue, 17 Dec 2024 at 16:02, Rob Herring <robh@kernel.org> wrote:
> > > > > > >
> > > > > > > On Thu, Dec 12, 2024 at 09:44:37PM +0000, Ricardo Ribalda wrote:
> > > > > > > > For some devices like cameras the system needs to know where they are
> > > > > > > > mounted.
> > > > > > >
> > > > > > > Why do you need this and why only this property and not the dozens
> > > > > > > others ACPI has?
> > > > > >
> > > > > > Userspace needs that information to correctly show it in the UI. Eg;
> > > > > >
> > > > > > - User facing camera needs to be mirrored during preview.
> > > > > > - The user facing camera is selected by default during videoconferences
> > > > > > - The world facing camera is selected by default when taking a photo
> > > > > > - User facing camera have different parameter defaults than world facing.
> > > > >
> > > > > We already have "orientation" defined for this purpose.
> > > >
> > > > Do you mean orientation from
> > > > bindings/media/video-interface-devices.yaml ?
> > > >
> > > > I see a couple of issues:
> > > > - Orientation has a very specific meaning for USB typeC. I'd prefer if
> > > > we could avoid using that word.
> > >
> > > Yes, but this is tied to the class of the device, not the bus. I find
> > > defining the position for USB devices confusing.
> > >
> > > > - For other applications different than cameras it might be useful to
> > > > know the positions top, bottom, left, right, which are not available
> > > > in video-interface-devices
> > >
> > > Other devices may need some of the 20 other properties in the ACPI
> > > table as well.
> > >
> > > > - The value "external" does not makes too much sense for listed usb devices
> > >
> > > Then don't use it.
> > >
> > > > - It makes our lives easier if dt and acpi have the same meaning (less
> > > > conversion)
> > >
> > > We have little to no input into what ACPI does. If we're just going to
> > > copy ACPI, then just use ACPI instead.
> > >
> > > > All that said, for my specific usecase, reusing orientation from
> > > > bindings/media/video-interface-devices.yaml works... So if that is
> > > > what you all prefer I can send a v2 with that.
> > > > Let me know what you think
> > >
> > > We already have something for cameras. Use it.
> >
> > So you are proposing a change like this?
> >
> > diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > index da890ee60ce6..5322772a4470 100644
> > --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > @@ -37,6 +37,10 @@ properties:
> > but a device adhering to this binding may leave out all except
> > for "usbVID,PID".
> >
> > + orientation:
> > + description: If present, specifies the orientation of the usb device.
> > + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
>
> Do you need this for a camera or for other kinds of USB devices, too?
>
> What about e.g. the rotation property?
I need it for cameras. I do not have a usecase for rotation now, but I
might have in the future.
>
> > +
> >
> >
> > reg:
> > description: the number of the USB hub port or the USB host-controller
> > port to which this device is attached. The range is 1-255.
>
> --
> Regards,
>
> Sakari Ailus
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2025-01-08 8:51 ` Ricardo Ribalda
@ 2025-01-08 9:13 ` Sakari Ailus
2025-01-08 9:48 ` Ricardo Ribalda
0 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2025-01-08 9:13 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Rob Herring, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
Hi Ricardo,
On Wed, Jan 08, 2025 at 09:51:34AM +0100, Ricardo Ribalda wrote:
> > > diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > index da890ee60ce6..5322772a4470 100644
> > > --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > @@ -37,6 +37,10 @@ properties:
> > > but a device adhering to this binding may leave out all except
> > > for "usbVID,PID".
> > >
> > > + orientation:
> > > + description: If present, specifies the orientation of the usb device.
> > > + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
> >
> > Do you need this for a camera or for other kinds of USB devices, too?
> >
> > What about e.g. the rotation property?
>
> I need it for cameras. I do not have a usecase for rotation now, but I
> might have in the future.
If it's specific for cameras (UVC kind I presume?), wouldn't it be
reasonable to add specific bindings for it?
--
Sakari Ailus
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2025-01-08 9:13 ` Sakari Ailus
@ 2025-01-08 9:48 ` Ricardo Ribalda
2025-01-15 10:02 ` Sakari Ailus
0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Ribalda @ 2025-01-08 9:48 UTC (permalink / raw)
To: Sakari Ailus
Cc: Rob Herring, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
Hi Sakari
On Wed, 8 Jan 2025 at 10:13, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hi Ricardo,
>
> On Wed, Jan 08, 2025 at 09:51:34AM +0100, Ricardo Ribalda wrote:
> > > > diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > index da890ee60ce6..5322772a4470 100644
> > > > --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > @@ -37,6 +37,10 @@ properties:
> > > > but a device adhering to this binding may leave out all except
> > > > for "usbVID,PID".
> > > >
> > > > + orientation:
> > > > + description: If present, specifies the orientation of the usb device.
> > > > + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
> > >
> > > Do you need this for a camera or for other kinds of USB devices, too?
> > >
> > > What about e.g. the rotation property?
> >
> > I need it for cameras. I do not have a usecase for rotation now, but I
> > might have in the future.
>
> If it's specific for cameras (UVC kind I presume?), wouldn't it be
> reasonable to add specific bindings for it?
Yes, they are uvc cameras
Do you mean something like this:
diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
b/Documentation/devicetree/bindings/usb/usb-device.yaml
index da890ee60ce6..bc80c1e7360f 100644
--- a/Documentation/devicetree/bindings/usb/usb-device.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
@@ -75,6 +75,12 @@ patternProperties:
configuration value.
maxItems: 1
+ image-sensor:
+ description: Video interface properties associated to USB cameras,
+ typically UVC compliant.
+ allOf:
+ - $ref: /schemas/media/video-interface-devices.yaml#
+
required:
- reg
@@ -113,6 +119,9 @@ examples:
interface@0 {
compatible = "usbif123,abcd.config1.0";
reg = <0 1>;
+ image-sensor {
+ orientation: 0;
+ };
};
interface@0,2 {
>
> --
> Sakari Ailus
--
Ricardo Ribalda
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] dt-bindings: usb: usb-device: Add panel-location
2025-01-08 9:48 ` Ricardo Ribalda
@ 2025-01-15 10:02 ` Sakari Ailus
0 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2025-01-15 10:02 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Rob Herring, Greg Kroah-Hartman, Krzysztof Kozlowski,
Conor Dooley, Mauro Carvalho Chehab, Jacopo Mondi, linux-usb,
devicetree, linux-kernel, linux-media
Hi Ricardo,
On Wed, Jan 08, 2025 at 10:48:34AM +0100, Ricardo Ribalda wrote:
> Hi Sakari
>
> On Wed, 8 Jan 2025 at 10:13, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >
> > Hi Ricardo,
> >
> > On Wed, Jan 08, 2025 at 09:51:34AM +0100, Ricardo Ribalda wrote:
> > > > > diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > > b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > > index da890ee60ce6..5322772a4470 100644
> > > > > --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > > +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> > > > > @@ -37,6 +37,10 @@ properties:
> > > > > but a device adhering to this binding may leave out all except
> > > > > for "usbVID,PID".
> > > > >
> > > > > + orientation:
> > > > > + description: If present, specifies the orientation of the usb device.
> > > > > + $ref: /schemas/media/video-interface-devices.yaml#/properties/orientation
> > > >
> > > > Do you need this for a camera or for other kinds of USB devices, too?
> > > >
> > > > What about e.g. the rotation property?
> > >
> > > I need it for cameras. I do not have a usecase for rotation now, but I
> > > might have in the future.
> >
> > If it's specific for cameras (UVC kind I presume?), wouldn't it be
> > reasonable to add specific bindings for it?
> Yes, they are uvc cameras
>
> Do you mean something like this:
>
> diff --git a/Documentation/devicetree/bindings/usb/usb-device.yaml
> b/Documentation/devicetree/bindings/usb/usb-device.yaml
> index da890ee60ce6..bc80c1e7360f 100644
> --- a/Documentation/devicetree/bindings/usb/usb-device.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-device.yaml
> @@ -75,6 +75,12 @@ patternProperties:
> configuration value.
> maxItems: 1
>
> + image-sensor:
> + description: Video interface properties associated to USB cameras,
> + typically UVC compliant.
> + allOf:
> + - $ref: /schemas/media/video-interface-devices.yaml#
> +
I missed earlier the compatible string comes directly from the USB vendor
and product IDs and this isn't the primary means of identifying a USB
device anyway, IOW we couldn't have a compatible for UVC webcams for
instance.
None of the alternatives here seem exactly great to me but all of them
would likely just work.
I think I prefer your earlier suggestion, the question I have though is
whether or not it should be limited to certain VIDs/PIDs.
> required:
> - reg
>
> @@ -113,6 +119,9 @@ examples:
> interface@0 {
> compatible = "usbif123,abcd.config1.0";
> reg = <0 1>;
> + image-sensor {
> + orientation: 0;
> + };
> };
>
> interface@0,2 {
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-01-15 10:02 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 21:44 [PATCH] dt-bindings: usb: usb-device: Add panel-location Ricardo Ribalda
2024-12-17 14:56 ` Rob Herring
2024-12-17 15:24 ` Ricardo Ribalda
2024-12-19 12:24 ` Rob Herring
2024-12-19 12:29 ` Sakari Ailus
2024-12-19 12:42 ` Ricardo Ribalda
2024-12-20 22:00 ` Rob Herring
2025-01-07 10:37 ` Ricardo Ribalda
2025-01-08 8:45 ` Sakari Ailus
2025-01-08 8:51 ` Ricardo Ribalda
2025-01-08 9:13 ` Sakari Ailus
2025-01-08 9:48 ` Ricardo Ribalda
2025-01-15 10:02 ` Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox