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