[PATCH 2/3] iio: Introduce IIO_CHAN_INFO_RANGE

Daniel Baluta daniel.baluta at intel.com
Thu Feb 19 10:35:40 EET 2015


On Thu, Feb 19, 2015 at 2:40 AM, Roberta Dobrescu
<roberta.dobrescu at gmail.com> wrote:
> Some ambient light sensors have hardware dependent ranges used
> in calculating lux.

Reprhase this as:

Some ambient light sensor have hardware dependent ranges and
resolutions. In these 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.
>
> Signed-off-by: Roberta Dobrescu <roberta.dobrescu at gmail.com>
> ---
>  Documentation/ABI/testing/sysfs-bus-iio | 13 +++++++++++++
>  drivers/iio/industrialio-core.c         |  1 +
>  include/linux/iio/iio.h                 |  1 +
>  3 files changed, 15 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 9a70c31..ad1541f 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1249,3 +1249,16 @@ Contact: linux-iio at vger.kernel.org
>  Description:
>                 Specifies number of seconds in which we compute the steps
>                 that occur in order to decide if the consumer is making steps.
> +
> +What:          /sys/bus/iio/devices/deviceX/in_illuminance0_range

Is this illuminance0 or illuminance?

Otherwise it looks good.

thanks,
Daniel.


More information about the firefly mailing list