iio: light: vl6180: Move range check to integration time setter, cleanup
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 24 Sep 2017 21:59:17 +0000 (23:59 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 9 Oct 2017 19:50:08 +0000 (20:50 +0100)
commit1e2ed3d0d27d80aa312b7b0081c0da56e04baeb9
treea576b826c53f096cc405997e5ed956e7a1bc94a2
parent1540d0106bcbc4e52013d759a0a0752ae7b4a09d
iio: light: vl6180: Move range check to integration time setter, cleanup

This improves code uniformity (range checks for als_gain are also done
in the setter). Also unmangle rounding and calculation of register value.

The calculated integration time it_ms is required in the next patch of
the series.

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