Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
kxsd9.c File Reference
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/sysfs.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  kxsd9_state
 

Macros

#define KXSD9_REG_X   0x00
 
#define KXSD9_REG_Y   0x02
 
#define KXSD9_REG_Z   0x04
 
#define KXSD9_REG_AUX   0x06
 
#define KXSD9_REG_RESET   0x0a
 
#define KXSD9_REG_CTRL_C   0x0c
 
#define KXSD9_FS_MASK   0x03
 
#define KXSD9_REG_CTRL_B   0x0d
 
#define KXSD9_REG_CTRL_A   0x0e
 
#define KXSD9_READ(a)   (0x80 | (a))
 
#define KXSD9_WRITE(a)   (a)
 
#define KXSD9_STATE_RX_SIZE   2
 
#define KXSD9_STATE_TX_SIZE   2
 
#define KXSD9_SCALE_2G   "0.011978"
 
#define KXSD9_SCALE_4G   "0.023927"
 
#define KXSD9_SCALE_6G   "0.035934"
 
#define KXSD9_SCALE_8G   "0.047853"
 
#define KXSD9_ACCEL_CHAN(axis)
 

Functions

 MODULE_DEVICE_TABLE (spi, kxsd9_id)
 
 module_spi_driver (kxsd9_driver)
 
 MODULE_AUTHOR ("Jonathan Cameron <[email protected]>")
 
 MODULE_DESCRIPTION ("Kionix KXSD9 SPI driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define KXSD9_ACCEL_CHAN (   axis)
Value:
{ \
.type = IIO_ACCEL, \
.modified = 1, \
.channel2 = IIO_MOD_##axis, \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = KXSD9_REG_##axis, \
}

Definition at line 179 of file kxsd9.c.

#define KXSD9_FS_MASK   0x03

Definition at line 36 of file kxsd9.c.

#define KXSD9_READ (   a)    (0x80 | (a))

Definition at line 41 of file kxsd9.c.

#define KXSD9_REG_AUX   0x06

Definition at line 32 of file kxsd9.c.

#define KXSD9_REG_CTRL_A   0x0e

Definition at line 39 of file kxsd9.c.

#define KXSD9_REG_CTRL_B   0x0d

Definition at line 38 of file kxsd9.c.

#define KXSD9_REG_CTRL_C   0x0c

Definition at line 34 of file kxsd9.c.

#define KXSD9_REG_RESET   0x0a

Definition at line 33 of file kxsd9.c.

#define KXSD9_REG_X   0x00

Definition at line 29 of file kxsd9.c.

#define KXSD9_REG_Y   0x02

Definition at line 30 of file kxsd9.c.

#define KXSD9_REG_Z   0x04

Definition at line 31 of file kxsd9.c.

#define KXSD9_SCALE_2G   "0.011978"

Definition at line 60 of file kxsd9.c.

#define KXSD9_SCALE_4G   "0.023927"

Definition at line 61 of file kxsd9.c.

#define KXSD9_SCALE_6G   "0.035934"

Definition at line 62 of file kxsd9.c.

#define KXSD9_SCALE_8G   "0.047853"

Definition at line 63 of file kxsd9.c.

#define KXSD9_STATE_RX_SIZE   2

Definition at line 44 of file kxsd9.c.

#define KXSD9_STATE_TX_SIZE   2

Definition at line 45 of file kxsd9.c.

#define KXSD9_WRITE (   a)    (a)

Definition at line 42 of file kxsd9.c.

Function Documentation

MODULE_AUTHOR ( "Jonathan Cameron <[email protected]>"  )
MODULE_DESCRIPTION ( "Kionix KXSD9 SPI driver )
MODULE_DEVICE_TABLE ( spi  ,
kxsd9_id   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( kxsd9_driver  )