-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IIO: GYRO: IIO driver for Analog Devices Digital Output Gyroscope ADX…
…RS450 From: Cliff Cai <cliff.cai@analog.com> Add new IIO driver for Analog Devices digital output gyroscope ADXRS450 Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
- Loading branch information
Michael Hennerich
authored and
Greg Kroah-Hartman
committed
Apr 20, 2011
1 parent
d489463
commit 24742ac
Showing
4 changed files
with
517 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef SPI_ADXRS450_H_ | ||
#define SPI_ADXRS450_H_ | ||
|
||
#define ADXRS450_STARTUP_DELAY 50 /* ms */ | ||
|
||
/* The MSB for the spi commands */ | ||
#define ADXRS450_SENSOR_DATA 0x20 | ||
#define ADXRS450_WRITE_DATA 0x40 | ||
#define ADXRS450_READ_DATA 0x80 | ||
|
||
#define ADXRS450_RATE1 0x00 /* Rate Registers */ | ||
#define ADXRS450_TEMP1 0x02 /* Temperature Registers */ | ||
#define ADXRS450_LOCST1 0x04 /* Low CST Memory Registers */ | ||
#define ADXRS450_HICST1 0x06 /* High CST Memory Registers */ | ||
#define ADXRS450_QUAD1 0x08 /* Quad Memory Registers */ | ||
#define ADXRS450_FAULT1 0x0A /* Fault Registers */ | ||
#define ADXRS450_PID1 0x0C /* Part ID Register 1 */ | ||
#define ADXRS450_SNH 0x0E /* Serial Number Registers, 4 bytes */ | ||
#define ADXRS450_SNL 0x10 | ||
#define ADXRS450_DNC1 0x12 /* Dynamic Null Correction Registers */ | ||
/* Check bits */ | ||
#define ADXRS450_P 0x01 | ||
#define ADXRS450_CHK 0x02 | ||
#define ADXRS450_CST 0x04 | ||
#define ADXRS450_PWR 0x08 | ||
#define ADXRS450_POR 0x10 | ||
#define ADXRS450_NVM 0x20 | ||
#define ADXRS450_Q 0x40 | ||
#define ADXRS450_PLL 0x80 | ||
#define ADXRS450_UV 0x100 | ||
#define ADXRS450_OV 0x200 | ||
#define ADXRS450_AMP 0x400 | ||
#define ADXRS450_FAIL 0x800 | ||
|
||
#define ADXRS450_WRERR_MASK (0x7 << 29) | ||
|
||
#define ADXRS450_MAX_RX 4 | ||
#define ADXRS450_MAX_TX 4 | ||
|
||
#define ADXRS450_GET_ST(a) ((a >> 26) & 0x3) | ||
|
||
/** | ||
* struct adxrs450_state - device instance specific data | ||
* @us: actual spi_device | ||
* @indio_dev: industrial I/O device structure | ||
* @tx: transmit buffer | ||
* @rx: recieve buffer | ||
* @buf_lock: mutex to protect tx and rx | ||
**/ | ||
struct adxrs450_state { | ||
struct spi_device *us; | ||
struct iio_dev *indio_dev; | ||
u8 *tx; | ||
u8 *rx; | ||
struct mutex buf_lock; | ||
}; | ||
|
||
#endif /* SPI_ADXRS450_H_ */ |
Oops, something went wrong.