Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Nikhil Gautam <nikhilgtr@gmail.com>
Cc: anshulusr@gmail.com, dlechner@baylibre.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: dac: mcp4821: add configurable gain support
Date: Thu, 26 Mar 2026 20:38:24 +0000	[thread overview]
Message-ID: <20260326203824.59e8e950@jic23-huawei> (raw)
In-Reply-To: <20260326071242.9218-1-nikhilgtr@gmail.com>

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.

>  		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;


  reply	other threads:[~2026-03-26 20:38 UTC|newest]

Thread overview: 11+ 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 [this message]
2026-03-27  5:55       ` Nikhil Gautam
2026-03-27  6:18         ` [PATCH v3] " Nikhil Gautam
2026-04-11 19:48           ` David Lechner
2026-04-12 15:23             ` Nikhil Gautam
2026-04-12 18:35               ` David Lechner
2026-04-13 18:33                 ` 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=20260326203824.59e8e950@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=nikhilgtr@gmail.com \
    /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