[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201201062807.GO2034289@dtor-ws>
Date: Mon, 30 Nov 2020 22:28:07 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Furquan Shaikh <furquan@...gle.com>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] input: raydium_ts_i2c: Do not split tx transactions
Hi Furquan,
On Mon, Nov 30, 2020 at 10:00:50PM -0800, Furquan Shaikh wrote:
> Raydium device does not like splitting of tx transactions into
> multiple messages - one for the register address and one for the
> actual data. This results in incorrect behavior on the device side.
>
> This change updates raydium_i2c_read and raydium_i2c_write to create
> i2c_msg arrays separately and passes those arrays into
> raydium_i2c_xfer which decides based on the address whether the bank
> switch command should be sent. The bank switch header is still added
> by raydium_i2c_read and raydium_i2c_write to ensure that all these
> operations are performed as part of a single I2C transfer. It
> guarantees that no other transactions are initiated to any other
> device on the same bus after the bank switch command is sent.
i2c_transfer locks the bus [segment] for the entire time, so this
explanation on why the change is needed does not make sense.
Also, does it help if you mark the data message as I2C_M_NOSTART in case
of writes?
I also wonder if we should convert the driver to regmap, which should
help with handling the bank switch as well as figuring out if it can do
"gather write" or fall back to allocating an additional send buffer.
Thanks.
--
Dmitry
Powered by blists - more mailing lists