File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed
drivers/iio/imu/st_lsm6dsx Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 28
28
#include <linux/iio/sysfs.h>
29
29
#include <linux/bitfield.h>
30
30
31
+ #include <linux/iio/common/st_sensors.h>
31
32
#include "st_lsm6dsx.h"
32
33
33
34
#define ST_LSM6DSX_SLV_ADDR (n , base ) ((base) + (n) * 3)
@@ -88,6 +89,69 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {
88
89
.len = 6 ,
89
90
},
90
91
},
92
+ /* LIS3MDL */
93
+ {
94
+ .i2c_addr = { 0x1e },
95
+ .wai = {
96
+ .addr = ST_SENSORS_DEFAULT_WAI_ADDRESS ,
97
+ .val = 0x3d ,
98
+ },
99
+ .id = ST_LSM6DSX_ID_MAGN ,
100
+ .odr_table = {
101
+ .reg = {
102
+ .addr = 0x20 ,
103
+ .mask = GENMASK (4 , 2 ),
104
+ },
105
+ .odr_avl [0 ] = { 1000 , 0x0 },
106
+ .odr_avl [1 ] = { 2000 , 0x1 },
107
+ .odr_avl [2 ] = { 3000 , 0x2 },
108
+ .odr_avl [3 ] = { 5000 , 0x3 },
109
+ .odr_avl [4 ] = { 10000 , 0x4 },
110
+ .odr_avl [5 ] = { 20000 , 0x5 },
111
+ .odr_avl [6 ] = { 40000 , 0x6 },
112
+ .odr_avl [7 ] = { 80000 , 0x7 },
113
+ .odr_len = 8 ,
114
+ },
115
+ .fs_table = {
116
+ .reg = {
117
+ .addr = 0x21 ,
118
+ .mask = GENMASK (6 , 5 ),
119
+ },
120
+ .fs_avl [0 ] = {
121
+ .gain = 146 ,
122
+ .val = 0x00 ,
123
+ }, /* 4000 uG/LSB */
124
+ .fs_avl [1 ] = {
125
+ .gain = 292 ,
126
+ .val = 0x01 ,
127
+ }, /* 8000 uG/LSB */
128
+ .fs_avl [2 ] = {
129
+ .gain = 438 ,
130
+ .val = 0x02 ,
131
+ }, /* 12000 uG/LSB */
132
+ .fs_avl [3 ] = {
133
+ .gain = 584 ,
134
+ .val = 0x03 ,
135
+ }, /* 16000 uG/LSB */
136
+ .fs_len = 4 ,
137
+ },
138
+ .pwr_table = {
139
+ .reg = {
140
+ .addr = 0x22 ,
141
+ .mask = GENMASK (1 , 0 ),
142
+ },
143
+ .off_val = 0x2 ,
144
+ .on_val = 0x0 ,
145
+ },
146
+ .bdu = {
147
+ .addr = 0x24 ,
148
+ .mask = BIT (6 ),
149
+ },
150
+ .out = {
151
+ .addr = 0x28 ,
152
+ .len = 6 ,
153
+ },
154
+ },
91
155
};
92
156
93
157
static void st_lsm6dsx_shub_wait_complete (struct st_lsm6dsx_hw * hw )
You can’t perform that action at this time.
0 commit comments