Loading drivers/iio/imu/inv_mpu/inv_mpu_ring.c +4 −4 Original line number Diff line number Diff line Loading @@ -301,6 +301,7 @@ void inv_convert_and_push_8bytes(struct inv_mpu_state *st, u16 hdr, static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, s16 x, s16 y, s16 z) { mutex_lock(&st->acc_sensor_buff); if (false == st->acc_buffer_inv_samples) return; st->timestamp.tv64 = t; Loading Loading @@ -328,11 +329,13 @@ static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, st->acc_bufsample_cnt); st->acc_buffer_inv_samples = false; } mutex_unlock(&st->acc_sensor_buff); } static void store_gyro_boot_sample(struct inv_mpu_state *st, u64 t, s16 x, s16 y, s16 z) { mutex_lock(&st->gyro_sensor_buff); if (false == st->gyro_buffer_inv_samples) return; st->timestamp.tv64 = t; Loading Loading @@ -360,6 +363,7 @@ static void store_gyro_boot_sample(struct inv_mpu_state *st, u64 t, st->gyro_bufsample_cnt); st->gyro_buffer_inv_samples = false; } mutex_unlock(&st->gyro_sensor_buff); } #else static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, Loading @@ -383,9 +387,7 @@ int inv_push_special_8bytes_buffer(struct inv_mpu_state *st, memcpy(&buf[2], &d[0], sizeof(d[0])); for (j = 0; j < 2; j++) memcpy(&buf[4 + j * 2], &d[j + 1], sizeof(d[j])); mutex_lock(&st->gyro_sensor_buff); store_gyro_boot_sample(st, t, d[0], d[1], d[2]); mutex_unlock(&st->gyro_sensor_buff); iio_push_to_buffers(indio_dev, buf); inv_push_timestamp(indio_dev, t); Loading Loading @@ -476,9 +478,7 @@ int inv_push_8bytes_buffer(struct inv_mpu_state *st, u16 sensor, u64 t, s16 *d) for (j = 0; j < 2; j++) memcpy(&buf[4 + j * 2], &d[j + 1], sizeof(d[j])); mutex_lock(&st->acc_sensor_buff); store_acc_boot_sample(st, t, d[0], d[1], d[2]); mutex_unlock(&st->acc_sensor_buff); iio_push_to_buffers(indio_dev, buf); inv_push_timestamp(indio_dev, t); st->sensor_l[ii].counter = 0; Loading drivers/iio/imu/st_asm330lhh/st_asm330lhh.h +1 −1 Original line number Diff line number Diff line Loading @@ -181,7 +181,6 @@ struct st_asm330lhh_sensor { u16 watermark; u8 batch_mask; u8 batch_addr; struct mutex sensor_buff; #ifdef CONFIG_ENABLE_ASM_ACC_GYRO_BUFFERING bool read_boot_sample; int bufsample_cnt; Loading @@ -192,6 +191,7 @@ struct st_asm330lhh_sensor { int max_buffer_time; struct input_dev *buf_dev; int report_evt_cnt; struct mutex sensor_buff; #endif }; Loading drivers/iio/imu/st_asm330lhh/st_asm330lhh_buffer.c +2 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, { int x, y, z; mutex_lock(&sensor->sensor_buff); if (false == sensor->buffer_asm_samples) return; Loading @@ -225,6 +226,7 @@ static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, sensor->id, sensor->bufsample_cnt); sensor->buffer_asm_samples = false; } mutex_unlock(&sensor->sensor_buff); } #else static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, Loading Loading @@ -337,10 +339,8 @@ static int st_asm330lhh_read_fifo(struct st_asm330lhh_hw *hw) iio_push_to_buffers_with_timestamp(iio_dev, iio_buf, hw->tsample); mutex_lock(&sensor->sensor_buff); store_acc_gyro_boot_sample(sensor, iio_buf, hw->tsample); mutex_unlock(&sensor->sensor_buff); } } read_len += word_len; Loading drivers/input/sensors/smi130/smi130_acc.c +2 −2 Original line number Diff line number Diff line Loading @@ -6965,6 +6965,7 @@ static void smi130_acc_slope_interrupt_handle(struct smi130_acc_data *smi130_acc static void store_acc_boot_sample(struct smi130_acc_data *client_data, int x, int y, int z, struct timespec ts) { mutex_lock(&client_data->acc_sensor_buff); if (false == client_data->acc_buffer_smi130_samples) return; if (ts.tv_sec < client_data->max_buffer_time) { Loading @@ -6989,6 +6990,7 @@ static void store_acc_boot_sample(struct smi130_acc_data *client_data, smi130_acc_set_mode(client_data->smi130_acc_client, SMI_ACC2X2_MODE_SUSPEND, 1); } mutex_unlock(&client_data->acc_sensor_buff); } #else static void store_acc_boot_sample(struct smi130_acc_data *client_data, Loading Loading @@ -7145,9 +7147,7 @@ static irqreturn_t smi130_acc_irq_work_func(int irq, void *handle) smi130_acc->value = acc; mutex_unlock(&smi130_acc->value_mutex); } mutex_lock(&smi130_acc->acc_sensor_buff); store_acc_boot_sample(smi130_acc, acc.x, acc.y, acc.z, ts); mutex_unlock(&smi130_acc->acc_sensor_buff); smi130_set_cpu_idle_state(false); return IRQ_HANDLED; Loading drivers/input/sensors/smi130/smi130_gyro_driver.c +2 −2 Original line number Diff line number Diff line Loading @@ -1741,6 +1741,7 @@ static void smi_gyro_input_destroy(struct smi_gyro_client_data *client_data) static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, int x, int y, int z, struct timespec ts) { mutex_lock(&client_data->gyro_sensor_buff); if (false == client_data->gyro_buffer_smi130_samples) return; if (ts.tv_sec < client_data->max_buffer_time) { Loading @@ -1766,6 +1767,7 @@ static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, smi130_gyro_delay(5); } } mutex_unlock(&client_data->gyro_sensor_buff); } #else static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, Loading Loading @@ -1918,10 +1920,8 @@ static irqreturn_t smi130_gyro_irq_work_func(int irq, void *handle) input_event(client_data->input, EV_MSC, MSC_SCAN, gyro_data.dataz); input_sync(client_data->input); mutex_lock(&client_data->gyro_sensor_buff); store_gyro_boot_sample(client_data, gyro_data.datax, gyro_data.datay, gyro_data.dataz, ts); mutex_unlock(&client_data->gyro_sensor_buff); return IRQ_HANDLED; } Loading Loading
drivers/iio/imu/inv_mpu/inv_mpu_ring.c +4 −4 Original line number Diff line number Diff line Loading @@ -301,6 +301,7 @@ void inv_convert_and_push_8bytes(struct inv_mpu_state *st, u16 hdr, static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, s16 x, s16 y, s16 z) { mutex_lock(&st->acc_sensor_buff); if (false == st->acc_buffer_inv_samples) return; st->timestamp.tv64 = t; Loading Loading @@ -328,11 +329,13 @@ static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, st->acc_bufsample_cnt); st->acc_buffer_inv_samples = false; } mutex_unlock(&st->acc_sensor_buff); } static void store_gyro_boot_sample(struct inv_mpu_state *st, u64 t, s16 x, s16 y, s16 z) { mutex_lock(&st->gyro_sensor_buff); if (false == st->gyro_buffer_inv_samples) return; st->timestamp.tv64 = t; Loading Loading @@ -360,6 +363,7 @@ static void store_gyro_boot_sample(struct inv_mpu_state *st, u64 t, st->gyro_bufsample_cnt); st->gyro_buffer_inv_samples = false; } mutex_unlock(&st->gyro_sensor_buff); } #else static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t, Loading @@ -383,9 +387,7 @@ int inv_push_special_8bytes_buffer(struct inv_mpu_state *st, memcpy(&buf[2], &d[0], sizeof(d[0])); for (j = 0; j < 2; j++) memcpy(&buf[4 + j * 2], &d[j + 1], sizeof(d[j])); mutex_lock(&st->gyro_sensor_buff); store_gyro_boot_sample(st, t, d[0], d[1], d[2]); mutex_unlock(&st->gyro_sensor_buff); iio_push_to_buffers(indio_dev, buf); inv_push_timestamp(indio_dev, t); Loading Loading @@ -476,9 +478,7 @@ int inv_push_8bytes_buffer(struct inv_mpu_state *st, u16 sensor, u64 t, s16 *d) for (j = 0; j < 2; j++) memcpy(&buf[4 + j * 2], &d[j + 1], sizeof(d[j])); mutex_lock(&st->acc_sensor_buff); store_acc_boot_sample(st, t, d[0], d[1], d[2]); mutex_unlock(&st->acc_sensor_buff); iio_push_to_buffers(indio_dev, buf); inv_push_timestamp(indio_dev, t); st->sensor_l[ii].counter = 0; Loading
drivers/iio/imu/st_asm330lhh/st_asm330lhh.h +1 −1 Original line number Diff line number Diff line Loading @@ -181,7 +181,6 @@ struct st_asm330lhh_sensor { u16 watermark; u8 batch_mask; u8 batch_addr; struct mutex sensor_buff; #ifdef CONFIG_ENABLE_ASM_ACC_GYRO_BUFFERING bool read_boot_sample; int bufsample_cnt; Loading @@ -192,6 +191,7 @@ struct st_asm330lhh_sensor { int max_buffer_time; struct input_dev *buf_dev; int report_evt_cnt; struct mutex sensor_buff; #endif }; Loading
drivers/iio/imu/st_asm330lhh/st_asm330lhh_buffer.c +2 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, { int x, y, z; mutex_lock(&sensor->sensor_buff); if (false == sensor->buffer_asm_samples) return; Loading @@ -225,6 +226,7 @@ static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, sensor->id, sensor->bufsample_cnt); sensor->buffer_asm_samples = false; } mutex_unlock(&sensor->sensor_buff); } #else static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor, Loading Loading @@ -337,10 +339,8 @@ static int st_asm330lhh_read_fifo(struct st_asm330lhh_hw *hw) iio_push_to_buffers_with_timestamp(iio_dev, iio_buf, hw->tsample); mutex_lock(&sensor->sensor_buff); store_acc_gyro_boot_sample(sensor, iio_buf, hw->tsample); mutex_unlock(&sensor->sensor_buff); } } read_len += word_len; Loading
drivers/input/sensors/smi130/smi130_acc.c +2 −2 Original line number Diff line number Diff line Loading @@ -6965,6 +6965,7 @@ static void smi130_acc_slope_interrupt_handle(struct smi130_acc_data *smi130_acc static void store_acc_boot_sample(struct smi130_acc_data *client_data, int x, int y, int z, struct timespec ts) { mutex_lock(&client_data->acc_sensor_buff); if (false == client_data->acc_buffer_smi130_samples) return; if (ts.tv_sec < client_data->max_buffer_time) { Loading @@ -6989,6 +6990,7 @@ static void store_acc_boot_sample(struct smi130_acc_data *client_data, smi130_acc_set_mode(client_data->smi130_acc_client, SMI_ACC2X2_MODE_SUSPEND, 1); } mutex_unlock(&client_data->acc_sensor_buff); } #else static void store_acc_boot_sample(struct smi130_acc_data *client_data, Loading Loading @@ -7145,9 +7147,7 @@ static irqreturn_t smi130_acc_irq_work_func(int irq, void *handle) smi130_acc->value = acc; mutex_unlock(&smi130_acc->value_mutex); } mutex_lock(&smi130_acc->acc_sensor_buff); store_acc_boot_sample(smi130_acc, acc.x, acc.y, acc.z, ts); mutex_unlock(&smi130_acc->acc_sensor_buff); smi130_set_cpu_idle_state(false); return IRQ_HANDLED; Loading
drivers/input/sensors/smi130/smi130_gyro_driver.c +2 −2 Original line number Diff line number Diff line Loading @@ -1741,6 +1741,7 @@ static void smi_gyro_input_destroy(struct smi_gyro_client_data *client_data) static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, int x, int y, int z, struct timespec ts) { mutex_lock(&client_data->gyro_sensor_buff); if (false == client_data->gyro_buffer_smi130_samples) return; if (ts.tv_sec < client_data->max_buffer_time) { Loading @@ -1766,6 +1767,7 @@ static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, smi130_gyro_delay(5); } } mutex_unlock(&client_data->gyro_sensor_buff); } #else static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data, Loading Loading @@ -1918,10 +1920,8 @@ static irqreturn_t smi130_gyro_irq_work_func(int irq, void *handle) input_event(client_data->input, EV_MSC, MSC_SCAN, gyro_data.dataz); input_sync(client_data->input); mutex_lock(&client_data->gyro_sensor_buff); store_gyro_boot_sample(client_data, gyro_data.datax, gyro_data.datay, gyro_data.dataz, ts); mutex_unlock(&client_data->gyro_sensor_buff); return IRQ_HANDLED; } Loading