From: Dario Binacchi <dariobin@libero.it>
To: linux-kernel@vger.kernel.org
Cc: linux-input@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
Rachna Patil <rachna@ti.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Dario Binacchi <dariobin@libero.it>
Subject: [RESEND PATCH 3/6] input: ti_am335x_tsc: lower the X and Y sampling time
Date: Sun, 7 Nov 2021 12:22:33 +0100 [thread overview]
Message-ID: <20211107112236.7969-4-dariobin@libero.it> (raw)
In-Reply-To: <20211107112236.7969-1-dariobin@libero.it>
The open delay time has to be applied only on the first sample of the
X/Y coordinates because on the following samples the ADC channel is not
changed. Removing this time from the samples after the first one,
"ti,coordinate-readouts" greater than 1, decreases the total acquisition
time, allowing to increase the number of acquired coordinates in the time
unit.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
---
drivers/input/touchscreen/ti_am335x_tsc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index cfc943423241..f4ef218bc1b8 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -126,7 +126,7 @@ static int titsc_config_wires(struct titsc *ts_dev)
static void titsc_step_config(struct titsc *ts_dev)
{
unsigned int config;
- int i;
+ int i, n;
int end_step, first_step, tsc_steps;
u32 stepenable;
@@ -151,9 +151,11 @@ static void titsc_step_config(struct titsc *ts_dev)
first_step = TOTAL_STEPS - tsc_steps;
/* Steps 16 to 16-coordinate_readouts is for X */
end_step = first_step + tsc_steps;
+ n = 0;
for (i = end_step - ts_dev->coordinate_readouts; i < end_step; i++) {
titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
- titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
+ titsc_writel(ts_dev, REG_STEPDELAY(i),
+ n++ == 0 ? STEPCONFIG_OPENDLY : 0);
}
config = 0;
@@ -175,9 +177,11 @@ static void titsc_step_config(struct titsc *ts_dev)
/* 1 ... coordinate_readouts is for Y */
end_step = first_step + ts_dev->coordinate_readouts;
+ n = 0;
for (i = first_step; i < end_step; i++) {
titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
- titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
+ titsc_writel(ts_dev, REG_STEPDELAY(i),
+ n++ == 0 ? STEPCONFIG_OPENDLY : 0);
}
/* Make CHARGECONFIG same as IDLECONFIG */
--
2.17.1
next prev parent reply other threads:[~2021-11-07 11:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-07 11:22 [RESEND PATCH 0/6] input: touchscreen: am335x: fix and improvements Dario Binacchi
2021-11-07 11:22 ` [RESEND PATCH 1/6] input: ti_am335x_tsc: set ADCREFM for X configuration Dario Binacchi
2021-11-07 11:22 ` [RESEND PATCH 2/6] input: ti_am335x_tsc: fix STEPCONFIG setup for Z2 Dario Binacchi
2021-11-07 11:22 ` Dario Binacchi [this message]
2021-11-07 11:22 ` [RESEND PATCH 4/6] dt-bindings: input: ti-tsc-adc: fix tsc node example Dario Binacchi
2021-11-07 11:22 ` [RESEND PATCH 5/6] mfd: ti_am335x_tscadc: fix reading a tsc property from DT Dario Binacchi
2021-11-07 11:22 ` [RESEND PATCH 6/6] mfd: ti_am335x_tscadc: drop the CNTRLREG_8WIRE macro Dario Binacchi
2021-11-24 15:53 ` [RESEND PATCH 0/6] input: touchscreen: am335x: fix and improvements Lee Jones
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=20211107112236.7969-4-dariobin@libero.it \
--to=dariobin@libero.it \
--cc=bigeasy@linutronix.de \
--cc=dmitry.torokhov@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rachna@ti.com \
/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.