Lines Matching refs:st

27 static void inv_clear_kfifo(struct inv_mpu6050_state *st)  in inv_clear_kfifo()  argument
32 spin_lock_irqsave(&st->time_stamp_lock, flags); in inv_clear_kfifo()
33 kfifo_reset(&st->timestamps); in inv_clear_kfifo()
34 spin_unlock_irqrestore(&st->time_stamp_lock, flags); in inv_clear_kfifo()
41 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_reset_fifo() local
44 result = inv_mpu6050_write_reg(st, st->reg->int_enable, 0); in inv_reset_fifo()
46 dev_err(&st->client->dev, "int_enable failed %d\n", result); in inv_reset_fifo()
50 result = inv_mpu6050_write_reg(st, st->reg->fifo_en, 0); in inv_reset_fifo()
54 result = inv_mpu6050_write_reg(st, st->reg->user_ctrl, 0); in inv_reset_fifo()
59 result = inv_mpu6050_write_reg(st, st->reg->user_ctrl, in inv_reset_fifo()
65 inv_clear_kfifo(st); in inv_reset_fifo()
68 if (st->chip_config.accl_fifo_enable || in inv_reset_fifo()
69 st->chip_config.gyro_fifo_enable) { in inv_reset_fifo()
70 result = inv_mpu6050_write_reg(st, st->reg->int_enable, in inv_reset_fifo()
76 result = inv_mpu6050_write_reg(st, st->reg->user_ctrl, in inv_reset_fifo()
82 if (st->chip_config.gyro_fifo_enable) in inv_reset_fifo()
84 if (st->chip_config.accl_fifo_enable) in inv_reset_fifo()
86 result = inv_mpu6050_write_reg(st, st->reg->fifo_en, d); in inv_reset_fifo()
93 dev_err(&st->client->dev, "reset fifo failed %d\n", result); in inv_reset_fifo()
94 result = inv_mpu6050_write_reg(st, st->reg->int_enable, in inv_reset_fifo()
107 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_irq_handler() local
111 kfifo_in_spinlocked(&st->timestamps, &timestamp, 1, in inv_mpu6050_irq_handler()
112 &st->time_stamp_lock); in inv_mpu6050_irq_handler()
124 struct inv_mpu6050_state *st = iio_priv(indio_dev); in inv_mpu6050_read_fifo() local
132 if (!(st->chip_config.accl_fifo_enable | in inv_mpu6050_read_fifo()
133 st->chip_config.gyro_fifo_enable)) in inv_mpu6050_read_fifo()
136 if (st->chip_config.accl_fifo_enable) in inv_mpu6050_read_fifo()
139 if (st->chip_config.gyro_fifo_enable) in inv_mpu6050_read_fifo()
146 result = i2c_smbus_read_i2c_block_data(st->client, in inv_mpu6050_read_fifo()
147 st->reg->fifo_count_h, in inv_mpu6050_read_fifo()
160 if (kfifo_len(&st->timestamps) > in inv_mpu6050_read_fifo()
164 result = i2c_smbus_read_i2c_block_data(st->client, in inv_mpu6050_read_fifo()
165 st->reg->fifo_r_w, in inv_mpu6050_read_fifo()
170 result = kfifo_out(&st->timestamps, &timestamp, 1); in inv_mpu6050_read_fifo()