From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Kim Seer Paller" <kimseer.paller@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@analog.com, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 4/4] iio: dac: ad3530r: add support for AD5710R/AD5711R
Date: Fri, 7 Aug 2026 00:11:45 +0300 [thread overview]
Message-ID: <anT4kb1dZbYY7UzA@ashevche-desk.local> (raw)
In-Reply-To: <20260724232659.269b610a@jic23-huawei>
On Fri, Jul 24, 2026 at 11:26:59PM +0100, Jonathan Cameron wrote:
> On Tue, 21 Jul 2026 16:47:13 +0800
> Kim Seer Paller <kimseer.paller@analog.com> wrote:
...
> > +static ssize_t ad5710r_get_dac_powerdown(struct iio_dev *indio_dev,
> > + uintptr_t private,
> > + const struct iio_chan_spec *chan,
> > + char *buf)
> > +{
> > + struct ad3530r_state *st = iio_priv(indio_dev);
> > + unsigned int reg_offset, ch_in_reg, reg, mode, mask;
> > + int ret;
> > +
> > + reg_offset = chan->channel / AD3530R_CH_PER_REG;
> > + ch_in_reg = chan->channel % AD3530R_CH_PER_REG;
> > + reg = AD3530R_OUTPUT_OPERATING_MODE_0 + reg_offset;
> > + mask = AD3530R_OP_MODE_CHAN_MSK(ch_in_reg);
> > +
> > + ret = regmap_read(st->regmap, reg, &mode);
> > + if (ret)
> > + return ret;
> > +
> > + return sysfs_emit(buf, "%d\n", !!(mode & mask));
>
> For consistency with the prep below, perhaps field_get() is appropriate here
> rather than !! trickery.
FYI: we have regmap_test_bits().
> > +}
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-08-06 21:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 8:47 [PATCH v2 0/4] Add support for AD5710R/AD5711R DAC Kim Seer Paller
2026-07-21 8:47 ` [PATCH v2 1/4] iio: ABI: Add DAC current powerdown attributes and 15kohm_to_gnd mode Kim Seer Paller
2026-07-21 8:47 ` [PATCH v2 2/4] dt-bindings: iio: dac: add adi,ad5710r.yaml Kim Seer Paller
2026-07-21 9:00 ` sashiko-bot
2026-07-21 15:52 ` Conor Dooley
2026-07-24 21:57 ` Jonathan Cameron
2026-07-28 15:41 ` Conor Dooley
2026-07-28 20:44 ` Jonathan Cameron
2026-07-29 17:11 ` Conor Dooley
2026-07-24 22:10 ` Jonathan Cameron
2026-07-21 8:47 ` [PATCH v2 3/4] iio: dac: ad3530r: parameterize DAC resolution Kim Seer Paller
2026-07-28 16:40 ` Nuno Sá
2026-07-21 8:47 ` [PATCH v2 4/4] iio: dac: ad3530r: add support for AD5710R/AD5711R Kim Seer Paller
2026-07-21 8:58 ` sashiko-bot
2026-07-21 10:38 ` Andy Shevchenko
2026-07-23 4:54 ` Kim Seer Paller
2026-07-24 22:26 ` Jonathan Cameron
2026-08-06 21:11 ` Andy Shevchenko [this message]
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=anT4kb1dZbYY7UzA@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=kimseer.paller@analog.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=nuno.sa@analog.com \
--cc=p.zabel@pengutronix.de \
--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