Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
i2c-mv64xxx.c File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mv643xx_i2c.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_i2c.h>
#include <linux/clk.h>
#include <linux/err.h>

Go to the source code of this file.

Data Structures

struct  mv64xxx_i2c_data
 

Macros

#define MV64XXX_I2C_REG_SLAVE_ADDR   0x00
 
#define MV64XXX_I2C_REG_DATA   0x04
 
#define MV64XXX_I2C_REG_CONTROL   0x08
 
#define MV64XXX_I2C_REG_STATUS   0x0c
 
#define MV64XXX_I2C_REG_BAUD   0x0c
 
#define MV64XXX_I2C_REG_EXT_SLAVE_ADDR   0x10
 
#define MV64XXX_I2C_REG_SOFT_RESET   0x1c
 
#define MV64XXX_I2C_REG_CONTROL_ACK   0x00000004
 
#define MV64XXX_I2C_REG_CONTROL_IFLG   0x00000008
 
#define MV64XXX_I2C_REG_CONTROL_STOP   0x00000010
 
#define MV64XXX_I2C_REG_CONTROL_START   0x00000020
 
#define MV64XXX_I2C_REG_CONTROL_TWSIEN   0x00000040
 
#define MV64XXX_I2C_REG_CONTROL_INTEN   0x00000080
 
#define MV64XXX_I2C_STATUS_BUS_ERR   0x00
 
#define MV64XXX_I2C_STATUS_MAST_START   0x08
 
#define MV64XXX_I2C_STATUS_MAST_REPEAT_START   0x10
 
#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_ACK   0x18
 
#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_NO_ACK   0x20
 
#define MV64XXX_I2C_STATUS_MAST_WR_ACK   0x28
 
#define MV64XXX_I2C_STATUS_MAST_WR_NO_ACK   0x30
 
#define MV64XXX_I2C_STATUS_MAST_LOST_ARB   0x38
 
#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_ACK   0x40
 
#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_NO_ACK   0x48
 
#define MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK   0x50
 
#define MV64XXX_I2C_STATUS_MAST_RD_DATA_NO_ACK   0x58
 
#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK   0xd0
 
#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_NO_ACK   0xd8
 
#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_ACK   0xe0
 
#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_NO_ACK   0xe8
 
#define MV64XXX_I2C_STATUS_NO_STATUS   0xf8
 

Enumerations

enum  {
  MV64XXX_I2C_STATE_INVALID, MV64XXX_I2C_STATE_IDLE, MV64XXX_I2C_STATE_WAITING_FOR_START_COND, MV64XXX_I2C_STATE_WAITING_FOR_RESTART,
  MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK, MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK, MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK, MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA
}
 
enum  {
  MV64XXX_I2C_ACTION_INVALID, MV64XXX_I2C_ACTION_CONTINUE, MV64XXX_I2C_ACTION_SEND_START, MV64XXX_I2C_ACTION_SEND_RESTART,
  MV64XXX_I2C_ACTION_SEND_ADDR_1, MV64XXX_I2C_ACTION_SEND_ADDR_2, MV64XXX_I2C_ACTION_SEND_DATA, MV64XXX_I2C_ACTION_RCV_DATA,
  MV64XXX_I2C_ACTION_RCV_DATA_STOP, MV64XXX_I2C_ACTION_SEND_STOP
}
 

Functions

 MODULE_DEVICE_TABLE (of, mv64xxx_i2c_of_match_table)
 
 module_platform_driver (mv64xxx_i2c_driver)
 
 MODULE_AUTHOR ("Mark A. Greer <[email protected]>")
 
 MODULE_DESCRIPTION ("Marvell mv64xxx host bridge i2c ctlr driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define MV64XXX_I2C_REG_BAUD   0x0c

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

#define MV64XXX_I2C_REG_CONTROL   0x08

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

#define MV64XXX_I2C_REG_CONTROL_ACK   0x00000004

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

#define MV64XXX_I2C_REG_CONTROL_IFLG   0x00000008

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

#define MV64XXX_I2C_REG_CONTROL_INTEN   0x00000080

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

#define MV64XXX_I2C_REG_CONTROL_START   0x00000020

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

#define MV64XXX_I2C_REG_CONTROL_STOP   0x00000010

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

#define MV64XXX_I2C_REG_CONTROL_TWSIEN   0x00000040

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

#define MV64XXX_I2C_REG_DATA   0x04

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

#define MV64XXX_I2C_REG_EXT_SLAVE_ADDR   0x10

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

#define MV64XXX_I2C_REG_SLAVE_ADDR   0x00

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

#define MV64XXX_I2C_REG_SOFT_RESET   0x1c

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

#define MV64XXX_I2C_REG_STATUS   0x0c

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

#define MV64XXX_I2C_STATUS_BUS_ERR   0x00

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

#define MV64XXX_I2C_STATUS_MAST_LOST_ARB   0x38

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

#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_ACK   0xe0

Definition at line 58 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_2_NO_ACK   0xe8

Definition at line 59 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_ACK   0x40

Definition at line 52 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_RD_ADDR_NO_ACK   0x48

Definition at line 53 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_RD_DATA_ACK   0x50

Definition at line 54 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_RD_DATA_NO_ACK   0x58

Definition at line 55 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_REPEAT_START   0x10

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

#define MV64XXX_I2C_STATUS_MAST_START   0x08

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

#define MV64XXX_I2C_STATUS_MAST_WR_ACK   0x28

Definition at line 49 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK   0xd0

Definition at line 56 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_NO_ACK   0xd8

Definition at line 57 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_ACK   0x18

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

#define MV64XXX_I2C_STATUS_MAST_WR_ADDR_NO_ACK   0x20

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

#define MV64XXX_I2C_STATUS_MAST_WR_NO_ACK   0x30

Definition at line 50 of file i2c-mv64xxx.c.

#define MV64XXX_I2C_STATUS_NO_STATUS   0xf8

Definition at line 60 of file i2c-mv64xxx.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MV64XXX_I2C_STATE_INVALID 
MV64XXX_I2C_STATE_IDLE 
MV64XXX_I2C_STATE_WAITING_FOR_START_COND 
MV64XXX_I2C_STATE_WAITING_FOR_RESTART 
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK 
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK 
MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK 
MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA 

Definition at line 63 of file i2c-mv64xxx.c.

anonymous enum
Enumerator:
MV64XXX_I2C_ACTION_INVALID 
MV64XXX_I2C_ACTION_CONTINUE 
MV64XXX_I2C_ACTION_SEND_START 
MV64XXX_I2C_ACTION_SEND_RESTART 
MV64XXX_I2C_ACTION_SEND_ADDR_1 
MV64XXX_I2C_ACTION_SEND_ADDR_2 
MV64XXX_I2C_ACTION_SEND_DATA 
MV64XXX_I2C_ACTION_RCV_DATA 
MV64XXX_I2C_ACTION_RCV_DATA_STOP 
MV64XXX_I2C_ACTION_SEND_STOP 

Definition at line 75 of file i2c-mv64xxx.c.

Function Documentation

MODULE_AUTHOR ( "Mark A. Greer <[email protected]>"  )
MODULE_DESCRIPTION ( "Marvell mv64xxx host bridge i2c ctlr driver )
MODULE_DEVICE_TABLE ( of  ,
mv64xxx_i2c_of_match_table   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( mv64xxx_i2c_driver  )