Re: [PATCH 2/2] iio: adc: add max11205 adc driver
From: Andy Shevchenko
Date: Thu Aug 25 2022 - 16:12:36 EST
On Wed, Aug 24, 2022 at 3:56 PM Ramona Bolboaca
<ramona.bolboaca@xxxxxxxxxx> wrote:
>
> Adding support for max11205 16-bit single-channel ultra-low power
> delta-sigma adc.
> The MAX11205 is compatible with the 2-wire interface and uses
> SCLK and RDY/DOUT for serial communica- tions. In this mode, all
> controls are implemented by tim- ing the high or low phase of the SCLK.
> The 2-wire serial interface only allows for data to be read out through the
> RDY/DOUT output.
Is there any existing driver that can be extended to support this chip?
...
> + st->chip_info = device_get_match_data(&spi->dev);
And if chip_info is NULL?
...
> +static void max11205_remove(struct spi_device *spi)
> +{
> + struct iio_dev *indio_dev = spi_get_drvdata(spi);
> + struct max11205_state *st = iio_priv(indio_dev);
> + iio_device_unregister(indio_dev);
> + regulator_disable(st->vref);
> +}
Have you tested module removal?
> +
...
> +static const struct chip_info max11205_chip_info[] = {
> + [TYPE_MAX11205A] = {
> + .out_data_rate = MAX11205A_OUT_DATA_RATE,
> + .name = "max11205a"
+ Comma
> + },
> + [TYPE_MAX11205B] = {
> + .out_data_rate = MAX11205B_OUT_DATA_RATE,
> + .name = "max11205b"
Ditto.
> + }
Ditto.
> +};
...
> +
Redundant blank line.
> +module_spi_driver(max11205_spi_driver);
--
With Best Regards,
Andy Shevchenko