From 48cceecfa7625e700ed9c57392bd17923c4832c0 Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Thu, 1 Aug 2019 16:39:08 +0200 Subject: [PATCH] iio: imu: st_lsm6dsx: make IIO_CHAN_INFO_SCALE shared by type in_accel_x_scale, in_accel_y_scale and in_accel_z_scale are always the same. The scale is still defined to be in "info_mask_separate". Userspace (iio-sensor-proxy and others) is not used to that and only looks for "in_accel_scale" for the scaling factor to apply. Change IIO_CHAN_INFO_SCALE from being separate in all channel to be shared by type. This removes in_accel_x_scale, in_accel_y_scale and in_accel_z_scale and makes available in_accel_scale. This is an ABI change, but hopefully in the 'no one will notice' category. The cleanup in interface is worth the small risk that there is a custom script out there somewhere that this will break. Signed-off-by: Martin Kepplinger Acked-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h index 4d47ba36de84..4e8e67ae1632 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h @@ -58,8 +58,8 @@ enum st_lsm6dsx_hw_id { .address = addr, \ .modified = 1, \ .channel2 = mod, \ - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ - BIT(IIO_CHAN_INFO_SCALE), \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \