]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Tue, 9 Dec 2025 09:18:50 +0000 (10:18 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 6 Jan 2026 08:33:33 +0000 (09:33 +0100)
The Dell XPS 13 9350 and XPS 16 9640 both have an upside-down mounted
OV02C10 sensor. This rotation of 180° is reported in neither the SSDB nor
the _PLD for the sensor (both report a rotation of 0°).

Add a DMI quirk mechanism for upside-down sensors and add 2 initial entries
to the DMI quirk list for these 2 laptops.

Note the OV02C10 driver was originally developed on a XPS 16 9640 which
resulted in inverted vflip + hflip settings making it look like the sensor
was upright on the XPS 16 9640 and upside down elsewhere this has been
fixed in commit d5ebe3f7d13d ("media: ov02c10: Fix default vertical flip").
This makes this commit a regression fix since now the video is upside down
on these Dell XPS models where it was not before.

Fixes: d5ebe3f7d13d ("media: ov02c10: Fix default vertical flip")
Cc: stable@vger.kernel.org
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/intel/Kconfig
drivers/media/pci/intel/ipu-bridge.c

index d9fcddce028bf736557e2c6c289d4f8056d80756..3f14ca110d06ccf7b9e390530399d7e7e094f5e2 100644 (file)
@@ -6,7 +6,7 @@ source "drivers/media/pci/intel/ivsc/Kconfig"
 
 config IPU_BRIDGE
        tristate "Intel IPU Bridge"
-       depends on ACPI || COMPILE_TEST
+       depends on ACPI
        depends on I2C
        help
          The IPU bridge is a helper library for Intel IPU drivers to
index c9827e9fe6ffcc20a2abafe3c6ef74f606cfbf46..b2b710094914cc34c47337d4eebe61970e6e9220 100644 (file)
@@ -5,6 +5,7 @@
 #include <acpi/acpi_bus.h>
 #include <linux/cleanup.h>
 #include <linux/device.h>
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/mei_cl_bus.h>
 #include <linux/platform_device.h>
@@ -98,6 +99,28 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
        IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
 };
 
+/*
+ * DMI matches for laptops which have their sensor mounted upside-down
+ * without reporting a rotation of 180° in neither the SSDB nor the _PLD.
+ */
+static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
+       {
+               .matches = {
+                       DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"),
+               },
+               .driver_data = "OVTI02C1",
+       },
+       {
+               .matches = {
+                       DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"),
+               },
+               .driver_data = "OVTI02C1",
+       },
+       {} /* Terminating entry */
+};
+
 static const struct ipu_property_names prop_names = {
        .clock_frequency = "clock-frequency",
        .rotation = "rotation",
@@ -248,6 +271,12 @@ out_free_buff:
 static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
                                     struct ipu_sensor_ssdb *ssdb)
 {
+       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;
+
        switch (ssdb->degree) {
        case IPU_SENSOR_ROTATION_NORMAL:
                return 0;