The ACPI has ways to annotate the location of a USB device. Wire that annotation to a v4l2 control. To support all possible devices, add a way to annotate USB devices on DT as well. The original binding discussion happened here: https://lore.kernel.org/linux-devicetree/20241212-usb-orientation-v1-1-0b69adf05f37@xxxxxxxxxxxx/ The following patches are needed regardless if we finally add support for orientation and rotation or not: - media: uvcvideo: Always set default_value - media: uvcvideo: Do not create MC entities for virtual entities Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx> --- Changes in v2: - Add support for rotation - Rename fwnode to swentity - Remove the patch to move the gpio file - Remove patches already in media-committers - Change priority of data origins - Patch mipi-disco - Link to v1: https://lore.kernel.org/r/20250403-uvc-orientation-v1-0-1a0cc595a62d@xxxxxxxxxxxx --- Ricardo Ribalda (12): media: uvcvideo: Always set default_value media: v4l: fwnode: Support ACPI's _PLD for v4l2_fwnode_device_parse ACPI: mipi-disco-img: Do not duplicate rotation info into swnodes media: ipu-bridge: Use v4l2_fwnode_device_parse helper media: ipu-bridge: Use v4l2_fwnode for unknown rotations dt-bindings: usb: usb-device: Add orientation and rotation media: uvcvideo: Make uvc_alloc_entity non static media: uvcvideo: Add support for V4L2_CID_CAMERA_ORIENTATION media: uvcvideo: Add uvc_ctrl_query_entity helper media: uvcvideo: Add get_* functions to uvc_entity media: uvcvideo: Add support for V4L2_CID_CAMERA_ROTATION media: uvcvideo: Do not create MC entities for virtual entities .../devicetree/bindings/usb/usb-device.yaml | 10 ++ drivers/acpi/mipi-disco-img.c | 15 --- drivers/media/pci/intel/ipu-bridge.c | 52 ++++---- drivers/media/usb/uvc/Makefile | 3 +- drivers/media/usb/uvc/uvc_ctrl.c | 132 ++++++++++++++------- drivers/media/usb/uvc/uvc_driver.c | 18 ++- drivers/media/usb/uvc/uvc_entity.c | 11 ++ drivers/media/usb/uvc/uvc_swentity.c | 118 ++++++++++++++++++ drivers/media/usb/uvc/uvcvideo.h | 29 +++++ drivers/media/v4l2-core/v4l2-fwnode.c | 85 ++++++++++++- include/linux/usb/uvc.h | 3 + 11 files changed, 377 insertions(+), 99 deletions(-) --- base-commit: 5e1ff2314797bf53636468a97719a8222deca9ae change-id: 20250403-uvc-orientation-5f7f19da5adb Best regards, -- Ricardo Ribalda <ribalda@xxxxxxxxxxxx>