Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cma3000_d0x.c File Reference
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/input/cma3000.h>
#include <linux/module.h>
#include "cma3000_d0x.h"

Go to the source code of this file.

Data Structures

struct  cma3000_accl_data
 

Macros

#define CMA3000_WHOAMI   0x00
 
#define CMA3000_REVID   0x01
 
#define CMA3000_CTRL   0x02
 
#define CMA3000_STATUS   0x03
 
#define CMA3000_RSTR   0x04
 
#define CMA3000_INTSTATUS   0x05
 
#define CMA3000_DOUTX   0x06
 
#define CMA3000_DOUTY   0x07
 
#define CMA3000_DOUTZ   0x08
 
#define CMA3000_MDTHR   0x09
 
#define CMA3000_MDFFTMR   0x0A
 
#define CMA3000_FFTHR   0x0B
 
#define CMA3000_RANGE2G   (1 << 7)
 
#define CMA3000_RANGE8G   (0 << 7)
 
#define CMA3000_BUSI2C   (0 << 4)
 
#define CMA3000_MODEMASK   (7 << 1)
 
#define CMA3000_GRANGEMASK   (1 << 7)
 
#define CMA3000_STATUS_PERR   1
 
#define CMA3000_INTSTATUS_FFDET   (1 << 2)
 
#define CMA3000_SETDELAY   30
 
#define CMA3000_INTDELAY   44
 
#define BIT_TO_2G   18
 
#define BIT_TO_8G   71
 
#define CMA3000_READ(data, reg, msg)   (data->bus_ops->read(data->dev, reg, msg))
 
#define CMA3000_SET(data, reg, val, msg)   ((data)->bus_ops->write(data->dev, reg, val, msg))
 

Functions

void cma3000_suspend (struct cma3000_accl_data *data)
 
 EXPORT_SYMBOL (cma3000_suspend)
 
void cma3000_resume (struct cma3000_accl_data *data)
 
 EXPORT_SYMBOL (cma3000_resume)
 
struct cma3000_accl_datacma3000_init (struct device *dev, int irq, const struct cma3000_bus_ops *bops)
 
 EXPORT_SYMBOL (cma3000_init)
 
void cma3000_exit (struct cma3000_accl_data *data)
 
 EXPORT_SYMBOL (cma3000_exit)
 
 MODULE_DESCRIPTION ("CMA3000-D0x Accelerometer Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Hemanth V <[email protected]>")
 

Macro Definition Documentation

#define BIT_TO_2G   18

Definition at line 63 of file cma3000_d0x.c.

#define BIT_TO_8G   71

Definition at line 64 of file cma3000_d0x.c.

#define CMA3000_BUSI2C   (0 << 4)

Definition at line 45 of file cma3000_d0x.c.

#define CMA3000_CTRL   0x02

Definition at line 32 of file cma3000_d0x.c.

#define CMA3000_DOUTX   0x06

Definition at line 36 of file cma3000_d0x.c.

#define CMA3000_DOUTY   0x07

Definition at line 37 of file cma3000_d0x.c.

#define CMA3000_DOUTZ   0x08

Definition at line 38 of file cma3000_d0x.c.

#define CMA3000_FFTHR   0x0B

Definition at line 41 of file cma3000_d0x.c.

#define CMA3000_GRANGEMASK   (1 << 7)

Definition at line 47 of file cma3000_d0x.c.

#define CMA3000_INTDELAY   44

Definition at line 56 of file cma3000_d0x.c.

#define CMA3000_INTSTATUS   0x05

Definition at line 35 of file cma3000_d0x.c.

#define CMA3000_INTSTATUS_FFDET   (1 << 2)

Definition at line 50 of file cma3000_d0x.c.

#define CMA3000_MDFFTMR   0x0A

Definition at line 40 of file cma3000_d0x.c.

#define CMA3000_MDTHR   0x09

Definition at line 39 of file cma3000_d0x.c.

#define CMA3000_MODEMASK   (7 << 1)

Definition at line 46 of file cma3000_d0x.c.

#define CMA3000_RANGE2G   (1 << 7)

Definition at line 43 of file cma3000_d0x.c.

#define CMA3000_RANGE8G   (0 << 7)

Definition at line 44 of file cma3000_d0x.c.

#define CMA3000_READ (   data,
  reg,
  msg 
)    (data->bus_ops->read(data->dev, reg, msg))

Definition at line 84 of file cma3000_d0x.c.

#define CMA3000_REVID   0x01

Definition at line 31 of file cma3000_d0x.c.

#define CMA3000_RSTR   0x04

Definition at line 34 of file cma3000_d0x.c.

#define CMA3000_SET (   data,
  reg,
  val,
  msg 
)    ((data)->bus_ops->write(data->dev, reg, val, msg))

Definition at line 86 of file cma3000_d0x.c.

#define CMA3000_SETDELAY   30

Definition at line 53 of file cma3000_d0x.c.

#define CMA3000_STATUS   0x03

Definition at line 33 of file cma3000_d0x.c.

#define CMA3000_STATUS_PERR   1

Definition at line 49 of file cma3000_d0x.c.

#define CMA3000_WHOAMI   0x00

Definition at line 30 of file cma3000_d0x.c.

Function Documentation

void cma3000_exit ( struct cma3000_accl_data data)

Definition at line 389 of file cma3000_d0x.c.

struct cma3000_accl_data* cma3000_init ( struct device dev,
int  irq,
const struct cma3000_bus_ops bops 
)
read

Definition at line 284 of file cma3000_d0x.c.

void cma3000_resume ( struct cma3000_accl_data data)

Definition at line 271 of file cma3000_d0x.c.

void cma3000_suspend ( struct cma3000_accl_data data)

Definition at line 257 of file cma3000_d0x.c.

EXPORT_SYMBOL ( cma3000_suspend  )
EXPORT_SYMBOL ( cma3000_resume  )
EXPORT_SYMBOL ( cma3000_init  )
EXPORT_SYMBOL ( cma3000_exit  )
MODULE_AUTHOR ( "Hemanth V <[email protected]>"  )
MODULE_DESCRIPTION ( "CMA3000-D0x Accelerometer Driver"  )
MODULE_LICENSE ( "GPL"  )