Lines Matching full:st
11 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_scan_query_mpu6050() local
20 st->chip_config.temp_fifo_enable = true; in inv_scan_query_mpu6050()
24 st->chip_config.gyro_fifo_enable = in inv_scan_query_mpu6050()
32 st->chip_config.accl_fifo_enable = in inv_scan_query_mpu6050()
40 st->chip_config.temp_fifo_enable = in inv_scan_query_mpu6050()
44 if (st->chip_config.gyro_fifo_enable) in inv_scan_query_mpu6050()
46 if (st->chip_config.accl_fifo_enable) in inv_scan_query_mpu6050()
48 if (st->chip_config.temp_fifo_enable) in inv_scan_query_mpu6050()
56 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_scan_query_mpu9x50() local
62 if (st->magn_disabled) in inv_scan_query_mpu9x50()
65 st->chip_config.magn_fifo_enable = in inv_scan_query_mpu9x50()
72 if (st->chip_config.magn_fifo_enable) in inv_scan_query_mpu9x50()
80 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_scan_query() local
82 switch (st->chip_type) { in inv_scan_query()
92 static unsigned int inv_compute_skip_samples(const struct inv_mpu6050_state *st) in inv_compute_skip_samples() argument
97 if (st->chip_config.magn_fifo_enable) in inv_compute_skip_samples()
103 int inv_mpu6050_prepare_fifo(struct inv_mpu6050_state *st, bool enable) in inv_mpu6050_prepare_fifo() argument
109 st->it_timestamp = 0; in inv_mpu6050_prepare_fifo()
111 d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_RST; in inv_mpu6050_prepare_fifo()
112 ret = regmap_write(st->map, st->reg->user_ctrl, d); in inv_mpu6050_prepare_fifo()
117 if (st->chip_config.gyro_fifo_enable) in inv_mpu6050_prepare_fifo()
119 if (st->chip_config.accl_fifo_enable) in inv_mpu6050_prepare_fifo()
121 if (st->chip_config.temp_fifo_enable) in inv_mpu6050_prepare_fifo()
123 if (st->chip_config.magn_fifo_enable) in inv_mpu6050_prepare_fifo()
125 ret = regmap_write(st->map, st->reg->fifo_en, d); in inv_mpu6050_prepare_fifo()
129 d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_EN; in inv_mpu6050_prepare_fifo()
130 ret = regmap_write(st->map, st->reg->user_ctrl, d); in inv_mpu6050_prepare_fifo()
134 ret = regmap_write(st->map, st->reg->int_enable, in inv_mpu6050_prepare_fifo()
137 ret = regmap_write(st->map, st->reg->int_enable, 0); in inv_mpu6050_prepare_fifo()
140 ret = regmap_write(st->map, st->reg->fifo_en, 0); in inv_mpu6050_prepare_fifo()
144 ret = regmap_write(st->map, st->reg->user_ctrl, in inv_mpu6050_prepare_fifo()
145 st->chip_config.user_ctrl); in inv_mpu6050_prepare_fifo()
158 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_set_enable() local
159 struct device *pdev = regmap_get_device(st->map); in inv_mpu6050_set_enable()
172 result = inv_mpu6050_switch_engine(st, false, ~scan); in inv_mpu6050_set_enable()
175 result = inv_mpu6050_switch_engine(st, true, scan); in inv_mpu6050_set_enable()
178 st->skip_samples = inv_compute_skip_samples(st); in inv_mpu6050_set_enable()
179 result = inv_mpu6050_prepare_fifo(st, true); in inv_mpu6050_set_enable()
183 result = inv_mpu6050_prepare_fifo(st, false); in inv_mpu6050_set_enable()
206 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu_data_rdy_trigger_set_state() local
209 mutex_lock(&st->lock); in inv_mpu_data_rdy_trigger_set_state()
211 mutex_unlock(&st->lock); in inv_mpu_data_rdy_trigger_set_state()
223 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_probe_trigger() local
225 st->trig = devm_iio_trigger_alloc(&indio_dev->dev, in inv_mpu6050_probe_trigger()
229 if (!st->trig) in inv_mpu6050_probe_trigger()
232 ret = devm_request_irq(&indio_dev->dev, st->irq, in inv_mpu6050_probe_trigger()
236 st->trig); in inv_mpu6050_probe_trigger()
240 st->trig->dev.parent = regmap_get_device(st->map); in inv_mpu6050_probe_trigger()
241 st->trig->ops = &inv_mpu_trigger_ops; in inv_mpu6050_probe_trigger()
242 iio_trigger_set_drvdata(st->trig, indio_dev); in inv_mpu6050_probe_trigger()
244 ret = devm_iio_trigger_register(&indio_dev->dev, st->trig); in inv_mpu6050_probe_trigger()
248 indio_dev->trig = iio_trigger_get(st->trig); in inv_mpu6050_probe_trigger()