staging: iio: tsl2583: convert to use iio_chan_spec and {read,write}_raw
authorBrian Masney <masneyb@onstation.org>
Fri, 28 Oct 2016 10:00:17 +0000 (06:00 -0400)
committerJonathan Cameron <jic23@kernel.org>
Tue, 1 Nov 2016 18:50:06 +0000 (18:50 +0000)
commitb3d941550d9d3753ed76f09c9b1015c777f41f17
tree6b53daa479228610aa916f60ab5e619cb3b720da
parent84bc1704cbf438761f870ca4ce19bbfe5b949fb6
staging: iio: tsl2583: convert to use iio_chan_spec and {read,write}_raw

The tsl2583 driver directly creates sysfs attributes that should instead
be created by the IIO core on behalf of the driver. This patch adds the
iio_chan_spec array, the relevant info_mask elements and the read_raw()
and write_raw() functions to take advantage of features provided by the
IIO core. These sysfs attributes were migrated with this patch:
illuminance0_input, illuminance0_calibbias,
illuminance0_integration_time. This also exposes the raw values read
from the two channels on the sensor.

With this change, these four sysfs entries have their prefix changed
from illuminance0_ to in_illuminance_. This is deemed to be acceptable
since none of the IIO light drivers in mainline use the illuminance0_
prefix, however 8 of the IIO light drivers in mainline use the
in_illuminance_ prefix.

Also fix the units of integration_time to meet with the ABI.

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