Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
ams-i2c.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/delay.h>
#include "ams.h"

Go to the source code of this file.

Macros

#define AMS_COMMAND   0x00 /* command register */
 
#define AMS_STATUS   0x01 /* status register */
 
#define AMS_CTRL1   0x02 /* read control 1 (number of values) */
 
#define AMS_CTRL2   0x03 /* read control 2 (offset?) */
 
#define AMS_CTRL3   0x04 /* read control 3 (size of each value?) */
 
#define AMS_DATA1   0x05 /* read data 1 */
 
#define AMS_DATA2   0x06 /* read data 2 */
 
#define AMS_DATA3   0x07 /* read data 3 */
 
#define AMS_DATA4   0x08 /* read data 4 */
 
#define AMS_DATAX   0x20 /* data X */
 
#define AMS_DATAY   0x21 /* data Y */
 
#define AMS_DATAZ   0x22 /* data Z */
 
#define AMS_FREEFALL   0x24 /* freefall int control */
 
#define AMS_SHOCK   0x25 /* shock int control */
 
#define AMS_SENSLOW   0x26 /* sensitivity low limit */
 
#define AMS_SENSHIGH   0x27 /* sensitivity high limit */
 
#define AMS_CTRLX   0x28 /* control X */
 
#define AMS_CTRLY   0x29 /* control Y */
 
#define AMS_CTRLZ   0x2A /* control Z */
 
#define AMS_UNKNOWN1   0x2B /* unknown 1 */
 
#define AMS_UNKNOWN2   0x2C /* unknown 2 */
 
#define AMS_UNKNOWN3   0x2D /* unknown 3 */
 
#define AMS_VENDOR   0x2E /* vendor */
 

Enumerations

enum  ams_i2c_cmd {
  AMS_CMD_NOOP = 0, AMS_CMD_VERSION, AMS_CMD_READMEM, AMS_CMD_WRITEMEM,
  AMS_CMD_ERASEMEM, AMS_CMD_READEE, AMS_CMD_WRITEEE, AMS_CMD_RESET,
  AMS_CMD_START
}
 

Functions

 MODULE_DEVICE_TABLE (i2c, ams_id)
 
int __init ams_i2c_init (struct device_node *np)
 

Macro Definition Documentation

#define AMS_COMMAND   0x00 /* command register */

Definition at line 26 of file ams-i2c.c.

#define AMS_CTRL1   0x02 /* read control 1 (number of values) */

Definition at line 28 of file ams-i2c.c.

#define AMS_CTRL2   0x03 /* read control 2 (offset?) */

Definition at line 29 of file ams-i2c.c.

#define AMS_CTRL3   0x04 /* read control 3 (size of each value?) */

Definition at line 30 of file ams-i2c.c.

#define AMS_CTRLX   0x28 /* control X */

Definition at line 42 of file ams-i2c.c.

#define AMS_CTRLY   0x29 /* control Y */

Definition at line 43 of file ams-i2c.c.

#define AMS_CTRLZ   0x2A /* control Z */

Definition at line 44 of file ams-i2c.c.

#define AMS_DATA1   0x05 /* read data 1 */

Definition at line 31 of file ams-i2c.c.

#define AMS_DATA2   0x06 /* read data 2 */

Definition at line 32 of file ams-i2c.c.

#define AMS_DATA3   0x07 /* read data 3 */

Definition at line 33 of file ams-i2c.c.

#define AMS_DATA4   0x08 /* read data 4 */

Definition at line 34 of file ams-i2c.c.

#define AMS_DATAX   0x20 /* data X */

Definition at line 35 of file ams-i2c.c.

#define AMS_DATAY   0x21 /* data Y */

Definition at line 36 of file ams-i2c.c.

#define AMS_DATAZ   0x22 /* data Z */

Definition at line 37 of file ams-i2c.c.

#define AMS_FREEFALL   0x24 /* freefall int control */

Definition at line 38 of file ams-i2c.c.

#define AMS_SENSHIGH   0x27 /* sensitivity high limit */

Definition at line 41 of file ams-i2c.c.

#define AMS_SENSLOW   0x26 /* sensitivity low limit */

Definition at line 40 of file ams-i2c.c.

#define AMS_SHOCK   0x25 /* shock int control */

Definition at line 39 of file ams-i2c.c.

#define AMS_STATUS   0x01 /* status register */

Definition at line 27 of file ams-i2c.c.

#define AMS_UNKNOWN1   0x2B /* unknown 1 */

Definition at line 45 of file ams-i2c.c.

#define AMS_UNKNOWN2   0x2C /* unknown 2 */

Definition at line 46 of file ams-i2c.c.

#define AMS_UNKNOWN3   0x2D /* unknown 3 */

Definition at line 47 of file ams-i2c.c.

#define AMS_VENDOR   0x2E /* vendor */

Definition at line 48 of file ams-i2c.c.

Enumeration Type Documentation

Enumerator:
AMS_CMD_NOOP 
AMS_CMD_VERSION 
AMS_CMD_READMEM 
AMS_CMD_WRITEMEM 
AMS_CMD_ERASEMEM 
AMS_CMD_READEE 
AMS_CMD_WRITEEE 
AMS_CMD_RESET 
AMS_CMD_START 

Definition at line 51 of file ams-i2c.c.

Function Documentation

int __init ams_i2c_init ( struct device_node np)

Definition at line 262 of file ams-i2c.c.

MODULE_DEVICE_TABLE ( i2c  ,
ams_id   
)