]> git.baikalelectronics.ru Git - kernel.git/commit
iio: light: Simplify the current to lux LUT
authorGregor Riepl <onitake@gmail.com>
Thu, 20 Feb 2020 21:20:53 +0000 (22:20 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Mar 2020 17:28:41 +0000 (17:28 +0000)
commitabb6f3242b8eda0494bcf711fbd92ac7546bf721
tree6dc51c964eca8d13186a54bc4aa286268e5da603
parentf3fc51077bc28d7fd6b8f783d9dd810e224b144f
iio: light: Simplify the current to lux LUT

The look-up-table for currens to lux is simply specifying
all currents from 5..47 mA, if we add some values for 0..5
we can just select the index for the lux value in an array
from the mA value. Use clamp() to get the value in the
range of values in the array.

Cc: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Gregor Riepl <onitake@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/gp2ap002.c