Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249095
b: refs/heads/master
c: 24742ac
h: refs/heads/master
i:
  249093: 4eea58f
  249091: 47833ed
  249087: c9f126e
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Apr 20, 2011
1 parent b4f35d6 commit a23543d
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d48946357bad923eb6098e272c3eea8286f4c9b7
refs/heads/master: 24742ac69249500f650fd72cf0755932c5a4c247
10 changes: 10 additions & 0 deletions trunk/drivers/staging/iio/gyro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ config ADIS16260

This driver can also be built as a module. If so, the module
will be called adis16260.

config ADXRS450
tristate "Analog Devices ADXRS450 Digital Output Gyroscope SPI driver"
depends on SPI
help
Say yes here to build support for Analog Devices ADXRS450 programmable
digital output gyroscope.

This driver can also be built as a module. If so, the module
will be called adxrs450.
3 changes: 3 additions & 0 deletions trunk/drivers/staging/iio/gyro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ obj-$(CONFIG_ADIS16260) += adis16260.o

adis16251-y := adis16251_core.o
obj-$(CONFIG_ADIS16251) += adis16251.o

adxrs450-y := adxrs450_core.o
obj-$(CONFIG_ADXRS450) += adxrs450.o
58 changes: 58 additions & 0 deletions trunk/drivers/staging/iio/gyro/adxrs450.h
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_ */
Loading

0 comments on commit a23543d

Please sign in to comment.