On Mon Aug 10 16:30:26 2026 +0200, José MarÃa MartÃn wrote:
> A machine can have more than one sensor whose rotation needs to be
> overridden, which takes one upside_down_sensor_dmi_ids[] entry per
> sensor, all sharing the same DMI match but with different ACPI HIDs in
> driver_data.
>
> ipu_bridge_parse_rotation() uses dmi_first_match(), which always stops
> at the first entry matching the running machine, so any further entry
> for the same machine is unreachable and only one sensor per machine can
> ever be corrected.
>
> Walk the whole table and match every entry for the running machine
> against the sensor's ACPI HID instead.
>
> Fixes: b75710155a82 ("media: ipu-bridge: Add DMI quirk for Dell XPS laptops
> with upside down sensors")
> Cc: [email protected]
> Signed-off-by: José MarÃa MartÃn <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>
Patch committed.
Thanks,
Sakari Ailus
drivers/media/pci/intel/ipu-bridge.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/drivers/media/pci/intel/ipu-bridge.c
b/drivers/media/pci/intel/ipu-bridge.c
index f9efa501e8cf..1bb3a3e98d6b 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -357,9 +357,11 @@ static u32 ipu_bridge_parse_rotation(struct acpi_device
*adev,
{
const struct dmi_system_id *dmi_id;
- dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
- if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
- return 180;
+ /* 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;
switch (ssdb->degree) {
case IPU_SENSOR_ROTATION_NORMAL:
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]