linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Eugeniu Rosca <erosca@de.adit-jv.com>
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bhuvanesh Surachari <bhuvanesh_surachari@mentor.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>
Subject: Re: [PATCH v2] i2c: rcar: add SMBus block read support
Date: Wed, 30 Mar 2022 12:58:29 +0200	[thread overview]
Message-ID: <YkQ31VMqj1MXqBd3@shikoro> (raw)
In-Reply-To: <20220323215229.GA9403@lxhi-065>

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Hi Eugeniu,

coming back to this topic, thanks for your patience everyone.

> > 
> > You could wire up two R-Car I2C instances, set up one as an I2C slave
> > handled by the I2C testunit and then use the other instance with
> > SMBUS_BLOCK_PROC_CALL which also needs RECV_LEN. Check
> > Documentation/i2c/slave-testunit-backend.rst for details.
> 
> I am obviously not an SMBus expert, but I wonder if simply testing the
> PCA9654 I/O Expander with SMBus support on the H3-Salvator-X target
> could be acceptable as a test procedure? See some test results below.

As long as the first read value is 8 (or lower than 32), it will work.
But it is testing only this one value while my method above is more
flexible and allows for arbitrary test patterns. However, your tests
already showed that Andrew's patch seems to be not correct.

> ############################################################
> #################### ANDREW'S V2 PATCH #####################
> ############################################################
> root@rcar-gen3:# i2cget -y 4 0x68 0 i 8
> 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08
> 
> root@rcar-gen3:# i2cget -y 4 0x68 0 s
> 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08

This is wrong. The first byte is the length byte and should not be seen
here. Check the i2c_smbus_read_block_data() implementation in i2c-tools.

> ############################################################
> ##################### WOLFRAM'S PATCH ######################
> ############################################################
> root@rcar-gen3:# i2cget -y 4 0x68 0 i 8
> 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08
> 
> root@rcar-gen3:# i2cget -y 4 0x68 0 s
> 0xff 0x06 0xff 0x5f 0xff 0x11 0x08 0x08

This is how it should look like IMO.

Happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-03-30 10:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 16:06 [PATCH] i2c: rcar: add SMBus block read support Andrew Gabbasov
2021-10-05 13:31 ` Geert Uytterhoeven
2021-10-06 18:11   ` Andrew Gabbasov
2021-10-06 18:23     ` [PATCH v2] " Andrew Gabbasov
2022-02-17 19:44       ` Wolfram Sang
2022-02-18 11:02         ` Gabbasov, Andrew
2022-03-15 10:45           ` Surachari, Bhuvanesh
2022-03-30 11:04           ` Wolfram Sang
2022-04-01 16:27             ` Wolfram Sang
2022-04-01 16:29           ` Wolfram Sang
2022-03-23 21:52         ` Eugeniu Rosca
2022-03-30 10:58           ` Wolfram Sang [this message]
2022-03-30 11:09             ` Wolfram Sang
2022-03-31 16:02               ` Eugeniu Rosca
2022-04-01 16:38                 ` Wolfram Sang
2022-04-05  9:30                   ` Eugeniu Rosca
2022-04-05  9:43                     ` Wolfram Sang
2022-04-06 17:32                       ` Eugeniu Rosca
2022-04-06 19:44                         ` Wolfram Sang
2021-11-18 10:35   ` [PATCH] " Andrew Gabbasov
2022-01-09 19:20   ` Andrew Gabbasov
2022-01-25  6:45   ` Andrew Gabbasov
2022-02-17 14:40   ` Andrew Gabbasov

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=YkQ31VMqj1MXqBd3@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=andrew_gabbasov@mentor.com \
    --cc=bhuvanesh_surachari@mentor.com \
    --cc=erosca@de.adit-jv.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=roscaeugeniu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).