Commit 0957e4fd authored by Denis CIOCCA's avatar Denis CIOCCA Committed by Greg Kroah-Hartman

iio:magnetometer: bugfix magnetometers gain values

commit a31d0928 upstream.

This patch fix gains values. The first driver was designed using
engineering samples, in mass production the values are changed.
Signed-off-by: default avatarDenis Ciocca <denis.ciocca@st.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60583643
......@@ -42,7 +42,8 @@
#define ST_MAGN_FS_AVL_5600MG 5600
#define ST_MAGN_FS_AVL_8000MG 8000
#define ST_MAGN_FS_AVL_8100MG 8100
#define ST_MAGN_FS_AVL_10000MG 10000
#define ST_MAGN_FS_AVL_12000MG 12000
#define ST_MAGN_FS_AVL_16000MG 16000
/* CUSTOM VALUES FOR SENSOR 1 */
#define ST_MAGN_1_WAI_EXP 0x3c
......@@ -69,20 +70,20 @@
#define ST_MAGN_1_FS_AVL_4700_VAL 0x05
#define ST_MAGN_1_FS_AVL_5600_VAL 0x06
#define ST_MAGN_1_FS_AVL_8100_VAL 0x07
#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100
#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855
#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670
#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450
#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400
#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330
#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230
#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980
#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760
#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600
#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400
#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355
#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295
#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205
#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909
#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169
#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492
#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222
#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500
#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030
#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347
#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020
#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315
#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666
#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500
#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816
#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389
#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878
#define ST_MAGN_1_MULTIREAD_BIT false
/* CUSTOM VALUES FOR SENSOR 2 */
......@@ -105,10 +106,12 @@
#define ST_MAGN_2_FS_MASK 0x60
#define ST_MAGN_2_FS_AVL_4000_VAL 0x00
#define ST_MAGN_2_FS_AVL_8000_VAL 0x01
#define ST_MAGN_2_FS_AVL_10000_VAL 0x02
#define ST_MAGN_2_FS_AVL_4000_GAIN 430
#define ST_MAGN_2_FS_AVL_8000_GAIN 230
#define ST_MAGN_2_FS_AVL_10000_GAIN 230
#define ST_MAGN_2_FS_AVL_12000_VAL 0x02
#define ST_MAGN_2_FS_AVL_16000_VAL 0x03
#define ST_MAGN_2_FS_AVL_4000_GAIN 146
#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_OUT_X_L_ADDR 0x28
#define ST_MAGN_2_OUT_Y_L_ADDR 0x2a
......@@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = {
.gain = ST_MAGN_2_FS_AVL_8000_GAIN,
},
[2] = {
.num = ST_MAGN_FS_AVL_10000MG,
.value = ST_MAGN_2_FS_AVL_10000_VAL,
.gain = ST_MAGN_2_FS_AVL_10000_GAIN,
.num = ST_MAGN_FS_AVL_12000MG,
.value = ST_MAGN_2_FS_AVL_12000_VAL,
.gain = ST_MAGN_2_FS_AVL_12000_GAIN,
},
[3] = {
.num = ST_MAGN_FS_AVL_16000MG,
.value = ST_MAGN_2_FS_AVL_16000_VAL,
.gain = ST_MAGN_2_FS_AVL_16000_GAIN,
},
},
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment