Lines Matching full:st

11 	struct inv_mpu6050_state  *st = iio_priv(indio_dev);  in inv_scan_query_mpu6050()  local
14 st->chip_config.gyro_fifo_enable = in inv_scan_query_mpu6050()
22 st->chip_config.accl_fifo_enable = in inv_scan_query_mpu6050()
30 st->chip_config.temp_fifo_enable = in inv_scan_query_mpu6050()
34 if (st->chip_config.gyro_fifo_enable) in inv_scan_query_mpu6050()
36 if (st->chip_config.accl_fifo_enable) in inv_scan_query_mpu6050()
38 if (st->chip_config.temp_fifo_enable) in inv_scan_query_mpu6050()
46 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_scan_query_mpu9x50() local
52 if (st->magn_disabled) in inv_scan_query_mpu9x50()
55 st->chip_config.magn_fifo_enable = in inv_scan_query_mpu9x50()
62 if (st->chip_config.magn_fifo_enable) in inv_scan_query_mpu9x50()
70 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_scan_query() local
72 switch (st->chip_type) { in inv_scan_query()
82 static unsigned int inv_compute_skip_samples(const struct inv_mpu6050_state *st) in inv_compute_skip_samples() argument
89 if (st->chip_config.gyro_fifo_enable) in inv_compute_skip_samples()
93 if (st->chip_config.magn_fifo_enable) in inv_compute_skip_samples()
104 int inv_mpu6050_prepare_fifo(struct inv_mpu6050_state *st, bool enable) in inv_mpu6050_prepare_fifo() argument
110 st->it_timestamp = 0; in inv_mpu6050_prepare_fifo()
112 d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_RST; in inv_mpu6050_prepare_fifo()
113 ret = regmap_write(st->map, st->reg->user_ctrl, d); in inv_mpu6050_prepare_fifo()
118 if (st->chip_config.gyro_fifo_enable) in inv_mpu6050_prepare_fifo()
120 if (st->chip_config.accl_fifo_enable) in inv_mpu6050_prepare_fifo()
122 if (st->chip_config.temp_fifo_enable) in inv_mpu6050_prepare_fifo()
124 if (st->chip_config.magn_fifo_enable) in inv_mpu6050_prepare_fifo()
126 ret = regmap_write(st->map, st->reg->fifo_en, d); in inv_mpu6050_prepare_fifo()
130 d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_EN; in inv_mpu6050_prepare_fifo()
131 ret = regmap_write(st->map, st->reg->user_ctrl, d); in inv_mpu6050_prepare_fifo()
135 ret = regmap_write(st->map, st->reg->int_enable, in inv_mpu6050_prepare_fifo()
138 ret = regmap_write(st->map, st->reg->int_enable, 0); in inv_mpu6050_prepare_fifo()
141 ret = regmap_write(st->map, st->reg->fifo_en, 0); in inv_mpu6050_prepare_fifo()
145 ret = regmap_write(st->map, st->reg->user_ctrl, in inv_mpu6050_prepare_fifo()
146 st->chip_config.user_ctrl); in inv_mpu6050_prepare_fifo()
159 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_set_enable() local
160 struct device *pdev = regmap_get_device(st->map); in inv_mpu6050_set_enable()
175 result = inv_mpu6050_switch_engine(st, false, ~scan); in inv_mpu6050_set_enable()
178 result = inv_mpu6050_switch_engine(st, true, scan); in inv_mpu6050_set_enable()
181 st->skip_samples = inv_compute_skip_samples(st); in inv_mpu6050_set_enable()
182 result = inv_mpu6050_prepare_fifo(st, true); in inv_mpu6050_set_enable()
186 result = inv_mpu6050_prepare_fifo(st, false); in inv_mpu6050_set_enable()
209 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu_data_rdy_trigger_set_state() local
212 mutex_lock(&st->lock); in inv_mpu_data_rdy_trigger_set_state()
214 mutex_unlock(&st->lock); in inv_mpu_data_rdy_trigger_set_state()
226 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_probe_trigger() local
228 st->trig = devm_iio_trigger_alloc(&indio_dev->dev, in inv_mpu6050_probe_trigger()
232 if (!st->trig) in inv_mpu6050_probe_trigger()
235 ret = devm_request_irq(&indio_dev->dev, st->irq, in inv_mpu6050_probe_trigger()
239 st->trig); in inv_mpu6050_probe_trigger()
243 st->trig->dev.parent = regmap_get_device(st->map); in inv_mpu6050_probe_trigger()
244 st->trig->ops = &inv_mpu_trigger_ops; in inv_mpu6050_probe_trigger()
245 iio_trigger_set_drvdata(st->trig, indio_dev); in inv_mpu6050_probe_trigger()
247 ret = devm_iio_trigger_register(&indio_dev->dev, st->trig); in inv_mpu6050_probe_trigger()
251 indio_dev->trig = iio_trigger_get(st->trig); in inv_mpu6050_probe_trigger()