diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-10-30 10:26:00 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-04 15:55:32 +0000 |
commit | ea2ccb3e0271067ae8ed213b306d7545f5d1f8ce (patch) | |
tree | fd382c20deb0c9b52a0ddef6267cea4b126edc5f /drivers/staging/iio/imu/adis16400.h | |
parent | 15358a7f777529500cb1fcb089c09fb792fecf30 (diff) |
staging:iio:adis16400: Fix adis16334 sampling frequency control
Setting the sampling frequency for the adis16334 differs from the other devices.
This patch introduces two new callback functions to the adis16400 chip_info
struct which are used to specify how to read and write the current sample rate.
The patch also introduces the proper implementations for these callbacks for the
adis16334.
Related to this is that the adis16334 has no slow mode and so we do not limit
the SPI clock rate to 300kHz during initialization. The patch adds a new flag
for devices which do have a slow mode.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/imu/adis16400.h')
-rw-r--r-- | drivers/staging/iio/imu/adis16400.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/iio/imu/adis16400.h b/drivers/staging/iio/imu/adis16400.h index 77c601da1846..07a6aea75fed 100644 --- a/drivers/staging/iio/imu/adis16400.h +++ b/drivers/staging/iio/imu/adis16400.h @@ -123,6 +123,9 @@ /* SLP_CNT */ #define ADIS16400_SLP_CNT_POWER_OFF (1<<8) +#define ADIS16334_RATE_DIV_SHIFT 8 +#define ADIS16334_RATE_INT_CLK BIT(0) + #define ADIS16400_MAX_TX 24 #define ADIS16400_MAX_RX 24 @@ -130,8 +133,10 @@ #define ADIS16400_SPI_BURST (u32)(1000 * 1000) #define ADIS16400_SPI_FAST (u32)(2000 * 1000) -#define ADIS16400_HAS_PROD_ID 1 -#define ADIS16400_NO_BURST 2 +#define ADIS16400_HAS_PROD_ID BIT(0) +#define ADIS16400_NO_BURST BIT(1) +#define ADIS16400_HAS_SLOW_MODE BIT(2) + struct adis16400_chip_info { const struct iio_chan_spec *channels; const int num_channels; @@ -142,6 +147,8 @@ struct adis16400_chip_info { int temp_scale_nano; int temp_offset; unsigned long default_scan_mask; + int (*set_freq)(struct iio_dev *indio_dev, unsigned int freq); + int (*get_freq)(struct iio_dev *indio_dev); }; /** |