mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francesco Lavra <flavra@baylibre.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v3] i2c: Add FTDI FT4222H USB I2C adapter
Date: Mon, 09 Feb 2026 10:17:32 +0100	[thread overview]
Message-ID: <115bc80b5d4098cd350569a12c41a072c4ffd6d3.camel@baylibre.com> (raw)
In-Reply-To: <aYPBXTrREaaXZIdM@zenone.zhora.eu>

On Wed, 2026-02-04 at 23:06 +0100, Andi Shyti wrote:
...
> > +       buf[0] = slave_addr << 1;
> > +       buf[2] = buf[3] = 0;
> > +       do {
> > +               int pkt_len = min(FT4222_TX_HDRLEN + len - written,
> > +                                 FT4222_BULK_MAXLEN);
> > +               bool first_pkt = (written == 0);
> > +               bool last_pkt = (written + pkt_len == FT4222_TX_HDRLEN
> > + len);
> > +               int ret, actual_len;
> > +
> > +               buf[1] = 0;
> > +               if (first_pkt)
> > +                       buf[1] |= flags & FT4222_FLAG_RESTART;
> 
> Aren't we losing the _START case here?

The _RESTART flag is 0x3, and the _START flag is 0x02, so by applying the
_RESTART mask we are including the _START case too. But the code shouldn't
depend on this detail, I will change it to `flags & (FT4222_FLAG_START |
FT4222_FLAG_RESTART)`.

      reply	other threads:[~2026-02-09  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 15:52 Francesco Lavra
2026-02-04 22:06 ` Andi Shyti
2026-02-09  9:17   ` Francesco Lavra [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=115bc80b5d4098cd350569a12c41a072c4ffd6d3.camel@baylibre.com \
    --to=flavra@baylibre.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®