mbox series

[v3,0/3] implement I2C retries for mXT1368

Message ID 20200930151259.18119-1-jiada_wang@mentor.com (mailing list archive)
Headers show
Series implement I2C retries for mXT1368 | expand

Message

Wang, Jiada Sept. 30, 2020, 3:12 p.m. UTC
According to datasheet, mXT1386 chip has a WAKE line, it is used
to wake the chip up from deep sleep mode before communicating with
it via the I2C-compatible interface.
    
if the WAKE line is connected to a GPIO line, the line must be
asserted 25 ms before the host attempts to communicate with the
mXT1386.
If the WAKE line is connected to the SCL pin, the mXT1386 will send
a NACK on the first attempt to address it, the host must then retry
25 ms later.
    
This patch adds compatible string "atmel,mXT1386" for mXT1386 controller,
when I2C transfer on mXT1386 fails, retry the transfer once after a
25 ms sleep.


Jiada Wang (3):
  dt-bindings: input: atmel: add compatible for mXT1386
  Input: atmel_mxt_ts - implement I2C retries for mXT1368
  ARM: tegra: add mXT1386 compatible

---
v3:
change compatible string to lowercase

v2:
add bool retry_i2c_transfers to struct mxt_data,
to indicate whether retry is needed when i2c transfer fails

v1: initial version
---
 .../bindings/input/atmel,maxtouch.txt         |  1 +
 .../boot/dts/tegra20-acer-a500-picasso.dts    |  2 +-
 drivers/input/touchscreen/atmel_mxt_ts.c      | 62 +++++++++++++++----
 3 files changed, 52 insertions(+), 13 deletions(-)

Comments

Wang, Jiada Oct. 21, 2020, 1:14 a.m. UTC | #1
Hello Dmitry and all

Kind reminder on this patch-set


Thanks,
Jiada

On 2020/10/01 0:12, Jiada Wang wrote:
> According to datasheet, mXT1386 chip has a WAKE line, it is used
> to wake the chip up from deep sleep mode before communicating with
> it via the I2C-compatible interface.
>      
> if the WAKE line is connected to a GPIO line, the line must be
> asserted 25 ms before the host attempts to communicate with the
> mXT1386.
> If the WAKE line is connected to the SCL pin, the mXT1386 will send
> a NACK on the first attempt to address it, the host must then retry
> 25 ms later.
>      
> This patch adds compatible string "atmel,mXT1386" for mXT1386 controller,
> when I2C transfer on mXT1386 fails, retry the transfer once after a
> 25 ms sleep.
> 
> 
> Jiada Wang (3):
>    dt-bindings: input: atmel: add compatible for mXT1386
>    Input: atmel_mxt_ts - implement I2C retries for mXT1368
>    ARM: tegra: add mXT1386 compatible
> 
> ---
> v3:
> change compatible string to lowercase
> 
> v2:
> add bool retry_i2c_transfers to struct mxt_data,
> to indicate whether retry is needed when i2c transfer fails
> 
> v1: initial version
> ---
>   .../bindings/input/atmel,maxtouch.txt         |  1 +
>   .../boot/dts/tegra20-acer-a500-picasso.dts    |  2 +-
>   drivers/input/touchscreen/atmel_mxt_ts.c      | 62 +++++++++++++++----
>   3 files changed, 52 insertions(+), 13 deletions(-)
>
Dmitry Osipenko Oct. 27, 2020, 9:52 p.m. UTC | #2
21.10.2020 04:14, Wang, Jiada пишет:
> Hello Dmitry and all
> 
> Kind reminder on this patch-set

Hello Jiada,

Thinking a bit more about these patches, I'm coming back to the variant
with the atmel,wakeup-method property. There are three possible wake-up
variants for mXT1368:

  - NONE
  - GPIO
  - I2C-SCL

and this series covers only the I2C-SCL.

I was also skimming through datasheets of other maxtouch touchscreens
and noticed that the retries aren't unique to mXT1368. For example
mXT3432 controller also needs exactly the same retrying logic.

Hence I think it should be better if we could generalize the
wakeup-method in the device-tree. What do you think?