diff mbox series

[v5,1/2] Input: hideep - Silence error in SW_RESET()

Message ID 20230311114726.182789-2-hdegoede@redhat.com
State Accepted
Commit 10b0a455f4378330de41e280ce7839997d24297d
Headers show
Series Input: hideep - 2 HiDeep touchscreen patches | expand

Commit Message

Hans de Goede March 11, 2023, 11:47 a.m. UTC
On some models the first HIDEEP_SYSCON_WDT_CON write alone is enough to
cause the controller to reset, causing the second write to fail:

i2c-hideep_ts: write to register 0x52000014 (0x000001) failed: -121

Switch this write to a raw hideep_pgm_w_mem() to avoid an error getting
logged in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/hideep.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Dmitry Torokhov March 17, 2023, 10:57 a.m. UTC | #1
On Sat, Mar 11, 2023 at 12:47:25PM +0100, Hans de Goede wrote:
> On some models the first HIDEEP_SYSCON_WDT_CON write alone is enough to
> cause the controller to reset, causing the second write to fail:
> 
> i2c-hideep_ts: write to register 0x52000014 (0x000001) failed: -121
> 
> Switch this write to a raw hideep_pgm_w_mem() to avoid an error getting
> logged in this case.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c
index bd454d93f1f7..5e6e43d56448 100644
--- a/drivers/input/touchscreen/hideep.c
+++ b/drivers/input/touchscreen/hideep.c
@@ -271,9 +271,14 @@  static int hideep_pgm_w_reg(struct hideep_ts *ts, u32 addr, u32 val)
 
 #define SW_RESET_IN_PGM(clk)					\
 {								\
+	__be32 data = cpu_to_be32(0x01);			\
 	hideep_pgm_w_reg(ts, HIDEEP_SYSCON_WDT_CNT, (clk));	\
 	hideep_pgm_w_reg(ts, HIDEEP_SYSCON_WDT_CON, 0x03);	\
-	hideep_pgm_w_reg(ts, HIDEEP_SYSCON_WDT_CON, 0x01);	\
+	/*							\
+	 * The first write may already cause a reset, use a raw	\
+	 * write for the second write to avoid error logging.	\
+	 */							\
+	hideep_pgm_w_mem(ts, HIDEEP_SYSCON_WDT_CON, &data, 1);	\
 }
 
 #define SET_FLASH_PIO(ce)					\