• Akinobu Mita's avatar
    iio: accel: adxl345: convert address field usage in iio_chan_spec · 9048f1f1
    Akinobu Mita authored
    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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    9048f1f1
adxl345_core.c 4.67 KB