Skip to content

Commit b757101

Browse files
Hans de GoedeHans Verkuil
authored andcommitted
media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
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 d5ebe3f ("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: d5ebe3f ("media: ov02c10: Fix default vertical flip") Cc: [email protected] Reviewed-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 1d2e3b4 commit b757101

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

drivers/media/pci/intel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source "drivers/media/pci/intel/ivsc/Kconfig"
66

77
config IPU_BRIDGE
88
tristate "Intel IPU Bridge"
9-
depends on ACPI || COMPILE_TEST
9+
depends on ACPI
1010
depends on I2C
1111
help
1212
The IPU bridge is a helper library for Intel IPU drivers to

drivers/media/pci/intel/ipu-bridge.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <acpi/acpi_bus.h>
66
#include <linux/cleanup.h>
77
#include <linux/device.h>
8+
#include <linux/dmi.h>
89
#include <linux/i2c.h>
910
#include <linux/mei_cl_bus.h>
1011
#include <linux/platform_device.h>
@@ -98,6 +99,28 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
9899
IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
99100
};
100101

102+
/*
103+
* DMI matches for laptops which have their sensor mounted upside-down
104+
* without reporting a rotation of 180° in neither the SSDB nor the _PLD.
105+
*/
106+
static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
107+
{
108+
.matches = {
109+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
110+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"),
111+
},
112+
.driver_data = "OVTI02C1",
113+
},
114+
{
115+
.matches = {
116+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
117+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"),
118+
},
119+
.driver_data = "OVTI02C1",
120+
},
121+
{} /* Terminating entry */
122+
};
123+
101124
static const struct ipu_property_names prop_names = {
102125
.clock_frequency = "clock-frequency",
103126
.rotation = "rotation",
@@ -248,6 +271,12 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
248271
static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
249272
struct ipu_sensor_ssdb *ssdb)
250273
{
274+
const struct dmi_system_id *dmi_id;
275+
276+
dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
277+
if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
278+
return 180;
279+
251280
switch (ssdb->degree) {
252281
case IPU_SENSOR_ROTATION_NORMAL:
253282
return 0;

0 commit comments

Comments
 (0)