Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions drivers/media/pci/intel/ipu-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
},
.driver_data = "OVTI5693",
},
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"),
},
.driver_data = "OVTID858",
},
{} /* Terminating entry */
};

Expand Down Expand Up @@ -291,9 +298,18 @@ 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 can have more than one sensor whose rotation must be
* overridden (e.g. both the front and the rear camera), listed as
* one entry per sensor sharing the same DMI match.
* dmi_first_match() only ever returns the first matching entry, so
* walk the whole table and match each candidate against the
* sensor's ACPI HID.
*/
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:
Expand Down