diff options
Diffstat (limited to 'drivers/input/touchscreen/gt9xx/gt9xx.c')
-rw-r--r-- | drivers/input/touchscreen/gt9xx/gt9xx.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c index 6db7e395f82b..302efa6a5389 100644 --- a/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -2591,6 +2591,7 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id struct device_node *np = client->dev.of_node; enum of_gpio_flags rst_flags, pwr_flags; + bool reverse_x, reverse_y; u32 val; printk("%s() start\n", __func__); @@ -2626,37 +2627,40 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id return -EINVAL; } + reverse_x = of_property_read_bool(np, "reverse-x"); + reverse_y = of_property_read_bool(np, "reverse-y"); + if (val == 89) { m89or101 = TRUE; gtp_change_x2y = TRUE; - gtp_x_reverse = FALSE; - gtp_y_reverse = TRUE; + gtp_x_reverse = reverse_x ? TRUE : FALSE; + gtp_y_reverse = reverse_y ? FALSE: TRUE; } else if (val == 101) { m89or101 = FALSE; gtp_change_x2y = TRUE; - gtp_x_reverse = TRUE; - gtp_y_reverse = FALSE; + gtp_x_reverse = reverse_x ? FALSE : TRUE; + gtp_y_reverse = reverse_y ? TRUE : FALSE; } else if (val == 911) { m89or101 = FALSE; bgt911 = TRUE; gtp_change_x2y = TRUE; - gtp_x_reverse = FALSE; - gtp_y_reverse = TRUE; + gtp_x_reverse = reverse_x ? TRUE : FALSE; + gtp_y_reverse = reverse_y ? FALSE : TRUE; } else if (val == 970) { m89or101 = FALSE; bgt911 = FALSE; bgt970 = TRUE; gtp_change_x2y = FALSE; - gtp_x_reverse = FALSE; - gtp_y_reverse = TRUE; + gtp_x_reverse = reverse_x ? TRUE : FALSE; + gtp_y_reverse = reverse_y ? FALSE : TRUE; } else if (val == 910) { m89or101 = FALSE; bgt911 = FALSE; bgt970 = FALSE; bgt910 = TRUE; gtp_change_x2y = TRUE; - gtp_x_reverse = FALSE; - gtp_y_reverse = TRUE; + gtp_x_reverse = reverse_x ? TRUE : FALSE; + gtp_y_reverse = reverse_y ? FALSE : TRUE; } ts->tp_regulator = devm_regulator_get(&client->dev, "tp"); |