Re: [PATCH v3 01/17] spi: spi-mem: Add DTR templates for cmd, address, dummy and data phase

From: Boris Brezillon
Date: Wed Jan 05 2022 - 02:36:48 EST


On Wed, 5 Jan 2022 11:20:55 +0530
Pratyush Yadav <p.yadav@xxxxxx> wrote:

> On 04/01/22 04:31PM, Boris Brezillon wrote:
> > and you get to define a DTR op like that:
> >
> > struct spi_mem_op op =
> > SPI_MEM_OP(SPI_MEM_OP_EXT_CMD(2, 0x1234, 8, SPI_MEM_OP_DTR),
> > SPI_MEM_OP_ADDR(4, 0xdeadbeef, 8, SPI_MEM_OP_DTR),
> > SPI_MEM_OP_DATA_OUT(128, buf, 8, SPI_MEM_OP_DTR));
> >
> > This also means we can extend the struct without having to define new macros.
>
> I like this. It would also let us easily mix-and-match the ecc parameter
> that Miquel is adding.
>

In practice, I doubt you'll ever set the ecc bit when declaring the op,
it's more a modification you do afterwards if ECC needs to be enabled,
but who knows...