All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Binacchi <dariobin@libero.it>
To: linux-kernel@vger.kernel.org
Cc: "Andrew F . Davis" <afd@ti.com>, Felipe Balbi <balbi@ti.com>,
	Rachna Patil <rachna@ti.com>, Wolfram Sang <wsa@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, Jeff Lance <j-lance1@ti.com>,
	Zubair Lutfullah <zubair.lutfullah@gmail.com>,
	Vignesh R <vigneshr@ti.com>, Dave Gerlach <d-gerlach@ti.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Brad Griffis <bgriffis@ti.com>,
	Dario Binacchi <dariobin@libero.it>
Subject: [RESEND PATCH 2/3] input: ti_am335x_tsc: fix STEPCONFIG setup for Z2
Date: Sun, 12 Dec 2021 13:53:57 +0100	[thread overview]
Message-ID: <20211212125358.14416-3-dariobin@libero.it> (raw)
In-Reply-To: <20211212125358.14416-1-dariobin@libero.it>

The Z2 step configuration doesn't erase the SEL_INP_SWC_3_0 bit-field
before setting the ADC channel. This way its value could be corrupted by
the ADC channel selected for the Z1 coordinate.

Fixes: 8c896308fea ("input: ti_am335x_adc: use only FIFO0 and clean up a little")
Signed-off-by: Dario Binacchi <dariobin@libero.it>
---

 drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index fd3ffdd23470..cfc943423241 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -196,7 +196,10 @@ static void titsc_step_config(struct titsc *ts_dev)
 			STEPCONFIG_OPENDLY);
 
 	end_step++;
-	config |= STEPCONFIG_INP(ts_dev->inp_yn);
+	config = STEPCONFIG_MODE_HWSYNC |
+			STEPCONFIG_AVG_16 | ts_dev->bit_yp |
+			ts_dev->bit_xn | STEPCONFIG_INM_ADCREFM |
+			STEPCONFIG_INP(ts_dev->inp_yn);
 	titsc_writel(ts_dev, REG_STEPCONFIG(end_step), config);
 	titsc_writel(ts_dev, REG_STEPDELAY(end_step),
 			STEPCONFIG_OPENDLY);
-- 
2.17.1


  parent reply	other threads:[~2021-12-12 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 12:53 [RESEND PATCH 0/3] input: touchscreen: am335x: fix and improvements Dario Binacchi
2021-12-12 12:53 ` [RESEND PATCH 1/3] input: ti_am335x_tsc: set ADCREFM for X configuration Dario Binacchi
2021-12-12 12:53 ` Dario Binacchi [this message]
2021-12-12 12:53 ` [RESEND PATCH 3/3] input: ti_am335x_tsc: lower the X and Y sampling time Dario Binacchi
2021-12-13  5:18 ` [RESEND PATCH 0/3] input: touchscreen: am335x: fix and improvements Dmitry Torokhov

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=20211212125358.14416-3-dariobin@libero.it \
    --to=dariobin@libero.it \
    --cc=afd@ti.com \
    --cc=balbi@ti.com \
    --cc=bgriffis@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=d-gerlach@ti.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=j-lance1@ti.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rachna@ti.com \
    --cc=vigneshr@ti.com \
    --cc=wsa@kernel.org \
    --cc=zubair.lutfullah@gmail.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.