Lines Matching defs:st

24 	struct inv_mpu6050_state  *st = iio_priv(indio_dev);
27 inv_mpu6050_prepare_fifo(st, false);
28 result = inv_mpu6050_prepare_fifo(st, true);
35 dev_err(regmap_get_device(st->map), "reset fifo failed %d\n", result);
36 result = regmap_write(st->map, st->reg->int_enable,
49 struct inv_mpu6050_state *st = iio_priv(indio_dev);
59 mutex_lock(&st->lock);
62 result = regmap_read(st->map, st->reg->int_status, &int_status);
64 dev_err(regmap_get_device(st->map),
71 if (!(st->chip_config.accl_fifo_enable |
72 st->chip_config.gyro_fifo_enable |
73 st->chip_config.magn_fifo_enable))
76 if (st->chip_config.accl_fifo_enable)
79 if (st->chip_config.gyro_fifo_enable)
82 if (st->chip_config.temp_fifo_enable)
85 if (st->chip_config.magn_fifo_enable)
92 result = regmap_bulk_read(st->map, st->reg->fifo_count_h,
93 st->data, INV_MPU6050_FIFO_COUNT_BYTE);
96 fifo_count = be16_to_cpup((__be16 *)&st->data[0]);
104 if (fifo_count >= st->hw->fifo_size - nb) {
105 dev_warn(regmap_get_device(st->map), "fifo overflow reset\n");
115 fifo_period = NSEC_PER_SEC / INV_MPU6050_DIVIDER_TO_FIFO_RATE(st->chip_config.divider);
116 inv_sensors_timestamp_interrupt(&st->timestamp, fifo_period, nb, nb, pf->timestamp);
117 inv_sensors_timestamp_apply_odr(&st->timestamp, fifo_period, nb, 0);
123 result = regmap_noinc_read(st->map, st->reg->fifo_r_w, st->data, fifo_count);
128 if (st->skip_samples) {
129 st->skip_samples--;
132 memcpy(data, &st->data[i * bytes_per_datum], bytes_per_datum);
133 timestamp = inv_sensors_timestamp_pop(&st->timestamp);
138 mutex_unlock(&st->lock);
146 mutex_unlock(&st->lock);