linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information.
@ 2020-08-28  2:19 Johnny Chuang
  2020-08-28 17:42 ` Harry Cutts
  2020-09-14  6:41 ` Dmitry Torokhov
  0 siblings, 2 replies; 4+ messages in thread
From: Johnny Chuang @ 2020-08-28  2:19 UTC (permalink / raw)
  To: Dmitry Torokhov, Benjamin Tissoires, Peter Hutterer,
	linux-kernel, linux-input, Harry Cutts, Johnny Chuang
  Cc: James Chen, Jennifer Tsai, Paul Liang, Jeff Chuang

This patch adds a new behavior to report touch major resolution
based on information provided by firmware.

In initial process, driver acquires touch information from touch ic.
It contains one byte about the resolution value of ABS_MT_TOUCH_MAJOR.
Touch driver will report touch major resolution by this information.

Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
---
Changes in v2:
  - register a real resolution value from firmware,
	instead of hardcoding resolution value as 1 by flag.
Changes in v3:
  - modify git log message from flag to real value.
  - modify driver comment from flag to real value.
---
 drivers/input/touchscreen/elants_i2c.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index b0bd5bb..661a3ee 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -151,6 +151,7 @@ struct elants_data {
 
 	bool wake_irq_enabled;
 	bool keep_power_in_suspend;
+	u8 report_major_resolution;
 
 	/* Must be last to be used for DMA operations */
 	u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned;
@@ -459,6 +460,9 @@ static int elants_i2c_query_ts_info(struct elants_data *ts)
 	rows = resp[2] + resp[6] + resp[10];
 	cols = resp[3] + resp[7] + resp[11];
 
+	/* get report resolution value of ABS_MT_TOUCH_MAJOR */
+	ts->report_major_resolution = resp[16];
+
 	/* Process mm_to_pixel information */
 	error = elants_i2c_execute_command(client,
 					   get_osr_cmd, sizeof(get_osr_cmd),
@@ -1325,6 +1329,8 @@ static int elants_i2c_probe(struct i2c_client *client,
 			     0, MT_TOOL_PALM, 0, 0);
 	input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
 	input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
+	if (ts->report_major_resolution > 0)
+		input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->report_major_resolution);
 
 	touchscreen_parse_properties(ts->input, true, &ts->prop);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information.
  2020-08-28  2:19 [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information Johnny Chuang
@ 2020-08-28 17:42 ` Harry Cutts
  2020-09-14  3:39   ` Johnny.Chuang
  2020-09-14  6:41 ` Dmitry Torokhov
  1 sibling, 1 reply; 4+ messages in thread
From: Harry Cutts @ 2020-08-28 17:42 UTC (permalink / raw)
  To: Johnny Chuang
  Cc: Dmitry Torokhov, Benjamin Tissoires, Peter Hutterer, lkml,
	linux-input, Johnny Chuang, James Chen, Jennifer Tsai,
	Paul Liang, Jeff Chuang

On Thu, 27 Aug 2020 at 19:20, Johnny Chuang <johnny.chuang.emc@gmail.com> wrote:
>
> This patch adds a new behavior to report touch major resolution
> based on information provided by firmware.
>
> In initial process, driver acquires touch information from touch ic.
> It contains one byte about the resolution value of ABS_MT_TOUCH_MAJOR.
> Touch driver will report touch major resolution by this information.
>
> Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>

Thanks Johnny!

Reviewed-by: Harry Cutts <hcutts@chromium.org>

Harry Cutts
Chrome OS Touch/Input team

> ---
> Changes in v2:
>   - register a real resolution value from firmware,
>         instead of hardcoding resolution value as 1 by flag.
> Changes in v3:
>   - modify git log message from flag to real value.
>   - modify driver comment from flag to real value.
> ---
>  drivers/input/touchscreen/elants_i2c.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index b0bd5bb..661a3ee 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -151,6 +151,7 @@ struct elants_data {
>
>         bool wake_irq_enabled;
>         bool keep_power_in_suspend;
> +       u8 report_major_resolution;
>
>         /* Must be last to be used for DMA operations */
>         u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned;
> @@ -459,6 +460,9 @@ static int elants_i2c_query_ts_info(struct elants_data *ts)
>         rows = resp[2] + resp[6] + resp[10];
>         cols = resp[3] + resp[7] + resp[11];
>
> +       /* get report resolution value of ABS_MT_TOUCH_MAJOR */
> +       ts->report_major_resolution = resp[16];
> +
>         /* Process mm_to_pixel information */
>         error = elants_i2c_execute_command(client,
>                                            get_osr_cmd, sizeof(get_osr_cmd),
> @@ -1325,6 +1329,8 @@ static int elants_i2c_probe(struct i2c_client *client,
>                              0, MT_TOOL_PALM, 0, 0);
>         input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
>         input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
> +       if (ts->report_major_resolution > 0)
> +               input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->report_major_resolution);
>
>         touchscreen_parse_properties(ts->input, true, &ts->prop);
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information.
  2020-08-28 17:42 ` Harry Cutts
@ 2020-09-14  3:39   ` Johnny.Chuang
  0 siblings, 0 replies; 4+ messages in thread
From: Johnny.Chuang @ 2020-09-14  3:39 UTC (permalink / raw)
  To: 'Harry Cutts', 'Johnny Chuang'
  Cc: 'Dmitry Torokhov', 'Benjamin Tissoires',
	'Peter Hutterer', 'lkml', 'linux-input',
	'James Chen', 'Jennifer Tsai',
	'Paul Liang', 'Jeff Chuang'

> On Thu, 27 Aug 2020 at 19:20, Johnny Chuang
> <johnny.chuang.emc@gmail.com> wrote:
> >
> > This patch adds a new behavior to report touch major resolution based
> > on information provided by firmware.
> >
> > In initial process, driver acquires touch information from touch ic.
> > It contains one byte about the resolution value of ABS_MT_TOUCH_MAJOR.
> > Touch driver will report touch major resolution by this information.
> >
> > Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
> 
> Thanks Johnny!
> 
> Reviewed-by: Harry Cutts <hcutts@chromium.org>
> 
> Harry Cutts
> Chrome OS Touch/Input team
> 

Hi Sirs,
Can you help to review this patch?

> > ---
> > Changes in v2:
> >   - register a real resolution value from firmware,
> >         instead of hardcoding resolution value as 1 by flag.
> > Changes in v3:
> >   - modify git log message from flag to real value.
> >   - modify driver comment from flag to real value.
> > ---
> >  drivers/input/touchscreen/elants_i2c.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/input/touchscreen/elants_i2c.c
> > b/drivers/input/touchscreen/elants_i2c.c
> > index b0bd5bb..661a3ee 100644
> > --- a/drivers/input/touchscreen/elants_i2c.c
> > +++ b/drivers/input/touchscreen/elants_i2c.c
> > @@ -151,6 +151,7 @@ struct elants_data {
> >
> >         bool wake_irq_enabled;
> >         bool keep_power_in_suspend;
> > +       u8 report_major_resolution;
> >
> >         /* Must be last to be used for DMA operations */
> >         u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned; @@ -459,6
> > +460,9 @@ static int elants_i2c_query_ts_info(struct elants_data *ts)
> >         rows = resp[2] + resp[6] + resp[10];
> >         cols = resp[3] + resp[7] + resp[11];
> >
> > +       /* get report resolution value of ABS_MT_TOUCH_MAJOR */
> > +       ts->report_major_resolution = resp[16];
> > +
> >         /* Process mm_to_pixel information */
> >         error = elants_i2c_execute_command(client,
> >                                            get_osr_cmd,
> > sizeof(get_osr_cmd), @@ -1325,6 +1329,8 @@ static int
> elants_i2c_probe(struct i2c_client *client,
> >                              0, MT_TOOL_PALM, 0, 0);
> >         input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
> >         input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
> > +       if (ts->report_major_resolution > 0)
> > +               input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR,
> > + ts->report_major_resolution);
> >
> >         touchscreen_parse_properties(ts->input, true, &ts->prop);
> >
> > --
> > 2.7.4
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information.
  2020-08-28  2:19 [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information Johnny Chuang
  2020-08-28 17:42 ` Harry Cutts
@ 2020-09-14  6:41 ` Dmitry Torokhov
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2020-09-14  6:41 UTC (permalink / raw)
  To: Johnny Chuang
  Cc: Benjamin Tissoires, Peter Hutterer, linux-kernel, linux-input,
	Harry Cutts, Johnny Chuang, James Chen, Jennifer Tsai,
	Paul Liang, Jeff Chuang

On Fri, Aug 28, 2020 at 10:19:55AM +0800, Johnny Chuang wrote:
> This patch adds a new behavior to report touch major resolution
> based on information provided by firmware.
> 
> In initial process, driver acquires touch information from touch ic.
> It contains one byte about the resolution value of ABS_MT_TOUCH_MAJOR.
> Touch driver will report touch major resolution by this information.
> 
> Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
> ---
> Changes in v2:
>   - register a real resolution value from firmware,
> 	instead of hardcoding resolution value as 1 by flag.
> Changes in v3:
>   - modify git log message from flag to real value.
>   - modify driver comment from flag to real value.
> ---
>  drivers/input/touchscreen/elants_i2c.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index b0bd5bb..661a3ee 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -151,6 +151,7 @@ struct elants_data {
>  
>  	bool wake_irq_enabled;
>  	bool keep_power_in_suspend;
> +	u8 report_major_resolution;

I renamed this to "major_res" to match x_res and y_res, and applied.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-14  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28  2:19 [PATCH v3] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information Johnny Chuang
2020-08-28 17:42 ` Harry Cutts
2020-09-14  3:39   ` Johnny.Chuang
2020-09-14  6:41 ` Dmitry Torokhov

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).