From: Jonathan Cameron <jic23@kernel.org>
To: Dumitru Ceclan <mitrutzceclan@gmail.com>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org,
linux-gpio@vger.kernel.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Walle" <michael@walle.cc>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"ChiaEn Wu" <chiaen_wu@richtek.com>,
"Niklas Schnelle" <schnelle@linux.ibm.com>,
"Leonard Göhrs" <l.goehrs@pengutronix.de>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Haibo Chen" <haibo.chen@nxp.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"David Lechner" <dlechner@baylibre.com>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 2/2] iio: adc: ad7173: add AD7173 driver
Date: Sun, 21 Jan 2024 15:50:41 +0000 [thread overview]
Message-ID: <20240121155041.3fc1a85d@jic23-huawei> (raw)
In-Reply-To: <20240118125001.12809-2-mitrutzceclan@gmail.com>
On Thu, 18 Jan 2024 14:49:23 +0200
Dumitru Ceclan <mitrutzceclan@gmail.com> wrote:
> The AD7173 family offer a complete integrated Sigma-Delta ADC solution
> which can be used in high precision, low noise single channel
> applications or higher speed multiplexed applications. The Sigma-Delta
> ADC is intended primarily for measurement of signals close to DC but also
> delivers outstanding performance with input bandwidths out to ~10kHz.
>
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> Reviewed-by: Michael Walle <michael@walle.cc> # for gpio-regmap
> Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
One comment following through from adding the named irq support to the
binding. The driver needs to check that it has the right one
as perhaps only the error one is wired, or it is the first one specified
in the binding.
> +static int ad7173_probe(struct spi_device *spi)
> +{
> + struct device *dev = &spi->dev;
> + struct ad7173_state *st;
> + struct iio_dev *indio_dev;
> + int ret;
> +
> + indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + st = iio_priv(indio_dev);
> + st->info = spi_get_device_match_data(spi);
> + if (!st->info)
> + return -ENODEV;
> +
> + ida_init(&st->cfg_slots_status);
> + ret = devm_add_action_or_reset(dev, ad7173_ida_destroy, st);
> + if (ret)
> + return ret;
> +
> + indio_dev->name = st->info->name;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->info = &ad7173_info;
> +
> + spi->mode = SPI_MODE_3;
> +
> + ad7173_sigma_delta_info.num_slots = st->info->num_configs;
> + ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7173_sigma_delta_info);
> + if (ret)
> + return ret;
> +
> + ret = ad7173_fw_parse_channel_config(indio_dev);
> + if (ret)
> + return ret;
> +
> + ret = devm_ad_sd_setup_buffer_and_trigger(dev, indio_dev);
If the error interrupt is provided either first, or as the only interrupt
this is going to use the wrong one.
Probably need to have a variant of that which takes an explicit irq so that
figuring out which irq is relevant becomes a driver problem rather than the
library having a go based on spi->irq.
> + if (ret)
> + return ret;
> +
> + ret = ad7173_setup(indio_dev);
> + if (ret)
> + return ret;
> +
> + ret = devm_iio_device_register(dev, indio_dev);
> + if (ret)
> + return ret;
> +
> + if (IS_ENABLED(CONFIG_GPIOLIB))
> + return ad7173_gpio_init(st);
> +
> + return 0;
> +}
next prev parent reply other threads:[~2024-01-21 15:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 12:49 [PATCH v12 1/2] dt-bindings: adc: add AD7173 Dumitru Ceclan
2024-01-18 12:49 ` [PATCH v12 2/2] iio: adc: ad7173: add AD7173 driver Dumitru Ceclan
2024-01-21 15:50 ` Jonathan Cameron [this message]
2024-01-22 10:02 ` Ceclan Dumitru
2024-01-22 11:09 ` Jonathan Cameron
2024-01-18 15:23 ` [PATCH v12 1/2] dt-bindings: adc: add AD7173 Conor Dooley
2024-01-18 15:51 ` Ceclan Dumitru
2024-01-18 16:06 ` Conor Dooley
2024-01-21 15:41 ` Jonathan Cameron
2024-01-22 17:48 ` Conor Dooley
2024-01-18 22:42 ` David Lechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240121155041.3fc1a85d@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=chiaen_wu@richtek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dumitru.ceclan@analog.com \
--cc=haibo.chen@nxp.com \
--cc=hvilleneuve@dimonoff.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=l.goehrs@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=mike.looijmans@topic.nl \
--cc=mitrutzceclan@gmail.com \
--cc=robh+dt@kernel.org \
--cc=schnelle@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).