iio: accel: adxl345: convert address field usage in iio_chan_spec
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 25 Jun 2018 15:22:41 +0000 (00:22 +0900)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 30 Jun 2018 17:25:05 +0000 (18:25 +0100)
commit9048f1f18a70a01eaa3c8e7166fdb2538929d780
tree9cbfb202a790226d263dbb45e673cb6811c08e77
parent4b5de1fa97b9932db0e989afe7dba3029fbd4545
iio: accel: adxl345: convert address field usage in iio_chan_spec

Currently the address field in iio_chan_spec is filled with an accel
data register address for the corresponding axis.

In preparation for adding calibration offset support, this sets the
address field to the index of accel data registers instead of the actual
register address.

This change makes it easier to access both accel registers and
calibration offset registers with fewer lines of code as these are
located in X-axis, Y-axis, Z-axis order.

Cc: Eva Rachel Retuya <eraretuya@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl345_core.c