@@ -101,21 +101,23 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
101101
102102static const struct dmi_system_id override_rotation [] = {
103103 /*
104- * Systems on which rotation value need's to be inverted but ssdb->degree value is 0 (normal)
104+ * Systems on which rotation value need's to be overridden but ssdb->degree value is 0 (normal)
105105 */
106106 {
107107 .ident = "Microsoft Surface Pro 9" ,
108108 .matches = {
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,9 +273,10 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
271273static 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- }
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+ return (u32 )(uintptr_t )dmi_rotation -> driver_data ;
277280 switch (ssdb -> degree ) {
278281 case IPU_SENSOR_ROTATION_NORMAL :
279282 return 0 ;
0 commit comments