media: support upside-down camera mounting
cover media: support upside-down camera mounting
Some platforms use camera sensors mounted upside-down. This series adds support for handling these sensors to ensure that captured images match the device's mechanical orientation.
- Extend ipu-bridge upside-down matching with ACPI _DSM module identifiers.
- Add upside-down quirks for selected Dell products
Jimmy Su (2):
media: ipu-bridge: extend upside-down matching with DSM module IDs
media: ipu-bridge: add upside-down quirks for Dell PA14260 & DA14260
drivers/media/pci/intel/ipu-bridge.c | 119 ++++++++++++++++++++++++--- 1 file changed, 106 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 media: ipu-bridge: extend upside-down matching with DSM module IDs
The existing upside-down sensor detection relies on sensor HID matching. However, some platforms may source camera modules from multiple vendors. While the sensor HID remains the same, camera modules from different vendors may be mounted in different orientations.
Extend the upside-down matching mechanism to support ACPI _DSM module identifiers. The driver retrieves the module ID from the sensor device and applies a 180-degree rotation quirk when a matching module ID is found.
This allows platform-specific rotation handling for camera modules that cannot be distinguished by sensor HID alone.
--- drivers/media/pci/intel/ipu-bridge.c | 95 ++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 13 deletions(-)
drivers/media/pci/intel/ipu-bridge.c +82 -13
@@ -36,6 +36,15 @@*/ #define IVSC_DEV_NAME "intel_vsc" +/* +* 822ace8f-2814-4174-a56b-5f029fe079ee +* This _DSM GUID returns a string from the sensor device, which acts as a +* module identifier. +*/ +static const guid_t sensor_module_guid = +GUID_INIT (0x822ace8f ,0x2814 ,0x4174 , +0xa5 ,0x6b ,0x5f ,0x02 ,0x9f ,0xe0 ,0x79 ,0xee ); +/* * Extend this array with ACPI Hardware IDs of devices known to be working * plus the number of link-frequencies expected by their drivers, along with
@@ -105,6 +114,36 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = { IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000), }; +/* +* Upside-down orientation can be determined by the Sensor HID or module ID. +* Camera modules from different vendors may be mounted in opposite +* orientations. +*/ +enum upside_down_match_type { +UPSIDE_DOWN_MATCH_HID =1 , +UPSIDE_DOWN_MATCH_DSM , +}; + +struct upside_down_match_info { +enum upside_down_match_type type; +const char *const ids[2 ]; +}; + +static struct upside_down_match_info ov02c10_match = { + .type =UPSIDE_DOWN_MATCH_HID , + .ids = {"OVTI02C1" }, +}; + +static struct upside_down_match_info imx471_match = { + .type =UPSIDE_DOWN_MATCH_HID , + .ids = {"SONY471A" }, +}; + +static struct upside_down_match_info ov02e10_match = { + .type =UPSIDE_DOWN_MATCH_HID , + .ids = {"OVTI02E1" }, +}; +/* * DMI matches for laptops which have their sensor mounted upside-down * without reporting a rotation of 180° in neither the SSDB nor the _PLD.
@@ -115,35 +154,35 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9340"), }, - .driver_data = "OVTI02C1", + .driver_data = &ov02c10_match, }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"), }, - .driver_data = "OVTI02C1", + .driver_data = &ov02c10_match, }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 14 9440"), }, - .driver_data = "OVTI02C1", + .driver_data = &ov02c10_match, }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"), }, - .driver_data = "OVTI02C1", + .driver_data = &ov02c10_match, }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 (Dell 16 Premium) DA16250"), }, - .driver_data = "OVTI02C1", + .driver_data = &ov02c10_match, }, /* * The first four characters of DMI_BOARD_NAME identify the Lenovo
@@ -158,7 +197,7 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_BOARD_NAME, "21QA"), }, - .driver_data = "SONY471A", + .driver_data = &imx471_match, }, {/* Lenovo X9-14 */
@@ -166,7 +205,7 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_BOARD_NAME, "21QB"), }, - .driver_data = "SONY471A", + .driver_data = &imx471_match, }, {/* Lenovo X9-15 */
@@ -174,7 +213,7 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_BOARD_NAME, "21Q6"), }, - .driver_data = "SONY471A", + .driver_data = &imx471_match, }, {/* Lenovo X9-15 */
@@ -182,7 +221,7 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_BOARD_NAME, "21Q7"), }, - .driver_data = "SONY471A", + .driver_data = &imx471_match, }, {/* Samsung Galaxy Book5 Pro 360 */
@@ -190,7 +229,7 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "960QHA"), }, - .driver_data = "OVTI02E1", + .driver_data = &ov02e10_match, }, {}/* Terminating entry */ };
@@ -359,9 +398,39 @@ static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,/* A machine may have one entry per sensor, so check all matches. */ for (dmi_id =dmi_first_match (upside_down_sensor_dmi_ids); dmi_id; - dmi_id =dmi_first_match (dmi_id +1 )) -if (acpi_dev_hid_match (adev, dmi_id->driver_data)) -return 180 ; + dmi_id =dmi_first_match (dmi_id +1 )) { +const struct upside_down_match_info *match = + dmi_id->driver_data; +union acpi_object *obj; +size_t i; + +switch (match->type) { +case UPSIDE_DOWN_MATCH_HID : +for (i =0 ; i <ARRAY_SIZE (match->ids) && match->ids[i]; + i++) +if (acpi_dev_hid_match (adev, match->ids[i])) +return 180 ; +break ; +case UPSIDE_DOWN_MATCH_DSM : + obj =acpi_evaluate_dsm_typed (adev->handle, + &sensor_module_guid,0x00 , +0x01 ,NULL , +ACPI_TYPE_STRING ); +if (!obj) +break ; + +for (i =0 ; i <ARRAY_SIZE (match->ids) && match->ids[i]; + i++) +if (!strcmp (match->ids[i], + obj->string.pointer)) { +ACPI_FREE (obj); +return 180 ; + } + +ACPI_FREE (obj); +break ; + } + }switch (ssdb->degree) {case IPU_SENSOR_ROTATION_NORMAL :
Signature · 1 line
2.34.1
Re: [PATCH v1 1/2] media: ipu-bridge: extend upside-down matching with DSM module IDs
Hi Jimmy,
Quoted 5 lines · Jimmy Su
The existing upside-down sensor detection relies on sensor HID matching. However, some platforms may source camera modules from multiple vendors. While the sensor HID remains the same, camera modules from different vendors may be mounted in different orientations.
Quoted 7 lines
Extend the upside-down matching mechanism to support ACPI
_DSMmodule identifiers. The driver retrieves the module ID from the sensor device and applies a 180-degree rotation quirk when a matching module ID is found.This allows platform-specific rotation handling for camera modules that cannot be distinguished by sensor HID alone.
On second thought -- instead I'd add a second array for module GUID matching. I think it's cleaner that way. The resulting patches are simpler, too.
Signature · 3 lines
Regards, Sakari Ailus
RE: [PATCH v1 1/2] media: ipu-bridge: extend upside-down matching with DSM module IDs
Hi Sakari,
I think we can integrate the two patches to one.
Because I saw one patch is already existing in current codebase. We can submit one patch to change the struct array and support module ID. Then we can go back to our internal review first.
How do you think ?
Jimmy
-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Monday, November 16, 2026 8:31 PM
To: Su, Jimmy <[email protected]>
Cc: [email protected]; Yeh, Serin <[email protected]>; [email protected]; Sapre, Sarang <[email protected]>
Subject: Re: [PATCH v1 1/2] media: ipu-bridge: extend upside-down matching with DSM module IDs
Hi Jimmy,
Quoted 5 lines · Jimmy Su
The existing upside-down sensor detection relies on sensor HID matching. However, some platforms may source camera modules from multiple vendors. While the sensor HID remains the same, camera modules from different vendors may be mounted in different orientations.
Quoted 7 lines
Extend the upside-down matching mechanism to support ACPI
_DSMmodule identifiers. The driver retrieves the module ID from the sensor device and applies a 180-degree rotation quirk when a matching module ID is found.This allows platform-specific rotation handling for camera modules that cannot be distinguished by sensor HID alone.
On second thought -- instead I'd add a second array for module GUID matching. I think it's cleaner that way. The resulting patches are simpler, too.
--
Regards,
Sakari Ailus
Re: [PATCH v1 1/2] media: ipu-bridge: extend upside-down matching with DSM module IDs
Hi Jimmy,
Quoted 6 lines · Jimmy
Hi Sakari,
I think we can integrate the two patches to one.
Because I saw one patch is already existing in current codebase. We can submit one patch to change the struct array and support module ID. Then we can go back to our internal review first.
How do you think ?
Feel free to post it to LMML first as we're already reviewing this here.
Signature · 3 lines
Regards, Sakari Ailus
PATCH 2/2 media: ipu-bridge: add upside-down quirks for Dell PA14260 & DA14260
In reply to Jimmy SuAdd rotation quirks for two Dell platforms:
- XPS 14 DA14260, which uses an OV08X40 sensor and can be identified through its sensor HID.
- Dell Pro 14 Premium PA14260, which may use camera modules sharing the same sensor HID as other systems but requiring a different orientation. Match these modules using ACPI _DSM module identifiers and apply a 180-degree rotation override when a matching module is detected.
--- drivers/media/pci/intel/ipu-bridge.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/media/pci/intel/ipu-bridge.c +24 -0
@@ -144,6 +144,16 @@ static struct upside_down_match_info ov02e10_match = { .ids = { "OVTI02E1" }, }; +static const struct upside_down_match_info ov08x40_match = { + .type =UPSIDE_DOWN_MATCH_HID , + .ids = {"OVTI08F4" }, +}; + +static const struct upside_down_match_info pa14260_match = { + .type =UPSIDE_DOWN_MATCH_DSM , + .ids = {"CJFOE90_B" ,"BBG809N3A_B" }, +}; +/* * DMI matches for laptops which have their sensor mounted upside-down * without reporting a rotation of 180° in neither the SSDB nor the _PLD.
@@ -184,6 +194,20 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = { }, .driver_data = &ov02c10_match, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 14 DA14260"), + }, + .driver_data = (void *)&ov08x40_match, + }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Dell Pro 14 Premium PA14260"), + }, + .driver_data = (void *)&pa14260_match, + }, /* * The first four characters of DMI_BOARD_NAME identify the Lenovo * machine type/model. For example, a DMI_BOARD_NAME starting with
Signature · 1 line
2.34.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Sakari,
I checked the latest codebase and would like to confirm with you.
For my current situation, I need to rebase and re-submit the patches to v2 version, right? Since it looks a big change for ipu-bridge.c recently.
Regards,
Jimmy
-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Friday, November 13, 2026 4:40 PM
To: Su, Jimmy <[email protected]>
Cc: [email protected]; Yeh, Serin <[email protected]>; [email protected]; Sapre, Sarang <[email protected]>
Subject: Re: [PATCH v1 0/2] media: support upside-down camera mounting
Hi Jimmy,
Quoted 11 lines · Jimmy Su
Some platforms use camera sensors mounted upside-down. This series adds support for handling these sensors to ensure that captured images match the device's mechanical orientation.
- Extend ipu-bridge upside-down matching with ACPI
_DSMmodule identifiers.- Add upside-down quirks for selected Dell products
Jimmy Su (2):
media: ipu-bridge: extend upside-down matching with DSM module IDs
media: ipu-bridge: add upside-down quirks for Dell PA14260 & DA14260
Can you rebase this on current media committers tree? There were lots of new systems for the upside-down list that I just merged.
--
Regards,
Sakari Ailus
Hi Jimmy,
Quoted 4 lines · Jimmy
Hi Sakari,
I checked the latest codebase and would like to confirm with you. For my current situation, I need to rebase and re-submit the patches to v2 version, right?
Yes, please.
Signature · 3 lines
Regards, Sakari Ailus