[PATCH 2/3] spi: mxic: patch for octal DTR mode support

Miquel Raynal miquel.raynal at bootlin.com
Tue Feb 2 03:06:30 EST 2021


Hello,

zhengxunli at mxic.com.tw wrote on Tue, 2 Feb 2021 13:37:22 +0800:

> Hi,
> 
> > > Driver patch for octal 8D-8D-8D mode support.
> > > 
> > > Signed-off-by: zhengxunli <zhengxunli at mxic.com.tw>
> > > ---
> > >  drivers/spi/spi-mxic.c | 33 ++++++++++++++++++++++-----------
> > >  1 file changed, 22 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
> > > index 96b4182..821328a 100644
> > > --- a/drivers/spi/spi-mxic.c
> > > +++ b/drivers/spi/spi-mxic.c
> > > @@ -335,8 +335,8 @@ static int mxic_spi_data_xfer(struct mxic_spi   
> > *mxic, const void *txbuf,  
> > >  static bool mxic_spi_mem_supports_op(struct spi_mem *mem,
> > >                   const struct spi_mem_op *op)
> > >  {
> > > -   if (op->data.buswidth > 4 || op->addr.buswidth > 4 ||
> > > -       op->dummy.buswidth > 4 || op->cmd.buswidth > 4)
> > > +   if (op->data.buswidth > 8 || op->addr.buswidth > 8 ||
> > > +       op->dummy.buswidth > 8 || op->cmd.buswidth > 8)
> > >        return false;
> > > 
> > >     if (op->data.nbytes && op->dummy.nbytes &&
> > > @@ -346,7 +346,7 @@ static bool mxic_spi_mem_supports_op(struct   
> > spi_mem *mem,  
> > >     if (op->addr.nbytes > 7)
> > >        return false;
> > > 
> > > -   return spi_mem_default_supports_op(mem, op);
> > > +   return true;  
> > 
> > Does not seem correct. Why would you drop this check?  
> 
> Same as Pratyush's reply. spi_mem_default_supports_op() does not support 
> dtr.

As I said: spi_mem_default_supports_op() do many checks, I don't think
it's worth giving up these checks and having a complementary helper for
DTR operations is needed.


Thanks,
Miquèl



More information about the linux-mtd mailing list