Re: [PATCH v13 3/3] iio: adc: ad7173: add AD7173 driver

From: Nuno Sá
Date: Tue Feb 20 2024 - 07:16:07 EST


On Tue, 2024-02-20 at 13:25 +0200, Ceclan Dumitru wrote:
>
>
> On 2/20/24 12:38, Nuno Sá wrote:
> > On Tue, 2024-02-20 at 11:43 +0200, Dumitru Ceclan wrote:
>
> ...
>
> >
> > > +};
> > >
> > > + indio_dev->name = st->info->name;
> > > + indio_dev->modes = INDIO_DIRECT_MODE;
> > > + indio_dev->info = &ad7173_info;
> > > +
> > > + spi->mode = SPI_MODE_3;
> > > +
> >
> > I don't think we need the above. We should just enforce it to SPI_CPOL| SPI_CPHA
> > in
> > the bindings [2].
> >
> > [2]:
> > https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/iio/imu/adi,adis16475.yaml#L45
>
> Rob Herring V1:
>
> """
> > +  required:
> > +    - compatible
> > +    - reg
> > +    - interrupts
> > +    - spi-cpol
> > +    - spi-cpha
>
> If the device(s) are not configurable, then you shouldn't need these 2
> properties. The driver can hardcode the correct setting.
> """
>
> ref:
> https://lore.kernel.org/linux-iio/20230810205107.GA1136590-robh@xxxxxxxxxx/
>

I see. I thought it was the other way around... Then, the other thing is that I think
you should call spi_setup() after hardcoding the mode.

- Nuno Sá