unsigned int accel_max_val;
unsigned int accel_max_scale;
unsigned int temp_scale;
+ unsigned int int_clk;
+ unsigned int max_dec_rate;
};
enum adis16480_int_pin {
if (t <= 0)
return -EINVAL;
- t = 2460000 / t;
- if (t > 2048)
- t = 2048;
+ t = st->chip_info->int_clk / t;
+ if (t > st->chip_info->max_dec_rate)
+ t = st->chip_info->max_dec_rate;
if (t != 0)
t--;
if (ret < 0)
return ret;
- freq = 2460000 / (t + 1);
+ freq = st->chip_info->int_clk / (t + 1);
*val = freq / 1000;
*val2 = (freq % 1000) * 1000;
.accel_max_val = IIO_M_S_2_TO_G(21973),
.accel_max_scale = 18,
.temp_scale = 5650, /* 5.65 milli degree Celsius */
+ .int_clk = 2460000,
+ .max_dec_rate = 2048,
},
[ADIS16480] = {
.channels = adis16480_channels,
.accel_max_val = IIO_M_S_2_TO_G(12500),
.accel_max_scale = 10,
.temp_scale = 5650, /* 5.65 milli degree Celsius */
+ .int_clk = 2460000,
+ .max_dec_rate = 2048,
},
[ADIS16485] = {
.channels = adis16485_channels,
.accel_max_val = IIO_M_S_2_TO_G(20000),
.accel_max_scale = 5,
.temp_scale = 5650, /* 5.65 milli degree Celsius */
+ .int_clk = 2460000,
+ .max_dec_rate = 2048,
},
[ADIS16488] = {
.channels = adis16480_channels,
.accel_max_val = IIO_M_S_2_TO_G(22500),
.accel_max_scale = 18,
.temp_scale = 5650, /* 5.65 milli degree Celsius */
+ .int_clk = 2460000,
+ .max_dec_rate = 2048,
},
};