| .. | .. |
|---|
| 275 | 275 | { |
|---|
| 276 | 276 | struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev); |
|---|
| 277 | 277 | struct device *dev = regmap_get_device(st->map); |
|---|
| 278 | + struct inv_icm42600_timestamp *ts = iio_priv(indio_dev); |
|---|
| 278 | 279 | |
|---|
| 279 | 280 | pm_runtime_get_sync(dev); |
|---|
| 281 | + |
|---|
| 282 | + mutex_lock(&st->lock); |
|---|
| 283 | + inv_icm42600_timestamp_reset(ts); |
|---|
| 284 | + mutex_unlock(&st->lock); |
|---|
| 280 | 285 | |
|---|
| 281 | 286 | return 0; |
|---|
| 282 | 287 | } |
|---|
| .. | .. |
|---|
| 375 | 380 | struct device *dev = regmap_get_device(st->map); |
|---|
| 376 | 381 | unsigned int sensor; |
|---|
| 377 | 382 | unsigned int *watermark; |
|---|
| 378 | | - struct inv_icm42600_timestamp *ts; |
|---|
| 379 | 383 | struct inv_icm42600_sensor_conf conf = INV_ICM42600_SENSOR_CONF_INIT; |
|---|
| 380 | 384 | unsigned int sleep_temp = 0; |
|---|
| 381 | 385 | unsigned int sleep_sensor = 0; |
|---|
| .. | .. |
|---|
| 385 | 389 | if (indio_dev == st->indio_gyro) { |
|---|
| 386 | 390 | sensor = INV_ICM42600_SENSOR_GYRO; |
|---|
| 387 | 391 | watermark = &st->fifo.watermark.gyro; |
|---|
| 388 | | - ts = iio_priv(st->indio_gyro); |
|---|
| 389 | 392 | } else if (indio_dev == st->indio_accel) { |
|---|
| 390 | 393 | sensor = INV_ICM42600_SENSOR_ACCEL; |
|---|
| 391 | 394 | watermark = &st->fifo.watermark.accel; |
|---|
| 392 | | - ts = iio_priv(st->indio_accel); |
|---|
| 393 | 395 | } else { |
|---|
| 394 | 396 | return -EINVAL; |
|---|
| 395 | 397 | } |
|---|
| .. | .. |
|---|
| 416 | 418 | /* if FIFO is off, turn temperature off */ |
|---|
| 417 | 419 | if (!st->fifo.on) |
|---|
| 418 | 420 | ret = inv_icm42600_set_temp_conf(st, false, &sleep_temp); |
|---|
| 419 | | - |
|---|
| 420 | | - inv_icm42600_timestamp_reset(ts); |
|---|
| 421 | 421 | |
|---|
| 422 | 422 | out_unlock: |
|---|
| 423 | 423 | mutex_unlock(&st->lock); |
|---|