Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381916

Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor driver

From Laxman Dewangan <ldewangan@nvidia.com>
Newsgroups linux.kernel
Subject Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor driver
Date 2016-04-18 19:10 +0200
Message-ID <rpkQp-Ms-5@gated-at.bofh.it> (permalink)
References <rnQUq-3jQ-11@gated-at.bofh.it> <rnQUq-3jQ-9@gated-at.bofh.it> <roSAO-2WB-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sunday 17 April 2016 04:24 PM, Jonathan Cameron wrote:
> On 14/04/16 15:41, Laxman Dewangan wrote:
> +static int gadc_thermal_read_channel(struct gadc_thermal_info *gti, int *val)
> +{
> +	int ret;
> +
> +	ret = iio_read_channel_processed(gti->channel, val);
> +	if (ret < 0)
> +		ret = iio_read_channel_raw(gti->channel, val);
> Is this case actually useful given it means the scaling of the adc
> isn't known?
>
> I suppose you might have defined the table in terms of raw readings,
> but then when someone comes along and 'fixes' the ADC driver to output
> it's scale your table will be wrong.
>

Yes, that may be possible if someone just move the implementation of 
processed read to raw read.
I assumed that some of adc driver implemented as raw and some of 
implemented as processed and so fallback.

However, if adc driver has processed implementation then it should not 
move to raw and deprecate the processed.

It seems raw as default should be better option. We can have two option now:

- Support raw only, not to processed.

- Or support the raw as default and processed as the optional from DT.
if (!processed)
     read_raw()
else
   read_processed()


Your opinion?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor  driver Jonathan Cameron <jic23@kernel.org> - 2016-04-17 13:00 +0200
  Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor  driver Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-18 19:10 +0200
    Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor driver Jonathan Cameron <jic23@jic23.retrosnub.co.uk> - 2016-04-18 19:40 +0200
      Re: [PATCH V3 2/2] thermal: generic-adc: Add ADC based thermal sensor  driver Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-18 19:50 +0200

csiph-web