All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andi Shyti <andi@etezian.org>
Cc: Stephan Gerhold <stephan@gerhold.net>,
	Linux Input <linux-input@vger.kernel.org>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>
Subject: Re: [PATCH v2 1/2] Input: mms114 - use smbus functions whenever possible
Date: Mon, 21 Oct 2019 20:21:40 -0700	[thread overview]
Message-ID: <20191022032140.GV35946@dtor-ws> (raw)
In-Reply-To: <20191021163956.GB1353@jack.zhora.eu>

On Mon, Oct 21, 2019 at 07:39:56PM +0300, Andi Shyti wrote:
> > > > On Sun, Oct 20, 2019 at 11:28:55PM +0300, Andi Shyti wrote:
> > > > > The exchange of data to and from the mms114 touchscreen never
> > > > > exceeds 256 bytes. In the worst case it goes up to 80 bytes in
> > > > > the interrupt handler while reading the events.
> > > > > 
> > > > 
> > > > i2c_smbus_read_i2c_block_data() is actually limited to
> > > > I2C_SMBUS_BLOCK_MAX = 32.
> > > 
> > > oh sorry, I don't know how I slipped on this.
> > > 
> > > But this means that the i2c in the kernel is wrong (or outdated),
> > > smbus specifies 256 bytes of data[*]. I might have relied on the
> > > specification more than the code.
> > > 
> > > I guess SMBUS needs some update.
> > 
> > You are right. It seems like that part of the specification was changed
> > with SMBus version 3.0 [1]:
> > 
> >   D.6 255 Bytes in Process Call:
> >     The maximum number of bytes allowed in the Block Write-Block Read
> >     Process Call (Section 6.5.8) was increased from 32 to 255.
> > 
> > [1]: http://www.smbus.org/specs/SMBus_3_0_20141220.pdf
> 
> yes :)
> 
> OK, then I would ask Dmitry to hold on this patch I will try to
> update the smbus properly.

3.0 is from 2014, so we can't simply update the limits. And we need to
handle the case where device connected to a controller that does not
implement 3.0 standard.

If regmap is too much work then as a stop gap we could maybe only
convert write functions and mention why read needs to be custom.

Thanks.

-- 
Dmitry

  reply	other threads:[~2019-10-22  3:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 20:28 [PATCH v2 0/2] Use smbus functions to communicate through i2c Andi Shyti
2019-10-20 20:28 ` [PATCH v2 1/2] Input: mms114 - use smbus functions whenever possible Andi Shyti
2019-10-21  9:34   ` Stephan Gerhold
2019-10-21 15:41     ` Andi Shyti
2019-10-21 16:26       ` Stephan Gerhold
2019-10-21 16:39         ` Andi Shyti
2019-10-22  3:21           ` Dmitry Torokhov [this message]
2019-10-22 11:18             ` Andi Shyti
2019-11-18 13:32               ` Stephan Gerhold
2019-12-04 16:47                 ` Stephan Gerhold
2019-10-20 20:28 ` [PATCH v2 2/2] Input: mms114 - get read of custm i2c read/write functions Andi Shyti

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=20191022032140.GV35946@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andi@etezian.org \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=stephan@gerhold.net \
    --cc=sw0312.kim@samsung.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.