| /linux/drivers/iio/common/st_sensors/ |
| H A D | st_sensors_core.c | 52 unsigned int odr, struct st_sensor_odr_avl *odr_out) in st_sensors_match_odr() argument 57 if (sensor_settings->odr.odr_avl[i].hz == 0) in st_sensors_match_odr() 60 if (sensor_settings->odr.odr_avl[i].hz == odr) { in st_sensors_match_odr() 61 odr_out->hz = sensor_settings->odr.odr_avl[i].hz; in st_sensors_match_odr() 62 odr_out->value = sensor_settings->odr.odr_avl[i].value; in st_sensors_match_odr() 72 int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr) in st_sensors_set_odr() argument 80 if (!sdata->sensor_settings->odr.mask) in st_sensors_set_odr() 83 err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out); in st_sensors_set_odr() 87 if ((sdata->sensor_settings->odr.addr == in st_sensors_set_odr() 89 (sdata->sensor_settings->odr.mask == in st_sensors_set_odr() [all …]
|
| /linux/drivers/iio/imu/inv_icm42600/ |
| H A D | inv_icm42600_core.c | 116 .odr = INV_ICM42600_ODR_50HZ, 122 .odr = INV_ICM42600_ODR_50HZ, 132 .odr = INV_ICM42600_ODR_50HZ, 138 .odr = INV_ICM42600_ODR_50HZ, 191 u32 inv_icm42600_odr_to_period(enum inv_icm42600_odr odr) in inv_icm42600_odr_to_period() argument 224 return odr_periods[odr]; in inv_icm42600_odr_to_period() 305 if (conf->odr < 0) in inv_icm42600_set_accel_conf() 306 conf->odr = oldconf->odr; in inv_icm42600_set_accel_conf() 314 if (conf->odr <= INV_ICM42600_ODR_1KHZ_LN) { in inv_icm42600_set_accel_conf() 317 } else if (conf->odr >= INV_ICM42600_ODR_6_25HZ_LP && in inv_icm42600_set_accel_conf() [all …]
|
| H A D | inv_icm42600_buffer.c | 47 const void **timestamp, unsigned int *odr) in inv_icm42600_fifo_decode_packet() argument 59 *odr = 0; in inv_icm42600_fifo_decode_packet() 64 *odr = 0; in inv_icm42600_fifo_decode_packet() 66 *odr |= INV_ICM42600_SENSOR_GYRO; in inv_icm42600_fifo_decode_packet() 68 *odr |= INV_ICM42600_SENSOR_ACCEL; in inv_icm42600_fifo_decode_packet() 107 period_gyro = inv_icm42600_odr_to_period(st->conf.gyro.odr); in inv_icm42600_buffer_update_fifo_period() 112 period_accel = inv_icm42600_odr_to_period(st->conf.accel.odr); in inv_icm42600_buffer_update_fifo_period() 215 period_gyro = inv_icm42600_odr_to_period(st->conf.gyro.odr) / 1000UL; in inv_icm42600_buffer_update_watermark() 216 period_accel = inv_icm42600_odr_to_period(st->conf.accel.odr) / 1000UL; in inv_icm42600_buffer_update_watermark() 448 unsigned int odr; in inv_icm42600_buffer_fifo_read() local [all …]
|
| H A D | inv_icm42600_gyro.c | 323 unsigned int odr; in inv_icm42600_gyro_read_odr() local 326 odr = st->conf.gyro.odr; in inv_icm42600_gyro_read_odr() 329 if (inv_icm42600_gyro_odr_conv[i] == odr) in inv_icm42600_gyro_read_odr() 360 conf.odr = inv_icm42600_gyro_odr_conv[idx / 2]; in inv_icm42600_gyro_write_odr() 361 if (conf.odr == st->conf.gyro.odr) in inv_icm42600_gyro_write_odr() 367 ret = inv_sensors_timestamp_update_odr(ts, inv_icm42600_odr_to_period(conf.odr), in inv_icm42600_gyro_write_odr() 763 ts_chip.init_period = inv_icm42600_odr_to_period(st->conf.accel.odr); in inv_icm42600_gyro_init() 796 unsigned int odr; in inv_icm42600_gyro_parse_fifo() local 804 &accel, &gyro, &temp, ×tamp, &odr); in inv_icm42600_gyro_parse_fifo() 814 if (odr & INV_ICM42600_SENSOR_GYRO) in inv_icm42600_gyro_parse_fifo()
|
| H A D | inv_icm42600_accel.c | 110 if (st->conf.accel.odr >= INV_ICM42600_ODR_6_25HZ_LP && in inv_icm42600_accel_power_mode_set() 111 st->conf.accel.odr <= INV_ICM42600_ODR_1_5625HZ_LP) in inv_icm42600_accel_power_mode_set() 116 if (st->conf.accel.odr <= INV_ICM42600_ODR_1KHZ_LN) in inv_icm42600_accel_power_mode_set() 616 unsigned int odr; in inv_icm42600_accel_read_odr() local 619 odr = st->conf.accel.odr; in inv_icm42600_accel_read_odr() 622 if (inv_icm42600_accel_odr_conv[i] == odr) in inv_icm42600_accel_read_odr() 653 conf.odr = inv_icm42600_accel_odr_conv[idx / 2]; in inv_icm42600_accel_write_odr() 654 if (conf.odr == st->conf.accel.odr) in inv_icm42600_accel_write_odr() 660 ret = inv_sensors_timestamp_update_odr(ts, inv_icm42600_odr_to_period(conf.odr), in inv_icm42600_accel_write_odr() 1178 ts_chip.init_period = inv_icm42600_odr_to_period(st->conf.accel.odr); in inv_icm42600_accel_init() [all …]
|
| /linux/drivers/iio/imu/inv_icm45600/ |
| H A D | inv_icm45600_core.c | 144 .odr = INV_ICM45600_ODR_800HZ_LN, 150 .odr = INV_ICM45600_ODR_800HZ_LN, 159 .odr = INV_ICM45600_ODR_800HZ_LN, 165 .odr = INV_ICM45600_ODR_800HZ_LN, 267 u32 inv_icm45600_odr_to_period(enum inv_icm45600_odr odr) in inv_icm45600_odr_to_period() argument 286 return odr_periods[odr]; in inv_icm45600_odr_to_period() 342 if (conf->odr == U8_MAX) in inv_icm45600_set_default_conf() 343 conf->odr = oldconf->odr; in inv_icm45600_set_default_conf() 360 if (conf->odr <= INV_ICM45600_ODR_800HZ_LN) { in inv_icm45600_set_accel_conf() 366 if (conf->odr == INV_ICM45600_ODR_400HZ) in inv_icm45600_set_accel_conf() [all …]
|
| H A D | inv_icm45600_accel.c | 309 unsigned int odr; in inv_icm45600_accel_read_odr() local 312 odr = st->conf.accel.odr; in inv_icm45600_accel_read_odr() 315 if (inv_icm45600_accel_odr_conv[i] == odr) in inv_icm45600_accel_read_odr() 327 static int _inv_icm45600_accel_write_odr(struct iio_dev *indio_dev, int odr) in _inv_icm45600_accel_write_odr() argument 335 conf.odr = odr; in _inv_icm45600_accel_write_odr() 336 ret = inv_sensors_timestamp_update_odr(ts, inv_icm45600_odr_to_period(conf.odr), in _inv_icm45600_accel_write_odr() 360 int odr; in inv_icm45600_accel_write_odr() local 371 odr = inv_icm45600_accel_odr_conv[idx / 2]; in inv_icm45600_accel_write_odr() 378 ret = _inv_icm45600_accel_write_odr(indio_dev, odr); in inv_icm45600_accel_write_odr() 719 ts_chip.init_period = inv_icm45600_odr_to_period(st->conf.accel.odr); in inv_icm45600_accel_init() [all …]
|
| H A D | inv_icm45600_gyro.c | 322 unsigned int odr; in inv_icm45600_gyro_read_odr() local 325 odr = st->conf.gyro.odr; in inv_icm45600_gyro_read_odr() 328 if (inv_icm45600_gyro_odr_conv[i] == odr) in inv_icm45600_gyro_read_odr() 340 static int _inv_icm45600_gyro_write_odr(struct iio_dev *indio_dev, int odr) in _inv_icm45600_gyro_write_odr() argument 348 conf.odr = odr; in _inv_icm45600_gyro_write_odr() 349 ret = inv_sensors_timestamp_update_odr(ts, inv_icm45600_odr_to_period(conf.odr), in _inv_icm45600_gyro_write_odr() 373 int odr; in inv_icm45600_gyro_write_odr() local 384 odr = inv_icm45600_gyro_odr_conv[idx / 2]; in inv_icm45600_gyro_write_odr() 391 ret = _inv_icm45600_gyro_write_odr(indio_dev, odr); in inv_icm45600_gyro_write_odr() 727 ts_chip.init_period = inv_icm45600_odr_to_period(st->conf.gyro.odr); in inv_icm45600_gyro_init() [all …]
|
| H A D | inv_icm45600_buffer.c | 51 const __le16 **timestamp, unsigned int *odr) in inv_icm45600_fifo_decode_packet() argument 64 *odr = 0; in inv_icm45600_fifo_decode_packet() 66 *odr |= INV_ICM45600_SENSOR_GYRO; in inv_icm45600_fifo_decode_packet() 68 *odr |= INV_ICM45600_SENSOR_ACCEL; in inv_icm45600_fifo_decode_packet() 107 period_gyro = inv_icm45600_odr_to_period(st->conf.gyro.odr); in inv_icm45600_buffer_update_fifo_period() 112 period_accel = inv_icm45600_odr_to_period(st->conf.accel.odr); in inv_icm45600_buffer_update_fifo_period() 190 period_gyro = inv_icm45600_odr_to_period(st->conf.gyro.odr) / NSEC_PER_USEC; in inv_icm45600_buffer_update_watermark() 191 period_accel = inv_icm45600_odr_to_period(st->conf.accel.odr) / NSEC_PER_USEC; in inv_icm45600_buffer_update_watermark() 403 unsigned int odr; in inv_icm45600_buffer_fifo_read() local 441 &temp, ×tamp, &odr); in inv_icm45600_buffer_fifo_read()
|
| /linux/drivers/iio/accel/ |
| H A D | msa311.c | 410 static int msa311_get_odr(struct msa311_priv *msa311, unsigned int *odr) in msa311_get_odr() argument 414 err = regmap_field_read(msa311->fields[F_ODR], odr); in msa311_get_odr() 423 if (*odr > MSA311_ODR_1000_HZ) in msa311_get_odr() 424 *odr = MSA311_ODR_1000_HZ; in msa311_get_odr() 450 static int msa311_set_odr(struct msa311_priv *msa311, unsigned int odr) in msa311_set_odr() argument 463 good_odr = (odr > MSA311_ODR_1_95_HZ); in msa311_set_odr() 470 msa311_odr_table[odr].integral, in msa311_set_odr() 471 msa311_odr_table[odr].microfract, in msa311_set_odr() 476 return regmap_field_write(msa311->fields[F_ODR], odr); in msa311_set_odr() 492 unsigned int odr; in msa311_wait_for_next_data() local [all …]
|
| H A D | adxl355_core.c | 227 enum adxl355_odr odr; member 280 u64 odr; in adxl355_fill_3db_frequency_table() local 283 odr = mul_u64_u32_shr(adxl355_odr_table[data->odr][0], MEGA, 0) + in adxl355_fill_3db_frequency_table() 284 adxl355_odr_table[data->odr][1]; in adxl355_fill_3db_frequency_table() 288 div = div64_u64_rem(mul_u64_u32_shr(odr, multiplier, 0), in adxl355_fill_3db_frequency_table() 408 enum adxl355_odr odr) in adxl355_set_odr() argument 414 if (data->odr == odr) { in adxl355_set_odr() 425 FIELD_PREP(ADXL355_FILTER_ODR_MSK, odr)); in adxl355_set_odr() 429 data->odr = odr; in adxl355_set_odr() 573 *val = adxl355_odr_table[data->odr][0]; in adxl355_read_raw() [all …]
|
| H A D | st_accel_core.c | 126 .odr = { 208 .odr = { 287 .odr = { 377 .odr = { 450 .odr = { 522 .odr = { 593 .odr = { 663 .odr = { 721 .odr = { 796 .odr = { [all …]
|
| H A D | adxl367.c | 169 enum adxl367_odr odr; member 520 int freq_hz = adxl367_samp_freq_tbl[st->odr][0]; in adxl367_time_ms_to_samples() 521 int freq_microhz = adxl367_samp_freq_tbl[st->odr][1]; in adxl367_time_ms_to_samples() 593 static int _adxl367_set_odr(struct adxl367_state *st, enum adxl367_odr odr) in _adxl367_set_odr() argument 600 odr)); in _adxl367_set_odr() 604 st->odr = odr; in _adxl367_set_odr() 614 static int adxl367_set_odr(struct iio_dev *indio_dev, enum adxl367_odr odr) in adxl367_set_odr() argument 625 ret = _adxl367_set_odr(st, odr); in adxl367_set_odr() 677 enum adxl367_odr *odr) in adxl367_find_odr() argument 690 *odr = i; in adxl367_find_odr() [all …]
|
| H A D | adxl380.c | 209 u8 odr; member 272 st->odr = ADXL380_ODR_VLP; in adxl380_set_measure_en() 274 if (st->odr == ADXL380_ODR_VLP) in adxl380_set_measure_en() 439 static int adxl380_get_odr(struct adxl380_state *st, int *odr) in adxl380_get_odr() argument 441 *odr = st->chip_info->samp_freq_tbl[st->odr]; in adxl380_get_odr() 453 int odr; in adxl380_fill_lpf_tbl() local 455 ret = adxl380_get_odr(st, &odr); in adxl380_fill_lpf_tbl() 460 st->lpf_tbl[i] = DIV_ROUND_CLOSEST(odr, adxl380_lpf_div[i]); in adxl380_fill_lpf_tbl() 473 u64 div, rem, odr; in adxl380_fill_hpf_tbl() local 480 odr = mul_u64_u32_shr(odr_hz, MEGA, 0); in adxl380_fill_hpf_tbl() [all …]
|
| H A D | adxl345_core.c | 372 enum adxl345_odr odr; in adxl345_set_default_time() local 382 odr = FIELD_GET(ADXL345_BW_RATE_MSK, regval); in adxl345_set_default_time() 383 val = clamp(max_boundary - adxl345_odr_tbl[odr][0], in adxl345_set_default_time() 947 int val2, enum adxl345_odr *odr) in adxl345_find_odr() argument 954 *odr = i; in adxl345_find_odr() 962 static int adxl345_set_odr(struct adxl345_state *st, enum adxl345_odr odr) in adxl345_set_odr() argument 968 FIELD_PREP(ADXL345_BW_RATE_MSK, odr)); in adxl345_set_odr() 1061 enum adxl345_odr odr; in adxl345_read_raw() local 1104 odr = FIELD_GET(ADXL345_BW_RATE_MSK, regval); in adxl345_read_raw() 1105 *val = adxl345_odr_tbl[odr][0]; in adxl345_read_raw() [all …]
|
| /linux/drivers/iio/imu/st_lsm6dsx/ |
| H A D | st_lsm6dsx_shub.c | 159 u32 odr, timeout; in st_lsm6dsx_shub_wait_complete() local 162 odr = (hw->enable_mask & BIT(ST_LSM6DSX_ID_ACC)) ? sensor->odr : 12500; in st_lsm6dsx_shub_wait_complete() 164 timeout = max_t(u32, 2000000U / odr + 1, 10); in st_lsm6dsx_shub_wait_complete() 403 u32 odr, u16 *val) in st_lsm6dsx_shub_get_odr_val() argument 410 if (settings->odr_table.odr_avl[i].milli_hz == odr) in st_lsm6dsx_shub_get_odr_val() 422 st_lsm6dsx_shub_set_odr(struct st_lsm6dsx_sensor *sensor, u32 odr) in st_lsm6dsx_shub_set_odr() argument 428 err = st_lsm6dsx_shub_get_odr_val(sensor, odr, &val); in st_lsm6dsx_shub_set_odr() 629 int odr; in __st_lsm6dsx_shub_write_raw() local 637 odr = st_lsm6dsx_check_odr(ref_sensor, val, &odr_val); in __st_lsm6dsx_shub_write_raw() 638 if (odr < 0) in __st_lsm6dsx_shub_write_raw() [all …]
|
| H A D | st_lsm6dsx_core.c | 1708 int st_lsm6dsx_check_odr(struct st_lsm6dsx_sensor *sensor, u32 odr, u8 *val) in st_lsm6dsx_check_odr() argument 1719 if (odr_table->odr_avl[i].milli_hz >= odr) in st_lsm6dsx_check_odr() 1731 st_lsm6dsx_check_odr_dependency(struct st_lsm6dsx_hw *hw, u32 odr, in st_lsm6dsx_check_odr_dependency() argument 1736 if (odr > 0) { in st_lsm6dsx_check_odr_dependency() 1738 return max_t(u32, ref->odr, odr); in st_lsm6dsx_check_odr_dependency() 1740 return odr; in st_lsm6dsx_check_odr_dependency() 1742 return (hw->enable_mask & BIT(id)) ? ref->odr : 0; in st_lsm6dsx_check_odr_dependency() 1763 u32 odr; in st_lsm6dsx_set_odr() local 1777 odr = st_lsm6dsx_check_odr_dependency(hw, req_odr, i); in st_lsm6dsx_set_odr() 1778 if (odr != req_odr) in st_lsm6dsx_set_odr() [all …]
|
| /linux/drivers/iio/pressure/ |
| H A D | st_pressure_core.c | 238 .odr = { 311 .odr = { 363 .odr = { 432 .odr = { 499 .odr = { 568 .odr = { 687 *val = press_data->odr; in st_press_read_raw() 769 press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz; in st_press_common_probe()
|
| H A D | zpa2326.c | 84 u16 odr; member 92 { .hz = 1, .odr = 1 << ZPA2326_CTRL_REG3_ODR_SHIFT }, 93 { .hz = 5, .odr = 5 << ZPA2326_CTRL_REG3_ODR_SHIFT }, 94 { .hz = 11, .odr = 6 << ZPA2326_CTRL_REG3_ODR_SHIFT }, 95 { .hz = 23, .odr = 7 << ZPA2326_CTRL_REG3_ODR_SHIFT }, 411 err = regmap_write(regs, ZPA2326_CTRL_REG3_REG, freq->odr); in zpa2326_config_oneshot() 1327 zpa2326_highest_frequency()->odr); in zpa2326_set_trigger_state() 1366 priv->frequency->odr); in zpa2326_set_trigger_state()
|
| /linux/drivers/iio/gyro/ |
| H A D | st_gyro_core.c | 77 .odr = { 155 .odr = { 229 .odr = { 303 .odr = { 396 *val = gdata->odr; in st_gyro_read_raw() 493 gdata->odr = gdata->sensor_settings->odr.odr_avl[0].hz; in st_gyro_common_probe()
|
| /linux/drivers/iio/magnetometer/ |
| H A D | st_magn_core.c | 152 .odr = { 231 .odr = { 311 .odr = { 384 .odr = { 433 .odr = { 532 *val = mdata->odr; in st_magn_read_raw() 629 mdata->odr = mdata->sensor_settings->odr.odr_avl[0].hz; in st_magn_common_probe()
|
| H A D | bmc150_magn.c | 170 u8 odr; member 317 int rep_z, int odr) in bmc150_magn_set_max_odr() argument 335 if (odr <= 0) { in bmc150_magn_set_max_odr() 336 ret = bmc150_magn_get_odr(data, &odr); in bmc150_magn_set_max_odr() 342 if (odr > max_odr) { in bmc150_magn_set_max_odr() 345 odr); in bmc150_magn_set_max_odr() 721 ret = bmc150_magn_set_odr(data, preset.odr); in bmc150_magn_init() 724 preset.odr); in bmc150_magn_init() 745 preset.odr); in bmc150_magn_init()
|
| /linux/drivers/iio/imu/ |
| H A D | fxos8700_core.c | 281 int odr; member 480 int odr, int uodr) in fxos8700_set_odr() argument 504 if (fxos8700_odr[i].odr == odr && fxos8700_odr[i].uodr == uodr) in fxos8700_set_odr() 516 int *odr, int *uodr) in fxos8700_get_odr() argument 534 *odr = fxos8700_odr[i].odr; in fxos8700_get_odr()
|
| /linux/drivers/iio/adc/ |
| H A D | ad7780.c | 66 unsigned int odr; member 130 *val = st->odr; in ad7780_read_raw() 174 st->odr = ad778x_odr_avail[val]; in ad7780_write_raw() 196 st->odr = ad778x_odr_avail[raw_sample & AD7780_FILTER]; in ad7780_postprocess_sample()
|
| /linux/arch/powerpc/platforms/44x/ |
| H A D | gpio.c | 33 __be32 odr; member 104 clrbits32(®s->odr, GPIO_MASK(gpio)); in ppc4xx_gpio_dir_in() 136 clrbits32(®s->odr, GPIO_MASK(gpio)); in ppc4xx_gpio_dir_out()
|