[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241003102921.771b2bc1@xps-13>
Date: Thu, 3 Oct 2024 10:29:21 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Frank Li <Frank.li@....com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-i3c@...ts.infradead.org, linux-kernel@...r.kernel.org, arnd@...db.de,
bbrezillon@...nel.org, boris.brezillon@...labora.com,
conor.culhane@...vaco.com, gregkh@...uxfoundation.org, imx@...ts.linux.dev,
pthombar@...ence.com, ravindra.yashvant.shinde@....com
Subject: Re: [PATCH 2/3] i3c: master: Extend address status bit to 4 and add
I3C_ADDR_SLOT_EXT_INIT
Hi Frank,
> > >
> > > -static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr,
> > > - enum i3c_addr_slot_status status)
> > > +static enum i3c_addr_slot_status
> > > +i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr)
> > > +{
> > > + return i3c_bus_get_addr_slot_status_ext(bus, addr) & I3C_ADDR_SLOT_STATUS_MASK;
> > > +}
> > > +
> > > +static void i3c_bus_set_addr_slot_status_mask(struct i3c_bus *bus, u16 addr,
> > > + enum i3c_addr_slot_status status, int mask)
> > > {
> > > int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS;
> > > unsigned long *ptr;
> > > @@ -369,11 +375,22 @@ static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr,
> > > return;
> > >
> > > ptr = bus->addrslots + (bitpos / BITS_PER_LONG);
> > > - *ptr &= ~((unsigned long)I3C_ADDR_SLOT_STATUS_MASK <<
> > > - (bitpos % BITS_PER_LONG));
> > > + *ptr &= ~((unsigned long)mask << (bitpos % BITS_PER_LONG));
> > > *ptr |= (unsigned long)status << (bitpos % BITS_PER_LONG);
> > > }
> > >
> > > +static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr,
> > > + enum i3c_addr_slot_status status)
> > > +{
> > > + i3c_bus_set_addr_slot_status_mask(bus, addr, status, I3C_ADDR_SLOT_STATUS_MASK);
> > > +}
> > > +
> > > +static void i3c_bus_set_addr_slot_status_ext(struct i3c_bus *bus, u16 addr,
> > > + enum i3c_addr_slot_status status)
> > > +{
> > > + i3c_bus_set_addr_slot_status_mask(bus, addr, status, I3C_ADDR_SLOT_EXT_STATUS_MASK);
> > > +}
> >
> > Can we drop this helper and instead modify the
> > i3c_bus_set_addr_slot_status() prototype to get the mask from its
> > parameters?
>
> git grep "i3c_bus_set_addr_slot_status(" drivers/i3c/ | wc
>
> There are 18 places need be modified without this helper function.
> are you sue what you want?
>
> Maybe drop i3c_bus_set_addr_slot_status_ext() is good idea by direct use
> i3c_bus_set_addr_slot_status_mask().
Ok fine for _mask.
Thanks,
Miquèl
Powered by blists - more mailing lists