public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <robh@kernel.org>, <conor+dt@kernel.org>,
	<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 09/10] iio: adc: ad4080: add driver support
Date: Sun, 4 May 2025 16:40:15 +0100	[thread overview]
Message-ID: <20250504164015.4b6f8dd1@jic23-huawei> (raw)
In-Reply-To: <20250502085905.24926-10-antoniu.miclaus@analog.com>

On Fri, 2 May 2025 11:59:04 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Add support for AD4080 high-speed, low noise, low distortion,
> 20-bit, Easy Drive, successive approximation register (SAR)
> analog-to-digital converter (ADC).
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

One trivial thing I noticed to add to Nuno's much more detailed review!


> diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
> new file mode 100644
> index 000000000000..9168dee9323e
> --- /dev/null
> +++ b/drivers/iio/adc/ad4080.c

> +static int ad4080_set_dec_rate(struct iio_dev *dev,
> +			       const struct iio_chan_spec *chan,
> +			       unsigned int mode)
> +{
> +	struct ad4080_state *st = iio_priv(dev);
> +	int ret;
> +
> +	if ((st->filter_type >= SINC_5 && mode >= 512) || mode < 2)
> +		return -EINVAL;
> +
> +	ret = regmap_update_bits(st->regmap, AD4080_REG_FILTER_CONFIG,
> +				 AD4080_FILTER_CONFIG_SINC_DEC_RATE_MSK,
> +				 FIELD_PREP(AD4080_FILTER_CONFIG_SINC_DEC_RATE_MSK,
> +					    (ilog2(mode) - 1)));
> +	if (ret)
> +		return ret;
> +
> +	return 0;

return regmap_update_bits();


> +}


  parent reply	other threads:[~2025-05-04 15:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02  8:58 [PATCH v4 00/10] Add support for AD4080 ADC Antoniu Miclaus
2025-05-02  8:58 ` [PATCH v4 01/10] iio: backend: add support for filter config Antoniu Miclaus
2025-05-02  8:58 ` [PATCH v4 02/10] iio: backend: add support for data alignment Antoniu Miclaus
2025-05-02 15:26   ` Nuno Sá
2025-05-02  8:58 ` [PATCH v4 03/10] iio: backend: add support for number of lanes Antoniu Miclaus
2025-05-02  8:58 ` [PATCH v4 04/10] dt-bindings: iio: adc: add ad408x axi variant Antoniu Miclaus
2025-05-02  8:59 ` [PATCH v4 05/10] iio: adc: adi-axi-adc: add filter type config Antoniu Miclaus
2025-05-02 15:20   ` Nuno Sá
2025-05-02  8:59 ` [PATCH v4 06/10] iio: adc: adi-axi-adc: add data align process Antoniu Miclaus
2025-05-02 15:27   ` Nuno Sá
2025-05-02  8:59 ` [PATCH v4 07/10] iio: adc: adi-axi-adc: add num lanes support Antoniu Miclaus
2025-05-02  8:59 ` [PATCH v4 08/10] dt-bindings: iio: adc: add ad4080 Antoniu Miclaus
2025-05-02  8:59 ` [PATCH v4 09/10] iio: adc: ad4080: add driver support Antoniu Miclaus
2025-05-02 15:37   ` Nuno Sá
2025-05-04 15:40   ` Jonathan Cameron [this message]
2025-05-02  8:59 ` [PATCH v4 10/10] Documetation: ABI: add sinc1 and sinc5+pf1 filter Antoniu Miclaus

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=20250504164015.4b6f8dd1@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@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