All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johnny Chuang <johnny.chuang.emc@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Peter Hutterer <peter.hutterer@who-t.net>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	Harry Cutts <hcutts@chromium.org>,
	Johnny Chuang <johnny.chuang@emc.com.tw>
Cc: James Chen <james.chen@emc.com.tw>,
	Jennifer Tsai <jennifer.tsai@emc.com.tw>,
	Paul Liang <paul.liang@emc.com.tw>,
	Jeff Chuang <jeff.chuang@emc.com.tw>
Subject: [PATCH] Input: elants_i2c - Report resolution of ABS_MT_TOUCH_MAJOR by FW information.
Date: Mon, 24 Aug 2020 17:29:03 +0800	[thread overview]
Message-ID: <1598261343-23946-1-git-send-email-johnny.chuang.emc@gmail.com> (raw)

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.
This information contains of one flag about reporting resolution of
ABS_MT_TOUCH_MAJOR is needed, or not.
Touch driver will report touch major resolution after geting this flag.

Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
---
 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..513f2fd 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;
+	bool 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];
 
+	/* Decide if report resolution of ABS_MT_TOUCH_MAJOR */
+	ts->report_major_resolution = (resp[16] != 0) ? true : false;
+
 	/* 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 == true)
+		input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
 
 	touchscreen_parse_properties(ts->input, true, &ts->prop);
 
-- 
2.7.4


                 reply	other threads:[~2020-08-24  9:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1598261343-23946-1-git-send-email-johnny.chuang.emc@gmail.com \
    --to=johnny.chuang.emc@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hcutts@chromium.org \
    --cc=james.chen@emc.com.tw \
    --cc=jeff.chuang@emc.com.tw \
    --cc=jennifer.tsai@emc.com.tw \
    --cc=johnny.chuang@emc.com.tw \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.liang@emc.com.tw \
    --cc=peter.hutterer@who-t.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.