From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: jorge.marques@analog.com
Cc: Michael.Hennerich@analog.com, conor+dt@kernel.org,
corbet@lwn.net, devicetree@vger.kernel.org,
dlechner@baylibre.com, jic23@kernel.org, krzk+dt@kernel.org,
lars@metafoo.de, linux-doc@vger.kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
robh@kernel.org
Subject: Re: [PATCH 4/4] iio: adc: add support for ad4052
Date: Sat, 8 Mar 2025 17:12:32 +0100 [thread overview]
Message-ID: <fe21c55f-9baf-4b3d-b1fc-a866274b6178@wanadoo.fr> (raw)
In-Reply-To: <20250306-iio-driver-ad4052-v1-4-2badad30116c@analog.com>
Le 06/03/2025 à 15:03, Jorge Marques a écrit :
> The AD4052/AD4058/AD4050/AD4056 are versatile, 16-bit/12-bit,
> successive approximation register (SAR) analog-to-digital converter (ADC)
> that enables low-power, high-density data acquisition solutions without
> sacrificing precision.
...
> +#define AD4052_CHAN(bits, grade) { \
> + .type = IIO_VOLTAGE, \
> + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_RAW) | \
> + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \
> + .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \
Nitpick: Unneeded extra space before BIT
> + .indexed = 1, \
> + .channel = 0, \
> + .event_spec = ad4052_events, \
> + .num_event_specs = ARRAY_SIZE(ad4052_events), \
> + .has_ext_scan_type = 1, \
> + .ext_scan_type = ad4052_scan_type_##bits##_s, \
> + .num_ext_scan_type = ARRAY_SIZE(ad4052_scan_type_##bits##_s), \
> + .ext_info = grade##_ext_info, \
> +}
> +
> +#define AD4052_OFFLOAD_CHAN(bits, grade) { \
> + .type = IIO_VOLTAGE, \
> + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_RAW) | \
> + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) | \
> + BIT(IIO_CHAN_INFO_SAMP_FREQ), \
> + .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \
Nitpick: Unneeded extra space before BIT
> + .indexed = 1, \
> + .channel = 0, \
> + .event_spec = ad4052_events, \
> + .num_event_specs = ARRAY_SIZE(ad4052_events), \
> + .has_ext_scan_type = 1, \
> + .ext_scan_type = ad4052_scan_type_##bits##_s, \
> + .num_ext_scan_type = ARRAY_SIZE(ad4052_scan_type_##bits##_s), \
> + .ext_info = grade##_ext_info, \
> +}
...
> +static int ad4052_probe(struct spi_device *spi)
> +{
> + const struct ad4052_chip_info *chip;
> + struct device *dev = &spi->dev;
> + struct iio_dev *indio_dev;
> + struct ad4052_state *st;
> + int ret;
> + u8 buf;
> +
> + chip = spi_get_device_match_data(spi);
> + if (!chip)
> + return dev_err_probe(dev, -ENODEV,
> + "Could not find chip info data\n");
> +
> + indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + st = iio_priv(indio_dev);
> + st->spi = spi;
> + spi_set_drvdata(spi, st);
> + init_completion(&st->completion);
> +
> + st->regmap = devm_regmap_init_spi(spi, &ad4052_regmap_config);
> + if (IS_ERR(st->regmap))
> + return dev_err_probe(&spi->dev, PTR_ERR(st->regmap),
Nitpick: Unneeded extra space before PTR_ERR
> + "Failed to initialize regmap\n");
> +
> + st->mode = AD4052_SAMPLE_MODE;
> + st->wait_event = false;
> + st->chip = chip;
...
CJ
next prev parent reply other threads:[~2025-03-08 16:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 14:03 [PATCH 0/4] Add support for AD4052 device family Jorge Marques
2025-03-06 14:03 ` [PATCH 1/4] iio: code: mark iio_dev as const in iio_buffer_enabled Jorge Marques
2025-03-06 14:03 ` [PATCH 2/4] dt-bindings: iio: adc: Add adi,ad4052 Jorge Marques
2025-03-06 16:31 ` Conor Dooley
2025-03-08 15:05 ` Jonathan Cameron
2025-03-09 19:43 ` Jorge Marques
2025-03-10 19:35 ` Jonathan Cameron
2025-03-07 10:51 ` David Lechner
2025-03-09 20:11 ` Jorge Marques
2025-03-08 15:10 ` Jonathan Cameron
2025-03-09 20:25 ` Jorge Marques
2025-03-06 14:03 ` [PATCH 3/4] docs: iio: new docs for ad4052 driver Jorge Marques
2025-03-07 10:52 ` David Lechner
2025-03-09 20:49 ` Jorge Marques
2025-03-10 14:31 ` David Lechner
2025-03-10 19:56 ` Jonathan Cameron
2025-03-14 17:34 ` Jorge Marques
2025-03-15 18:24 ` Jonathan Cameron
2025-03-10 19:54 ` Jonathan Cameron
2025-03-14 18:13 ` Jorge Marques
2025-03-14 18:56 ` David Lechner
2025-03-19 16:59 ` Jorge Marques
2025-03-06 14:03 ` [PATCH 4/4] iio: adc: add support for ad4052 Jorge Marques
2025-03-07 12:06 ` kernel test robot
2025-03-07 12:39 ` kernel test robot
2025-03-07 14:22 ` kernel test robot
2025-03-08 16:02 ` Jonathan Cameron
2025-03-10 11:36 ` Jorge Marques
2025-03-08 16:12 ` Christophe JAILLET [this message]
2025-03-10 11:37 ` Jorge Marques
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=fe21c55f-9baf-4b3d-b1fc-a866274b6178@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jorge.marques@analog.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/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).