diff options
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r-- | common/motion_sense.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index c1bf6b8930..e739bc8f75 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -677,11 +677,12 @@ static int motion_sense_process(struct motion_sensor_t *sensor, if (*event & TASK_EVENT_MOTION_ODR_CHANGE) { const int sensor_bit = 1 << sensor_num; - int odr_pending = atomic_read_clear(&odr_event_required); + int odr_pending = + deprecated_atomic_read_clear(&odr_event_required); is_odr_pending = odr_pending & sensor_bit; odr_pending &= ~sensor_bit; - atomic_or(&odr_event_required, odr_pending); + deprecated_atomic_or(&odr_event_required, odr_pending); } #ifdef CONFIG_ACCEL_INTERRUPTS @@ -707,7 +708,8 @@ static int motion_sense_process(struct motion_sensor_t *sensor, } if (IS_ENABLED(CONFIG_ACCEL_FIFO) && *event & TASK_EVENT_MOTION_FLUSH_PENDING) { - int flush_pending = atomic_read_clear(&sensor->flush_pending); + int flush_pending = + deprecated_atomic_read_clear(&sensor->flush_pending); for (; flush_pending > 0; flush_pending--) { motion_sense_fifo_insert_async_event( @@ -1170,8 +1172,8 @@ static enum ec_status host_cmd_motion_sense(struct host_cmd_handler_args *args) * The new ODR may suspend sensor, leaving samples * in the FIFO. Flush it explicitly. */ - atomic_or(&odr_event_required, - 1 << (sensor - motion_sensors)); + deprecated_atomic_or(&odr_event_required, + 1 << (sensor - motion_sensors)); task_set_event(TASK_ID_MOTIONSENSE, TASK_EVENT_MOTION_ODR_CHANGE, 0); } @@ -1292,7 +1294,7 @@ static enum ec_status host_cmd_motion_sense(struct host_cmd_handler_args *args) if (sensor == NULL) return EC_RES_INVALID_PARAM; - atomic_add(&sensor->flush_pending, 1); + deprecated_atomic_add(&sensor->flush_pending, 1); task_set_event(TASK_ID_MOTIONSENSE, TASK_EVENT_MOTION_FLUSH_PENDING, 0); @@ -1645,8 +1647,8 @@ static int command_accel_data_rate(int argc, char **argv) sensor->config[config_id].odr = data | (round ? ROUND_UP_FLAG : 0); - atomic_or(&odr_event_required, - 1 << (sensor - motion_sensors)); + deprecated_atomic_or(&odr_event_required, + 1 << (sensor - motion_sensors)); task_set_event(TASK_ID_MOTIONSENSE, TASK_EVENT_MOTION_ODR_CHANGE, 0); } else { |