mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Tomas Marek <tomas.marek@elrest.cz>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] i2c: add EFI i2c master driver
Date: Tue, 26 Mar 2024 07:08:30 +0100	[thread overview]
Message-ID: <ZgJmXgQZKRRQQN_u@debian> (raw)
In-Reply-To: <ZgFUcmW8aY-QSlRs@pengutronix.de>

Hi Sascha,

On Mon, Mar 25, 2024 at 11:39:46AM +0100, Sascha Hauer wrote:
> Hi Tomas,
> 
> Thanks for the patch. Looks mostly fine, but this needs fixing:
> 
> On Wed, Mar 20, 2024 at 01:55:38PM +0100, Tomas Marek wrote:
> > +static int efi_i2c_xfer(struct i2c_adapter *adapter,
> > +			struct i2c_msg *msg, int nmsgs)
> > +{
> > +	struct efi_i2c_priv *i2c_priv = adapter_to_efi_i2c_priv(adapter);
> > +	int i, ret;
> > +
> > +	for (i = nmsgs; i > 0; i--, msg++) {
> > +		ret = efi_i2c_message_xfer(i2c_priv, msg);
> > +		if (ret)
> > +			return ret;
> > +	}
> 
> Each of the messages should start with a (repeated) start bit and only
> the last message should be followed by a stop bit. By separating the
> full message into segments and pushing each segment into EFI separately
> you would instead send a stop bit after each segment, see the comment
> above EFI_I2C_REQUEST_PACKET:
> 
> ///
> /// I2C device request
> ///
> /// The EFI_I2C_REQUEST_PACKET describes a single I2C transaction.  The
> /// transaction starts with a start bit followed by the first operation
> /// in the operation array.  Subsequent operations are separated with
> /// repeated start bits and the last operation is followed by a stop bit
> /// which concludes the transaction.  Each operation is described by one
> /// of the elements in the Operation array.
> ///
> 
> Instead you have to compile all nmsgs into a single EFI_I2C_REQUEST_PACKET
> and push it into EFI as a single request.

I see. You are right. I will fix.

Best regards

Tomas

> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2024-03-26  6:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 12:55 Tomas Marek
2024-03-25 10:39 ` Sascha Hauer
2024-03-26  6:08   ` Tomas Marek [this message]

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=ZgJmXgQZKRRQQN_u@debian \
    --to=tomas.marek@elrest.cz \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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