staging: iio: tsl2583: split out functionality of taos_chip_on()
authorBrian Masney <masneyb@onstation.org>
Thu, 10 Nov 2016 09:25:37 +0000 (04:25 -0500)
committerJonathan Cameron <jic23@kernel.org>
Sat, 12 Nov 2016 16:17:07 +0000 (16:17 +0000)
commitc908fb76b29b3eb527eb7feef260bba7057680f5
tree13f3020f9c4e6c4024ba31463b7de0b6ca680b04
parent91a86a3b89462a7b0af8553428a6101df33633ac
staging: iio: tsl2583: split out functionality of taos_chip_on()

taos_chip_on() reads an eight member array called taos_config
that contains the desired state of the chip's registers. Only four
of the registers actually need to be written to. The four that do
not need to be written to are for the {low,high} byte of the lower
interrupt threshold and the {low,high} byte of the upper interrupt
threshold. Interrupts are currently not supported by this driver
so there is no need to write to these registers.

This patch removes the taos_config array and separates out the
i2c calls that write to the CONTROL, TIMING, INTERRUPT and ANALOG
registers. This is part of a larger refactor that was split up to
make the code review easier.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/light/tsl2583.c