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


Groups > linux.kernel > #1480657 > unrolled thread

Re: [PATCH] iio: light: acpi-als: Add a tuning parameter interface.

Started byJonathan Cameron <jic23@kernel.org>
First post2016-09-10 18:00 +0200
Last post2016-09-10 18:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] iio: light: acpi-als: Add a tuning parameter interface. Jonathan Cameron <jic23@kernel.org> - 2016-09-10 18:00 +0200

#1480657 — Re: [PATCH] iio: light: acpi-als: Add a tuning parameter interface.

FromJonathan Cameron <jic23@kernel.org>
Date2016-09-10 18:00 +0200
SubjectRe: [PATCH] iio: light: acpi-als: Add a tuning parameter interface.
Message-ID<sfSRc-252-13@gated-at.bofh.it>
On 06/09/16 17:48, Enric Balletbo Serra wrote:
> Hi Lars,
> 
> 2016-09-06 12:31 GMT+02:00 Lars-Peter Clausen <lars@metafoo.de>:
>> On 09/06/2016 12:25 PM, Enric Balletbo i Serra wrote:
>>> From: Bryan Freed <bfreed@chromium.org>
>>>
>>> Add IIO_CHAN_INFO_CALIBSCALE to the channel to scale up or down
>>> the raw measurements through the IIO framework.
>>>
>>> Add IIO_CHAN_INFO_PROCESSED to provide the interface to read the
>>> scaled measurements through the in_illuminance_input file.
>>
>> What is the use-case for this, how is this interface supposed to be used?
> 
> The idea behind this is be able to do a per-device calibration. The
> use case we're thinking is:
> 
>  1. Read raw measurements from sensor in controlled environment (at
> 30, 500 and 1000 lux)
>  2. do some math to calculate the calibration value.
>  3. write the value to calibscale (in_illuminance_calibscale)
>  4. read the calibrated measurement (in_illuminance_input)
> 
I can see where you are coming from but its a rather nasty fudge.
Given we have non trivial maths involved I'd be inclined to say this
should really be left for userspace HAL layers.

If we were getting it from ACPI tables (as the manufacturer had
done the measurements for the device) then we might expose it this
way but given userspace has to be involved to apply the tuning anyway
I'm not sure having a means to 'fudge' the kernel returned value
really makes sense.

Jonathan
> Regards,
>   Enric
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web