Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	David Lechner <dlechner@baylibre.com>,
	Trevor Gamblin <tgamblin@baylibre.com>,
	Nuno Sa <nuno.sa@analog.com>
Subject: Re: [PATCH v4 10/10] iio: adc: ad7124: Implement temperature measurement
Date: Sat, 30 Nov 2024 18:59:48 +0000	[thread overview]
Message-ID: <20241130185948.300b94c4@jic23-huawei> (raw)
In-Reply-To: <20241127145929.679408-22-u.kleine-koenig@baylibre.com>

On Wed, 27 Nov 2024 15:59:39 +0100
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> If the maximal count of channels the driver supports isn't fully
> utilized, add an attribute providing the internal temperature.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
LGTM

For the whole series, I would ideally like an additional review from someone more
familiar with these parts than I am.

Thanks,

Jonathan


> @@ -902,6 +941,37 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
>  		chan[channel].channel2 = ain[1];
>  	}
>  
> +	if (num_channels < AD7124_MAX_CHANNELS) {
> +		st->channels[num_channels] = (struct ad7124_channel) {
> +			.nr = num_channels,
> +			.ain = AD7124_CHANNEL_AINP(AD7124_INPUT_TEMPSENSOR) |
> +				AD7124_CHANNEL_AINM(AD7124_INPUT_AVSS),
> +			.cfg = {
> +				.bipolar = true,
> +			},
> +		};
> +
> +		chan[num_channels] = (struct iio_chan_spec) {
> +			.type = IIO_TEMP,
> +			.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> +				BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET) |
> +				BIT(IIO_CHAN_INFO_SAMP_FREQ),
> +			.scan_type = {
> +				/*
> +				 * You might find it strange that a bipolar
> +				 * measurement yields an unsigned value, but
> +				 * this matches the device's manual.

I did indeed ;)  So good comment.

> +				 */
> +				.sign = 'u',
> +				.realbits = 24,
> +				.storagebits = 32,
> +				.endianness = IIO_BE,
> +			},
> +			.address = num_channels,
> +			.scan_index = num_channels,
> +		};
> +	};
> +
>  	return 0;
>  }
>  


      reply	other threads:[~2024-11-30 18:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 14:59 [PATCH v4 00/10] iio: adc: ad7124: Various fixes Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 01/10] iio: adc: ad7124: Don't create more channels than the driver can handle Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 02/10] iio: adc: ad7124: Refuse invalid input specifiers Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 03/10] dt-bindings: iio: adc: adi,ad7{124,173,192,780}: Allow specifications of a gpio for irq line Uwe Kleine-König
2024-11-27 15:12   ` Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 04/10] iio: adc: ad_sigma_delta: Add support for reading irq status using a GPIO Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 05/10] iio: adc: ad_sigma_delta: Handle CS assertion as intended in ad_sd_read_reg_raw() Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 06/10] iio: adc: ad_sigma_delta: Fix a race condition Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 07/10] iio: adc: ad_sigma_delta: Store information about reset sequence length Uwe Kleine-König
2024-11-27 14:59 ` [PATCH v4 08/10] iio: adc: ad_sigma_delta: Check for previous ready signals Uwe Kleine-König
2024-11-30 18:53   ` Jonathan Cameron
2024-11-27 14:59 ` [PATCH v4 09/10] iio: adc: ad7124: Add error reporting during probe Uwe Kleine-König
2024-11-30 18:56   ` Jonathan Cameron
2024-11-27 14:59 ` [PATCH v4 10/10] iio: adc: ad7124: Implement temperature measurement Uwe Kleine-König
2024-11-30 18:59   ` Jonathan Cameron [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=20241130185948.300b94c4@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=tgamblin@baylibre.com \
    --cc=u.kleine-koenig@baylibre.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