[PATCH v1 1/4] spi: dw: Add DDR (Dual Data-Rate) support for enhanced SPI mode

Miquel Raynal miquel.raynal at bootlin.com
Fri Oct 23 02:52:00 PDT 2026


>> > --- a/drivers/spi/spi-dw-core.c
>> > +++ b/drivers/spi/spi-dw-core.c
>> > @@ -46,6 +46,8 @@ struct dw_spi_enh_cfg {
>> >  	u8 inst_l;
>> >  	u8 addr_l;
>> >  	u8 trans_t;
>> > +	bool inst_ddr;
>> > +	bool spi_ddr;
>> 
>> If I understand this correctly, spi_ddr is quite a bad name because it means
>> address and dummy and data ddr (but not instr). Can you try to come up with
>> a better name for this variable?
>
> spi_ddr is named exactly that way on the register field. Perhaps I won't change 
> this variable name, and just add some comments to this variable—what
> do you think?

This is a boolean, not a register bit field. Please use a name that
makes sense here. This is the part of the software that people must
understanding without deep hardware knowlege. You can keep the hardware
name for naming the bitfield operation if that's relevant though.

>> Also, if my above understanding is correct, you must provide a
>> supports_op() callback which would refuse any xS-xS-xD but allow xD-xD-xD
>> and xS-xD-D modes.
>
> OK, I'll add some filter conditions.
>
> Best Regards,
> Changhuang



More information about the linux-mtd mailing list