Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>
Cc: Alexandru Ardelean <aardelean@baylibre.com>,
	Alisa-Dariana Roman <alisa.roman@analog.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Conor Dooley <conor+dt@kernel.org>,
	Dumitru Ceclan <dumitru.ceclan@analog.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Nuno Sa <nuno.sa@analog.com>, Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 10/10] iio: adc: ad7124: Implement temperature measurement
Date: Fri, 22 Nov 2024 09:46:10 -0600	[thread overview]
Message-ID: <a50bc35e-779c-414e-bfa3-cf9264cd77be@baylibre.com> (raw)
In-Reply-To: <20241122113322.242875-22-u.kleine-koenig@baylibre.com>

On 11/22/24 5:33 AM, Uwe Kleine-König wrote:
> If the maximal count of channels the driver supports isn't fully
> utilized, add an attribute providing the internal temperature.
> 

...

> @@ -901,6 +945,32 @@ 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 = {
> +				.sign = 'u',

The combination of .bipolar = true and .sign = 'u' looks a bit suspicions.

> +				.realbits = 24,
> +				.storagebits = 32,
> +				.endianness = IIO_BE,
> +			},
> +			.address = num_channels,
> +			.scan_index = num_channels,
> +		};
> +	};
> +
>  	return 0;
>  }
>  


  reply	other threads:[~2024-11-22 15:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 11:33 [PATCH v3 00/10] iio: adc: ad7124: Various fixes Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 01/10] iio: adc: ad7124: Don't create more channels than the driver can handle Uwe Kleine-König
2024-11-22 15:14   ` David Lechner
2024-11-22 15:54     ` Uwe Kleine-König
2024-11-22 16:18       ` David Lechner
2024-11-22 11:33 ` [PATCH v3 02/10] iio: adc: ad7124: Refuse invalid input specifiers Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 03/10] dt-bindings: iio: adc: adi,ad7124: Allow specifications of a gpio for irq line Uwe Kleine-König
2024-11-27 13:41   ` Rob Herring
2024-11-27 15:09     ` Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 04/10] iio: adc: ad_sigma_delta: Add support for reading irq status using a GPIO Uwe Kleine-König
2024-11-22 19:16   ` Andy Shevchenko
2024-11-25 10:49     ` Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 05/10] iio: adc: ad_sigma_delta: Handle CS assertion as intended in ad_sd_read_reg_raw() Uwe Kleine-König
2024-11-22 15:16   ` Trevor Gamblin
2024-11-22 15:55     ` Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 06/10] iio: adc: ad_sigma_delta: Fix a race condition Uwe Kleine-König
2024-11-22 19:21   ` Andy Shevchenko
2024-11-22 11:33 ` [PATCH v3 07/10] iio: adc: ad_sigma_delta: Store information about reset sequence length Uwe Kleine-König
2024-11-22 20:07   ` Andy Shevchenko
2024-11-25 10:14   ` kernel test robot
2024-11-22 11:33 ` [PATCH v3 08/10] iio: adc: ad_sigma_delta: Check for previous ready signals Uwe Kleine-König
2024-11-22 20:17   ` Andy Shevchenko
2024-11-25 11:10     ` Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 09/10] iio: adc: ad7124: Add error reporting during probe Uwe Kleine-König
2024-11-22 16:44   ` Trevor Gamblin
2024-11-25 11:20     ` Uwe Kleine-König
2024-11-22 20:25   ` Andy Shevchenko
2024-11-25 11:18     ` Uwe Kleine-König
2024-11-22 11:33 ` [PATCH v3 10/10] iio: adc: ad7124: Implement temperature measurement Uwe Kleine-König
2024-11-22 15:46   ` David Lechner [this message]
2024-11-22 20:31   ` Andy Shevchenko
2024-11-25 11:27     ` Uwe Kleine-König
2024-11-25 13:47       ` Andy Shevchenko
2024-11-25 14:52         ` Uwe Kleine-König
2024-11-25 19:33           ` Andy Shevchenko
2024-11-27 14:05             ` Nuno Sá
2024-11-27 14:38             ` Uwe Kleine-König

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=a50bc35e-779c-414e-bfa3-cf9264cd77be@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=aardelean@baylibre.com \
    --cc=alisa.roman@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dumitru.ceclan@analog.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --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