diff mbox series

[v2] Input: goodix: fix touch coordinates on Cube I15-TC

Message ID e39e5cca-fec5-512f-0a33-f3dd20a33ff9@ya.ru (mailing list archive)
State Accepted, archived
Headers show
Series [v2] Input: goodix: fix touch coordinates on Cube I15-TC | expand

Commit Message

Sergei A. Trusov Aug. 31, 2018, 5:44 a.m. UTC
The touchscreen on the Cube I15-TC don't match the default display,
with 0,0 touches being reported when touching at the top-right of
the screen.

Add a quirk to invert the x coordinate.

Reported-and-tested-by: Arkadiy <arkan49@yandex.ru>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
---

Changes in v2:
 - Commit message fix
 - Removed extra linefeeds

 drivers/input/touchscreen/goodix.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Bastien Nocera March 2, 2020, 11:45 a.m. UTC | #1
On Fri, 2018-08-31 at 15:44 +1000, Sergei A. Trusov wrote:
> The touchscreen on the Cube I15-TC don't match the default display,
> with 0,0 touches being reported when touching at the top-right of
> the screen.
> 
> Add a quirk to invert the x coordinate.
> 
> Reported-and-tested-by: Arkadiy <arkan49@yandex.ru>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>

Some patch queue draining/grave digging. Sorry for taking so long to
get back to you.


If that still applies, please add my:

Reviewed-by: Bastien Nocera <hadess@hadess.net>

> ---
> 
> Changes in v2:
>  - Commit message fix
>  - Removed extra linefeeds
> 
>  drivers/input/touchscreen/goodix.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/goodix.c
> b/drivers/input/touchscreen/goodix.c
> index f2d9c2c41885..27adf216f230 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -145,6 +145,22 @@ 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")
> +		},
> +	},
> +#endif
> +	{}
> +};
> +
>  /**
>   * goodix_i2c_read - read data from a register of the i2c slave
> device.
>   *
> @@ -709,6 +725,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 'inverted x screen' quirk\n");
> +	}
> +
>  	error = input_mt_init_slots(ts->input_dev, ts->max_touch_num,
>  				    INPUT_MT_DIRECT |
> INPUT_MT_DROP_UNUSED);
>  	if (error) {
Dmitry Torokhov March 6, 2020, 3:55 a.m. UTC | #2
On Mon, Mar 02, 2020 at 12:45:24PM +0100, Bastien Nocera wrote:
> On Fri, 2018-08-31 at 15:44 +1000, Sergei A. Trusov wrote:
> > The touchscreen on the Cube I15-TC don't match the default display,
> > with 0,0 touches being reported when touching at the top-right of
> > the screen.
> > 
> > Add a quirk to invert the x coordinate.
> > 
> > Reported-and-tested-by: Arkadiy <arkan49@yandex.ru>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
> 
> Some patch queue draining/grave digging. Sorry for taking so long to
> get back to you.
> 
> 
> If that still applies, please add my:
> 
> Reviewed-by: Bastien Nocera <hadess@hadess.net>

Applied, thank you.

> 
> > ---
> > 
> > Changes in v2:
> >  - Commit message fix
> >  - Removed extra linefeeds
> > 
> >  drivers/input/touchscreen/goodix.c | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/drivers/input/touchscreen/goodix.c
> > b/drivers/input/touchscreen/goodix.c
> > index f2d9c2c41885..27adf216f230 100644
> > --- a/drivers/input/touchscreen/goodix.c
> > +++ b/drivers/input/touchscreen/goodix.c
> > @@ -145,6 +145,22 @@ 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")
> > +		},
> > +	},
> > +#endif
> > +	{}
> > +};
> > +
> >  /**
> >   * goodix_i2c_read - read data from a register of the i2c slave
> > device.
> >   *
> > @@ -709,6 +725,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 'inverted x screen' quirk\n");
> > +	}
> > +
> >  	error = input_mt_init_slots(ts->input_dev, ts->max_touch_num,
> >  				    INPUT_MT_DIRECT |
> > INPUT_MT_DROP_UNUSED);
> >  	if (error) {
>
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index f2d9c2c41885..27adf216f230 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -145,6 +145,22 @@  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")
+		},
+	},
+#endif
+	{}
+};
+
 /**
  * goodix_i2c_read - read data from a register of the i2c slave device.
  *
@@ -709,6 +725,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 'inverted x screen' quirk\n");
+	}
+
 	error = input_mt_init_slots(ts->input_dev, ts->max_touch_num,
 				    INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
 	if (error) {