Re: [PATCH v13 3/3] i2c: octeon: add block-mode i2c operations

From: Aryan Srivastava
Date: Mon Mar 24 2025 - 14:21:12 EST


On Thu, 2025-03-20 at 10:01 +0100, Andi Shyti wrote:
> Hi Aryan,
>
> On Thu, Mar 20, 2025 at 01:36:12AM +0000, Aryan Srivastava wrote:
> > On Wed, 2025-03-19 at 23:19 +0100, Andi Shyti wrote:
> > > > +static int octeon_i2c_hlc_block_comp_read(struct octeon_i2c
> > > > *i2c,
> > > > struct i2c_msg *msgs)
> > > > +{
> > > > +       int ret;
> > > > +       u16 len;
> > > > +       u64 cmd;
> > > > +
> > > > +       octeon_i2c_hlc_enable(i2c);
> > > > +       octeon_i2c_block_enable(i2c);
> > > > +
> > > > +       /* Write (size - 1) into block control register */
> > > > +       len = msgs[1].len - 1;
> > > > +       octeon_i2c_writeq_flush((u64)len, i2c->twsi_base +
> > > > OCTEON_REG_BLOCK_CTL(i2c));
> > > > +
> > > > +       /* Prepare core command */
> > > > +       cmd = SW_TWSI_V | SW_TWSI_R | SW_TWSI_SOVR |
> > > > SW_TWSI_OP_7_IA;
> > > > +       cmd |= (u64)(msgs[0].addr & 0x7full) <<
> > > > SW_TWSI_ADDR_SHIFT;
> > > > +
> > > > +       /* Send core command */
> > > > +       ret = octeon_i2c_hlc_read_cmd(i2c, msgs[0], cmd);
> > > > +       if (ret)
> > > > +               return ret;
> > >
> > > Do we need to disable the block mode?
> > >
> > Do you mean, do we need to disable the block mode at all? i.e. have
> > it
> > on all the time? Otherwise, it gets disabled at the bottom of this
> > func.
>
> yes, but you return earlier, right?
>
Ah yes, good catch. I will fix this up, thank you :)

Cheers, Aryan.