]> git.baikalelectronics.ru Git - kernel.git/commit
iio: light: vl6180: Cleanup als_gain lookup, avoid register readback
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 24 Sep 2017 21:59:19 +0000 (23:59 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 9 Oct 2017 19:50:15 +0000 (20:50 +0100)
commitdea1b6964a796d881274b7079b2579b5327350f7
treeadb2e7706adae36b19e01896a472452a25705e11
parent9b81105624ff5e3c05c7c711a6d869462ba0371b
iio: light: vl6180: Cleanup als_gain lookup, avoid register readback

Instead of manually iterating the array of allowed gain values, use
find_closest. Storing the current gain setting avoids accessing the
hardware on each query.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/vl6180.c