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
31 changes: 31 additions & 0 deletions drivers/media/pci/intel/ipu-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/property.h>
#include <linux/string.h>
#include <linux/workqueue.h>
#include <linux/dmi.h>

#include <media/ipu-bridge.h>
#include <media/v4l2-fwnode.h>
Expand Down Expand Up @@ -98,6 +99,30 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
};

static const struct dmi_system_id override_rotation[] = {
/*
* Systems on which rotation value need's to be inverted but ssdb->degree value is 0 (normal)
*/
{
.ident = "Microsoft Surface Pro 9",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"),
},
.driver_data = (void *)180,
},
{
.ident = "Microsoft Surface Pro 8",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 8"),
},
.driver_data = (void *)180,
},
{}
};


static const struct ipu_property_names prop_names = {
.clock_frequency = "clock-frequency",
.rotation = "rotation",
Expand Down Expand Up @@ -248,6 +273,12 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
struct ipu_sensor_ssdb *ssdb)
{
const struct dmi_system_id *dmi_rotation;
dmi_rotation = dmi_first_match(override_rotation);
if (dmi_rotation && dmi_rotation->driver_data) {
dev_info(ADEV_DEV(adev), "Overriding rotation to: %d based on DMI match\n", (u32)(uintptr_t)dmi_rotation->driver_data);
return (u32)(uintptr_t)dmi_rotation->driver_data;
}
switch (ssdb->degree) {
case IPU_SENSOR_ROTATION_NORMAL:
return 0;
Expand Down