diff options
| -rw-r--r-- | drivers/iio/imu/bmi160/bmi160_core.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c index 5355507f8fa1..c9e319bff58b 100644 --- a/drivers/iio/imu/bmi160/bmi160_core.c +++ b/drivers/iio/imu/bmi160/bmi160_core.c | |||
| @@ -66,10 +66,8 @@ | |||
| 66 | 66 | ||
| 67 | #define BMI160_REG_DUMMY 0x7F | 67 | #define BMI160_REG_DUMMY 0x7F |
| 68 | 68 | ||
| 69 | #define BMI160_ACCEL_PMU_MIN_USLEEP 3200 | 69 | #define BMI160_ACCEL_PMU_MIN_USLEEP 3800 |
| 70 | #define BMI160_ACCEL_PMU_MAX_USLEEP 3800 | 70 | #define BMI160_GYRO_PMU_MIN_USLEEP 80000 |
| 71 | #define BMI160_GYRO_PMU_MIN_USLEEP 55000 | ||
| 72 | #define BMI160_GYRO_PMU_MAX_USLEEP 80000 | ||
| 73 | #define BMI160_SOFTRESET_USLEEP 1000 | 71 | #define BMI160_SOFTRESET_USLEEP 1000 |
| 74 | 72 | ||
| 75 | #define BMI160_CHANNEL(_type, _axis, _index) { \ | 73 | #define BMI160_CHANNEL(_type, _axis, _index) { \ |
| @@ -151,20 +149,9 @@ static struct bmi160_regs bmi160_regs[] = { | |||
| 151 | }, | 149 | }, |
| 152 | }; | 150 | }; |
| 153 | 151 | ||
| 154 | struct bmi160_pmu_time { | 152 | static unsigned long bmi160_pmu_time[] = { |
| 155 | unsigned long min; | 153 | [BMI160_ACCEL] = BMI160_ACCEL_PMU_MIN_USLEEP, |
| 156 | unsigned long max; | 154 | [BMI160_GYRO] = BMI160_GYRO_PMU_MIN_USLEEP, |
| 157 | }; | ||
| 158 | |||
| 159 | static struct bmi160_pmu_time bmi160_pmu_time[] = { | ||
| 160 | [BMI160_ACCEL] = { | ||
| 161 | .min = BMI160_ACCEL_PMU_MIN_USLEEP, | ||
| 162 | .max = BMI160_ACCEL_PMU_MAX_USLEEP | ||
| 163 | }, | ||
| 164 | [BMI160_GYRO] = { | ||
| 165 | .min = BMI160_GYRO_PMU_MIN_USLEEP, | ||
| 166 | .max = BMI160_GYRO_PMU_MIN_USLEEP, | ||
| 167 | }, | ||
| 168 | }; | 155 | }; |
| 169 | 156 | ||
| 170 | struct bmi160_scale { | 157 | struct bmi160_scale { |
| @@ -289,7 +276,7 @@ int bmi160_set_mode(struct bmi160_data *data, enum bmi160_sensor_type t, | |||
| 289 | if (ret < 0) | 276 | if (ret < 0) |
| 290 | return ret; | 277 | return ret; |
| 291 | 278 | ||
| 292 | usleep_range(bmi160_pmu_time[t].min, bmi160_pmu_time[t].max); | 279 | usleep_range(bmi160_pmu_time[t], bmi160_pmu_time[t] + 1000); |
| 293 | 280 | ||
| 294 | return 0; | 281 | return 0; |
| 295 | } | 282 | } |
