From: Jonathan Cameron <jic23@kernel.org>
To: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
Cc: <linux-iio@vger.kernel.org>, <Nuno.Sa@analog.com>,
<Nurettin.Bolucu@analog.com>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 1/3] iio: adc: add max11410 adc driver
Date: Sun, 9 Oct 2022 17:41:54 +0100 [thread overview]
Message-ID: <20221009174154.41569d52@jic23-huawei> (raw)
In-Reply-To: <20221003105903.229-2-Ibrahim.Tilki@analog.com>
On Mon, 3 Oct 2022 13:59:01 +0300
Ibrahim Tilki <Ibrahim.Tilki@analog.com> wrote:
> Adding support for max11410 24-bit, 1.9ksps delta-sigma adc which
> has 3 differential reference and 10 differential channel inputs.
> Inputs and references can be buffered internally. Inputs can also
> be amplified with internal PGA.
>
> Device has four digital filter modes: FIR50/60, FIR50, FIR60 and SINC4.
> FIR 50Hz and 60Hz rejections can be enabled/disabled separately.
> Digital filter selection affects sampling frequency range so driver
> has to consider the configured filter when configuring sampling frequency.
>
> Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
One small thing inline that I tidied up whilst applying.
> +static int max11410_configure_channel(struct max11410_state *st,
> + struct iio_chan_spec const *chan)
> +{
> + struct max11410_channel_config cfg = st->channels[chan->address];
> + unsigned int regval;
> + int ret;
> +
> + if (chan->differential)
> + ret = max11410_set_input_mux(st, chan->channel, chan->channel2);
> + else
> + ret = max11410_set_input_mux(st, chan->channel,
> + MAX11410_AINN_GND);
> +
> + if (ret)
> + return ret;
> +
> + regval = FIELD_PREP(MAX11410_CTRL_VREFP_BUF_BIT, cfg.buffered_vrefp) |
> + FIELD_PREP(MAX11410_CTRL_VREFN_BUF_BIT, cfg.buffered_vrefn) |
> + FIELD_PREP(MAX11410_CTRL_REFSEL_MASK, cfg.refsel) |
> + FIELD_PREP(MAX11410_CTRL_UNIPOLAR_BIT, !cfg.bipolar);
drivers/iio/adc/max11410.c:370:18: warning: dubious: x & !y
I've fixed it with
... cfg.bipolar ? 0 : 1);
Shout if that's an issue (I've gotten these backwards in the past ;)
next prev parent reply other threads:[~2022-10-09 16:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 10:59 [PATCH v8 0/3] iio: adc: add max11410 adc driver Ibrahim Tilki
2022-10-03 10:59 ` [PATCH v8 1/3] " Ibrahim Tilki
2022-10-09 16:41 ` Jonathan Cameron [this message]
2022-10-03 10:59 ` [PATCH v8 2/3] dt-bindings: iio: adc: add adi,max11410.yaml Ibrahim Tilki
2022-10-03 11:11 ` Krzysztof Kozlowski
2022-10-03 10:59 ` [PATCH v8 3/3] Documentation: ABI: testing: add max11410 doc Ibrahim Tilki
2022-10-09 16:44 ` [PATCH v8 0/3] iio: adc: add max11410 adc driver Jonathan Cameron
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=20221009174154.41569d52@jic23-huawei \
--to=jic23@kernel.org \
--cc=Ibrahim.Tilki@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=Nurettin.Bolucu@analog.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@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