On Sun, Mar 8, 2015 at 1:42 PM, Jonathan Cameron <jic23@xxxxxxxxxx> wrote: > On 23/02/15 19:35, Roberta Dobrescu wrote: >> Some ambient light sensors have hardware dependent ranges and >> resolutions. In this case user won't be able to calculate illuminance >> (lux) using only scale attribute. >> >> For instance, a device that uses a Full Scale Range is the >> light sensor ISL29018. In this case, IIO_CHAN_INFO_RANGE is >> needed since the number of ADC bits can be 4, 8, 12 or 16 and >> using just scales would result in too similar values for different >> ranges and resolutions. > This is always an interesting corner. The big question is what is > to be gained by ever running these sensors in their lower resolutions? I think the big answer here is power consumption. > > The reason I've always resisted range is that it's too easy > for people to be lazy and go with which ever of scale / range > is presented in the datasheet. Most of the time they are really > the same thing. > > The exception as you've noted here is in variable resolution devices. > There is no way that any generic code is ever going to know the right > option for the combinations of scaling and adc resolution vs time > requirements. So we are dealing here with parameters that might > be hand tweaked for a particular board. > > Anyhow, I'd like more opinions on this before I take it. > > Lars, Peter, Hartmut - what you guys think on this? Thanks for your answer Jonathan! Daniel. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html