Skip to content

Commit c46e6f4

Browse files
Use driver_data to store and set rotation value
1 parent 2a6ecd8 commit c46e6f4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ static const struct dmi_system_id override_rotation[] = {
109109
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
110110
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"),
111111
},
112+
.driver_data = (void *)180,
112113
},
113114
{
114115
.ident = "Microsoft Surface Pro 8",
115116
.matches = {
116117
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
117118
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 8"),
118119
},
120+
.driver_data = (void *)180,
119121
},
120122
{}
121123
};
@@ -271,8 +273,11 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
271273
static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
272274
struct ipu_sensor_ssdb *ssdb)
273275
{
274-
if (dmi_check_system(override_rotation)) {
275-
return 180;
276+
const struct dmi_system_id *dmi_rotation;
277+
dmi_rotation = dmi_first_match(override_rotation);
278+
if (dmi_rotation && dmi_rotation->driver_data) {
279+
dev_info(ADEV_DEV(adev), "Overriding rotation to: %d based on DMI match\n", (u32)(uintptr_t)dmi_rotation->driver_data);
280+
return (u32)(uintptr_t)dmi_rotation->driver_data;
276281
}
277282
switch (ssdb->degree) {
278283
case IPU_SENSOR_ROTATION_NORMAL:

0 commit comments

Comments
 (0)