On Wed, 2020-08-26 at 10:49 -0300, Fabio Estevam wrote: > On Wed, Aug 26, 2020 at 10:13 AM Matthias Schiffer > <matthias.schif...@ew.tq-group.com> wrote: > > > Using GPIOs for chipselect would require different pinmuxing. Also, > > why > > use GPIOs, when the SPI controller has this built in? > > In the initial chips with the ECSPI controller there was a bug with > the native chipselect controller and we had to use GPIO.
Ah, I see. Nevertheless, hardware that uses the native chipselects of newer chips exists (for example our TQ-Systems starterkit mainboards, the DTS of which we're currently preparing for mainline submission). Shouldn't num-cs be set for boards (or SoM DTSI) where not all CS pins of the SoC are usable? In any case, my original question was about the intended logic for num_chipselects for SPI drivers. My proposal was: - If num-cs is set, use that - If num-cs is unset, use the number of cs-gpios - If num-cs is unset and no cs-gpios are defined, use a driver-provided default How do other SPI controller drivers deal with this?