summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel/adis16220.h
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-11-13 13:28:00 (GMT)
committerJonathan Cameron <jic23@kernel.org>2012-11-19 22:22:07 (GMT)
commitedcf600912d218a1d8a6378e37b19ecab63abddd (patch)
tree0e96878041dd76061fd370d264c5ffcf9658cb1d /drivers/staging/iio/accel/adis16220.h
parent511fb29e351ae90b0ad7341f3729468003449ac4 (diff)
downloadlinux-edcf600912d218a1d8a6378e37b19ecab63abddd.tar.xz
staging:iio:adis16220: Use adis library
Use the new adis library for the adis16220 driver. The adis16220 driver is a bit special and so we can only make use of the generic register access and control functions for now. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/accel/adis16220.h')
-rw-r--r--drivers/staging/iio/accel/adis16220.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/iio/accel/adis16220.h b/drivers/staging/iio/accel/adis16220.h
index 024313c..7cc4d2f 100644
--- a/drivers/staging/iio/accel/adis16220.h
+++ b/drivers/staging/iio/accel/adis16220.h
@@ -1,10 +1,9 @@
#ifndef SPI_ADIS16220_H_
#define SPI_ADIS16220_H_
-#define ADIS16220_STARTUP_DELAY 220 /* ms */
+#include "../imu/adis.h"
-#define ADIS16220_READ_REG(a) a
-#define ADIS16220_WRITE_REG(a) ((a) | 0x80)
+#define ADIS16220_STARTUP_DELAY 220 /* ms */
/* Flash memory write count */
#define ADIS16220_FLASH_CNT 0x00
@@ -102,15 +101,15 @@
#define ADIS16220_DIAG_STAT_FLASH_CHK (1<<6)
#define ADIS16220_DIAG_STAT_SELF_TEST (1<<5)
/* Capture period violation/interruption */
-#define ADIS16220_DIAG_STAT_VIOLATION (1<<4)
+#define ADIS16220_DIAG_STAT_VIOLATION_BIT 4
/* SPI communications failure */
-#define ADIS16220_DIAG_STAT_SPI_FAIL (1<<3)
+#define ADIS16220_DIAG_STAT_SPI_FAIL_BIT 3
/* Flash update failure */
-#define ADIS16220_DIAG_STAT_FLASH_UPT (1<<2)
+#define ADIS16220_DIAG_STAT_FLASH_UPT_BIT 2
/* Power supply above 3.625 V */
-#define ADIS16220_DIAG_STAT_POWER_HIGH (1<<1)
+#define ADIS16220_DIAG_STAT_POWER_HIGH_BIT 1
/* Power supply below 3.15 V */
-#define ADIS16220_DIAG_STAT_POWER_LOW (1<<0)
+#define ADIS16220_DIAG_STAT_POWER_LOW_BIT 0
/* GLOB_CMD */
#define ADIS16220_GLOB_CMD_SW_RESET (1<<7)
@@ -125,13 +124,14 @@
/**
* struct adis16220_state - device instance specific data
- * @us: actual spi_device
+ * @adis: adis device
* @tx: transmit buffer
* @rx: receive buffer
* @buf_lock: mutex to protect tx and rx
**/
struct adis16220_state {
- struct spi_device *us;
+ struct adis adis;
+
struct mutex buf_lock;
u8 tx[ADIS16220_MAX_TX] ____cacheline_aligned;
u8 rx[ADIS16220_MAX_RX];