Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update goodix.c #5

Open
wants to merge 1 commit into
base: v4.18-footrail
Choose a base branch
from
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
29 changes: 29 additions & 0 deletions drivers/input/touchscreen/goodix.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,29 @@ static const struct dmi_system_id rotated_screen[] = {
{}
};

/*
* Those tablets have their x coordinate inverted
*/
static const struct dmi_system_id inverted_x_screen[] = {
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
{
.ident = "Cube I15-TC",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Cube"),
DMI_MATCH(DMI_PRODUCT_NAME, "I15-TC")
}
},
{
.ident = "Cube I15-TFL",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Cube"),
DMI_MATCH(DMI_PRODUCT_NAME, "I15-TFL")
},
},
#endif
{}
};

/**
* goodix_i2c_read - read data from a register of the i2c slave device.
*
Expand Down Expand Up @@ -709,6 +732,12 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
"Applying '180 degrees rotated screen' quirk\n");
}

if (dmi_check_system(inverted_x_screen)) {
ts->prop.invert_x = true;
dev_dbg(&ts->client->dev,
"Applying 'invert x cooordinate' quirk\n");
}

error = input_mt_init_slots(ts->input_dev, ts->max_touch_num,
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
if (error) {
Expand Down