[PATCH 3.16 003/133] iio: magnetometer: st_magn_core: enable multiread by default for LIS3MDL

From: Ben Hutchings
Date: Tue Nov 21 2017 - 21:49:45 EST


3.16.51-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx>

commit 13718564167da80b6169809185b4c5a32497d0c1 upstream.

Enable multiread by default for LIS3MDL since using I2C interface
the subaddr Msb is used to automatically increase the slave address
during multiple data read/write. In the same way, using SPI interface,
bit 1 in register address is used to enable auto-increment of the slave
address in multiple read/write.

Fixes: 872e79add756 (iio:magn: Add STMicroelectronics magn driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxx>
Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxxx>
[bwh: Backported to 3.16: Update the macro used to fill in this field]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/iio/magnetometer/st_magn_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -112,7 +112,7 @@
#define ST_MAGN_2_FS_AVL_8000_GAIN 292
#define ST_MAGN_2_FS_AVL_12000_GAIN 438
#define ST_MAGN_2_FS_AVL_16000_GAIN 584
-#define ST_MAGN_2_MULTIREAD_BIT false
+#define ST_MAGN_2_MULTIREAD_BIT true
#define ST_MAGN_2_OUT_X_L_ADDR 0x28
#define ST_MAGN_2_OUT_Y_L_ADDR 0x2a
#define ST_MAGN_2_OUT_Z_L_ADDR 0x2c