* [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700
@ 2015-07-23 14:13 Bastien Nocera
2015-07-23 21:56 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2015-07-23 14:13 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input, linux-kernel
The touchscreen on the WinBook TW100 and TW700 don't match the default
display, with 0,0 touches being reported when touching at the bottom
right of the screen.
1280,800 0,800
+-------------+
| |
| |
| |
+-------------+
1280,0 0,0
It's unfortunately impossible to detect this problem with data from the
DSDT, or other auxiliary metadata, so fallback to quirking this specific
model of tablet instead.
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/input/touchscreen/goodix.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index b4d12e2..3722806 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -15,6 +15,7 @@
*/
#include <linux/kernel.h>
+#include <linux/dmi.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
@@ -34,6 +35,7 @@ struct goodix_ts_data {
int abs_y_max;
unsigned int max_touch_num;
unsigned int int_trigger_type;
+ bool rotated_screen;
};
#define GOODIX_MAX_HEIGHT 4096
@@ -60,6 +62,24 @@ static const unsigned long goodix_irq_flags[] = {
IRQ_TYPE_LEVEL_HIGH,
};
+/* Those tablets have their coords origin at the bottom right
+ * of the tablet, as if rotated 180 degrees */
+static const struct dmi_system_id rotated_screen[] = {
+ {
+ .ident = "WinBook TW100",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
+ },
+ .ident = "WinBook TW700",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
+ },
+ },
+ {}
+};
+
/**
* goodix_i2c_read - read data from a register of the i2c slave device.
*
@@ -129,6 +149,11 @@ static void goodix_ts_report_touch(struct goodix_ts_data *ts, u8 *coor_data)
int input_y = get_unaligned_le16(&coor_data[3]);
int input_w = get_unaligned_le16(&coor_data[5]);
+ if (ts->rotated_screen) {
+ input_x = ts->abs_x_max - input_x;
+ input_y = ts->abs_y_max - input_y;
+ }
+
input_mt_slot(ts->input_dev, id);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X, input_x);
@@ -223,6 +248,12 @@ static void goodix_read_config(struct goodix_ts_data *ts)
ts->abs_y_max = GOODIX_MAX_HEIGHT;
ts->max_touch_num = GOODIX_MAX_CONTACTS;
}
+
+ ts->rotated_screen = dmi_check_system(rotated_screen);
+ if (ts->rotated_screen) {
+ dev_dbg(&ts->client->dev,
+ "Applying '180 degrees rotated screen' quirk\n");
+ }
}
/**
--
2.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700
2015-07-23 14:13 [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700 Bastien Nocera
@ 2015-07-23 21:56 ` Dmitry Torokhov
2015-07-24 11:13 ` Bastien Nocera
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2015-07-23 21:56 UTC (permalink / raw)
To: Bastien Nocera; +Cc: linux-input, linux-kernel
Hi Bastien,
On Thu, Jul 23, 2015 at 04:13:28PM +0200, Bastien Nocera wrote:
> The touchscreen on the WinBook TW100 and TW700 don't match the default
> display, with 0,0 touches being reported when touching at the bottom
> right of the screen.
>
> 1280,800 0,800
> +-------------+
> | |
> | |
> | |
> +-------------+
> 1280,0 0,0
>
> It's unfortunately impossible to detect this problem with data from the
> DSDT, or other auxiliary metadata, so fallback to quirking this specific
> model of tablet instead.
>
> Signed-off-by: Bastien Nocera <hadess@hadess.net>
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
> drivers/input/touchscreen/goodix.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index b4d12e2..3722806 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -15,6 +15,7 @@
> */
>
> #include <linux/kernel.h>
> +#include <linux/dmi.h>
> #include <linux/i2c.h>
> #include <linux/input.h>
> #include <linux/input/mt.h>
> @@ -34,6 +35,7 @@ struct goodix_ts_data {
> int abs_y_max;
> unsigned int max_touch_num;
> unsigned int int_trigger_type;
> + bool rotated_screen;
> };
>
> #define GOODIX_MAX_HEIGHT 4096
> @@ -60,6 +62,24 @@ static const unsigned long goodix_irq_flags[] = {
> IRQ_TYPE_LEVEL_HIGH,
> };
>
> +/* Those tablets have their coords origin at the bottom right
> + * of the tablet, as if rotated 180 degrees */
/*
* Multi
* line
* comment
*/
please.
> +static const struct dmi_system_id rotated_screen[] = {
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> + {
> + .ident = "WinBook TW100",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
> + },
> + .ident = "WinBook TW700",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
> + },
This does not do what you want it to do... First of all you probably
wanted TW700 on the second entry, second you need separate them into 2
entries into array (right now it is one still).
Thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700
2015-07-23 21:56 ` Dmitry Torokhov
@ 2015-07-24 11:13 ` Bastien Nocera
2015-07-24 16:08 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2015-07-24 11:13 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
On Thu, 2015-07-23 at 14:56 -0700, Dmitry Torokhov wrote:
> Hi Bastien,
>
> On Thu, Jul 23, 2015 at 04:13:28PM +0200, Bastien Nocera wrote:
> > The touchscreen on the WinBook TW100 and TW700 don't match the
> > default
> > display, with 0,0 touches being reported when touching at the
> > bottom
> > right of the screen.
> >
> > 1280,800 0,800
> > +-------------+
> > | |
> > | |
> > | |
> > +-------------+
> > 1280,0 0,0
> >
> > It's unfortunately impossible to detect this problem with data from
> > the
> > DSDT, or other auxiliary metadata, so fallback to quirking this
> > specific
> > model of tablet instead.
> >
> > Signed-off-by: Bastien Nocera <hadess@hadess.net>
> > Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > ---
> > drivers/input/touchscreen/goodix.c | 31
> > +++++++++++++++++++++++++++++++
> > 1 file changed, 31 insertions(+)
> >
> > diff --git a/drivers/input/touchscreen/goodix.c
> > b/drivers/input/touchscreen/goodix.c
> > index b4d12e2..3722806 100644
> > --- a/drivers/input/touchscreen/goodix.c
> > +++ b/drivers/input/touchscreen/goodix.c
> > @@ -15,6 +15,7 @@
> > */
> >
> > #include <linux/kernel.h>
> > +#include <linux/dmi.h>
> > #include <linux/i2c.h>
> > #include <linux/input.h>
> > #include <linux/input/mt.h>
> > @@ -34,6 +35,7 @@ struct goodix_ts_data {
> > int abs_y_max;
> > unsigned int max_touch_num;
> > unsigned int int_trigger_type;
> > + bool rotated_screen;
> > };
> >
> > #define GOODIX_MAX_HEIGHT 4096
> > @@ -60,6 +62,24 @@ static const unsigned long goodix_irq_flags[] =
> > {
> > IRQ_TYPE_LEVEL_HIGH,
> > };
> >
> > +/* Those tablets have their coords origin at the bottom right
> > + * of the tablet, as if rotated 180 degrees */
>
> /*
> * Multi
> * line
> * comment
> */
>
> please.
Would be good if checkpatch could check for that, or is it a personal
request?
> > +static const struct dmi_system_id rotated_screen[] = {
>
> #if defined(CONFIG_DMI) && defined(CONFIG_X86)
Sure.
> > + {
> > + .ident = "WinBook TW100",
> > + .matches = {
> > + DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
> > + },
> > + .ident = "WinBook TW700",
> > + .matches = {
> > + DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
> > + },
>
> This does not do what you want it to do... First of all you probably
> wanted TW700 on the second entry, second you need separate them into
> 2
> entries into array (right now it is one still).
Duh!
Thanks, coming in v3 shortly.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700
2015-07-24 11:13 ` Bastien Nocera
@ 2015-07-24 16:08 ` Dmitry Torokhov
2015-07-24 16:09 ` Bastien Nocera
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2015-07-24 16:08 UTC (permalink / raw)
To: Bastien Nocera; +Cc: linux-input, linux-kernel
On Fri, Jul 24, 2015 at 01:13:24PM +0200, Bastien Nocera wrote:
> On Thu, 2015-07-23 at 14:56 -0700, Dmitry Torokhov wrote:
> > Hi Bastien,
> >
> > On Thu, Jul 23, 2015 at 04:13:28PM +0200, Bastien Nocera wrote:
> > > The touchscreen on the WinBook TW100 and TW700 don't match the
> > > default
> > > display, with 0,0 touches being reported when touching at the
> > > bottom
> > > right of the screen.
> > >
> > > 1280,800 0,800
> > > +-------------+
> > > | |
> > > | |
> > > | |
> > > +-------------+
> > > 1280,0 0,0
> > >
> > > It's unfortunately impossible to detect this problem with data from
> > > the
> > > DSDT, or other auxiliary metadata, so fallback to quirking this
> > > specific
> > > model of tablet instead.
> > >
> > > Signed-off-by: Bastien Nocera <hadess@hadess.net>
> > > Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > > ---
> > > drivers/input/touchscreen/goodix.c | 31
> > > +++++++++++++++++++++++++++++++
> > > 1 file changed, 31 insertions(+)
> > >
> > > diff --git a/drivers/input/touchscreen/goodix.c
> > > b/drivers/input/touchscreen/goodix.c
> > > index b4d12e2..3722806 100644
> > > --- a/drivers/input/touchscreen/goodix.c
> > > +++ b/drivers/input/touchscreen/goodix.c
> > > @@ -15,6 +15,7 @@
> > > */
> > >
> > > #include <linux/kernel.h>
> > > +#include <linux/dmi.h>
> > > #include <linux/i2c.h>
> > > #include <linux/input.h>
> > > #include <linux/input/mt.h>
> > > @@ -34,6 +35,7 @@ struct goodix_ts_data {
> > > int abs_y_max;
> > > unsigned int max_touch_num;
> > > unsigned int int_trigger_type;
> > > + bool rotated_screen;
> > > };
> > >
> > > #define GOODIX_MAX_HEIGHT 4096
> > > @@ -60,6 +62,24 @@ static const unsigned long goodix_irq_flags[] =
> > > {
> > > IRQ_TYPE_LEVEL_HIGH,
> > > };
> > >
> > > +/* Those tablets have their coords origin at the bottom right
> > > + * of the tablet, as if rotated 180 degrees */
> >
> > /*
> > * Multi
> > * line
> > * comment
> > */
> >
> > please.
>
> Would be good if checkpatch could check for that, or is it a personal
> request?
CodingStyle chapter 8.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700
2015-07-24 16:08 ` Dmitry Torokhov
@ 2015-07-24 16:09 ` Bastien Nocera
0 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2015-07-24 16:09 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
On Fri, 2015-07-24 at 09:08 -0700, Dmitry Torokhov wrote:
> On Fri, Jul 24, 2015 at 01:13:24PM +0200, Bastien Nocera wrote:
> > On Thu, 2015-07-23 at 14:56 -0700, Dmitry Torokhov wrote:
> > > Hi Bastien,
> > >
> > > On Thu, Jul 23, 2015 at 04:13:28PM +0200, Bastien Nocera wrote:
> > > > The touchscreen on the WinBook TW100 and TW700 don't match the
> > > > default
> > > > display, with 0,0 touches being reported when touching at the
> > > > bottom
> > > > right of the screen.
> > > >
> > > > 1280,800 0,800
> > > > +-------------+
> > > > | |
> > > > | |
> > > > | |
> > > > +-------------+
> > > > 1280,0 0,0
> > > >
> > > > It's unfortunately impossible to detect this problem with data
> > > > from
> > > > the
> > > > DSDT, or other auxiliary metadata, so fallback to quirking this
> > > >
> > > > specific
> > > > model of tablet instead.
> > > >
> > > > Signed-off-by: Bastien Nocera <hadess@hadess.net>
> > > > Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > > > ---
> > > > drivers/input/touchscreen/goodix.c | 31
> > > > +++++++++++++++++++++++++++++++
> > > > 1 file changed, 31 insertions(+)
> > > >
> > > > diff --git a/drivers/input/touchscreen/goodix.c
> > > > b/drivers/input/touchscreen/goodix.c
> > > > index b4d12e2..3722806 100644
> > > > --- a/drivers/input/touchscreen/goodix.c
> > > > +++ b/drivers/input/touchscreen/goodix.c
> > > > @@ -15,6 +15,7 @@
> > > > */
> > > >
> > > > #include <linux/kernel.h>
> > > > +#include <linux/dmi.h>
> > > > #include <linux/i2c.h>
> > > > #include <linux/input.h>
> > > > #include <linux/input/mt.h>
> > > > @@ -34,6 +35,7 @@ struct goodix_ts_data {
> > > > int abs_y_max;
> > > > unsigned int max_touch_num;
> > > > unsigned int int_trigger_type;
> > > > + bool rotated_screen;
> > > > };
> > > >
> > > > #define GOODIX_MAX_HEIGHT 4096
> > > > @@ -60,6 +62,24 @@ static const unsigned long
> > > > goodix_irq_flags[] =
> > > > {
> > > > IRQ_TYPE_LEVEL_HIGH,
> > > > };
> > > >
> > > > +/* Those tablets have their coords origin at the bottom right
> > > > + * of the tablet, as if rotated 180 degrees */
> > >
> > > /*
> > > * Multi
> > > * line
> > > * comment
> > > */
> > >
> > > please.
> >
> > Would be good if checkpatch could check for that, or is it a
> > personal
> > request?
>
> CodingStyle chapter 8.
OK, thanks for the notice :)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-24 16:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 14:13 [PATCH v2] Input: goodix - Fix touch coords on WinBook TW100 and TW700 Bastien Nocera
2015-07-23 21:56 ` Dmitry Torokhov
2015-07-24 11:13 ` Bastien Nocera
2015-07-24 16:08 ` Dmitry Torokhov
2015-07-24 16:09 ` Bastien Nocera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).