From: Nikhil Gautam <nikhilgtr@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: anshulusr@gmail.com, dlechner@baylibre.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: dac: mcp4821: add configurable gain support
Date: Fri, 27 Mar 2026 11:25:33 +0530 [thread overview]
Message-ID: <acYb1XOmw1yoyu_4@nik> (raw)
In-Reply-To: <20260326203824.59e8e950@jic23-huawei>
On Thu, Mar 26, 2026 at 08:38:24PM +0000, Jonathan Cameron wrote:
> On Thu, 26 Mar 2026 12:42:42 +0530
> Nikhil Gautam <nikhilgtr@gmail.com> wrote:
>
> > Add support for configuring the DAC gain using the GA bit.
> > Expose gain control via IIO_CHAN_INFO_CALIBSCALE.
> >
> > Scale is updated dynamically based on selected gain:
> > - 1x gain → 2.048V full-scale
> > - 2x gain → 4.096V full-scale
> >
> > Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
> Just one small thing from me.
>
> > static int mcp4821_probe(struct spi_device *spi)
> > @@ -177,12 +235,15 @@ static int mcp4821_probe(struct spi_device *spi)
> > const struct mcp4821_chip_info *info;
> >
> > indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*state));
> > - if (indio_dev == NULL)
> > + if (!indio_dev)
>
> Not related to rest of the patch. So doesn't belong in here.
> Also generally not worth the noise of changing these.
Sure will remove this change in v3,
will avoid these kind of changes in my future patches
>
> > return -ENOMEM;
> >
> > state = iio_priv(indio_dev);
> > state->spi = spi;
> >
> > + /* default gain is 2x as GA bit is active low*/
> > + state->gain_1x = false;
> > +
> > info = spi_get_device_match_data(spi);
> > indio_dev->name = info->name;
> > indio_dev->info = &mcp4821_info;
>
Thanks,
Nikhil
next prev parent reply other threads:[~2026-03-27 5:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 16:52 [PATCH] iio: dac: mcp4821: add configurable gain support Nikhil Gautam
2026-03-21 18:07 ` Jonathan Cameron
2026-03-25 6:51 ` Nikhil Gautam
2026-03-26 7:12 ` [PATCH v2] " Nikhil Gautam
2026-03-26 20:38 ` Jonathan Cameron
2026-03-27 5:55 ` Nikhil Gautam [this message]
2026-03-27 6:18 ` [PATCH v3] " Nikhil Gautam
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=acYb1XOmw1yoyu_4@nik \
--to=nikhilgtr@gmail.com \
--cc=anshulusr@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.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