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

Go to the source code of this file.

Data Structures

struct  sirfsoc_i2c
 

Macros

#define SIRFSOC_I2C_CLK_CTRL   0x00
 
#define SIRFSOC_I2C_STATUS   0x0C
 
#define SIRFSOC_I2C_CTRL   0x10
 
#define SIRFSOC_I2C_IO_CTRL   0x14
 
#define SIRFSOC_I2C_SDA_DELAY   0x18
 
#define SIRFSOC_I2C_CMD_START   0x1C
 
#define SIRFSOC_I2C_CMD_BUF   0x30
 
#define SIRFSOC_I2C_DATA_BUF   0x80
 
#define SIRFSOC_I2C_CMD_BUF_MAX   16
 
#define SIRFSOC_I2C_DATA_BUF_MAX   16
 
#define SIRFSOC_I2C_CMD(x)   (SIRFSOC_I2C_CMD_BUF + (x)*0x04)
 
#define SIRFSOC_I2C_DATA_MASK(x)   (0xFF<<(((x)&3)*8))
 
#define SIRFSOC_I2C_DATA_SHIFT(x)   (((x)&3)*8)
 
#define SIRFSOC_I2C_DIV_MASK   (0xFFFF)
 
#define SIRFSOC_I2C_STAT_BUSY   BIT(0)
 
#define SIRFSOC_I2C_STAT_TIP   BIT(1)
 
#define SIRFSOC_I2C_STAT_NACK   BIT(2)
 
#define SIRFSOC_I2C_STAT_TR_INT   BIT(4)
 
#define SIRFSOC_I2C_STAT_STOP   BIT(6)
 
#define SIRFSOC_I2C_STAT_CMD_DONE   BIT(8)
 
#define SIRFSOC_I2C_STAT_ERR   BIT(9)
 
#define SIRFSOC_I2C_CMD_INDEX   (0x1F<<16)
 
#define SIRFSOC_I2C_RESET   BIT(0)
 
#define SIRFSOC_I2C_CORE_EN   BIT(1)
 
#define SIRFSOC_I2C_MASTER_MODE   BIT(2)
 
#define SIRFSOC_I2C_CMD_DONE_EN   BIT(11)
 
#define SIRFSOC_I2C_ERR_INT_EN   BIT(12)
 
#define SIRFSOC_I2C_SDA_DELAY_MASK   (0xFF)
 
#define SIRFSOC_I2C_SCLF_FILTER   (3<<8)
 
#define SIRFSOC_I2C_START_CMD   BIT(0)
 
#define SIRFSOC_I2C_CMD_RP(x)   ((x)&0x7)
 
#define SIRFSOC_I2C_NACK   BIT(3)
 
#define SIRFSOC_I2C_WRITE   BIT(4)
 
#define SIRFSOC_I2C_READ   BIT(5)
 
#define SIRFSOC_I2C_STOP   BIT(6)
 
#define SIRFSOC_I2C_START   BIT(7)
 
#define SIRFSOC_I2C_DEFAULT_SPEED   100000
 

Functions

 MODULE_DEVICE_TABLE (of, sirfsoc_i2c_of_match)
 
 module_platform_driver (i2c_sirfsoc_driver)
 
 MODULE_DESCRIPTION ("SiRF SoC I2C master controller driver")
 
 MODULE_AUTHOR ("Zhiwu Song <[email protected]>, ""Xiangzhen Ye <[email protected]>")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define SIRFSOC_I2C_CLK_CTRL   0x00

Definition at line 19 of file i2c-sirf.c.

#define SIRFSOC_I2C_CMD (   x)    (SIRFSOC_I2C_CMD_BUF + (x)*0x04)

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

#define SIRFSOC_I2C_CMD_BUF   0x30

Definition at line 25 of file i2c-sirf.c.

#define SIRFSOC_I2C_CMD_BUF_MAX   16

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

#define SIRFSOC_I2C_CMD_DONE_EN   BIT(11)

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

#define SIRFSOC_I2C_CMD_INDEX   (0x1F<<16)

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

#define SIRFSOC_I2C_CMD_RP (   x)    ((x)&0x7)

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

#define SIRFSOC_I2C_CMD_START   0x1C

Definition at line 24 of file i2c-sirf.c.

#define SIRFSOC_I2C_CORE_EN   BIT(1)

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

#define SIRFSOC_I2C_CTRL   0x10

Definition at line 21 of file i2c-sirf.c.

#define SIRFSOC_I2C_DATA_BUF   0x80

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

#define SIRFSOC_I2C_DATA_BUF_MAX   16

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

#define SIRFSOC_I2C_DATA_MASK (   x)    (0xFF<<(((x)&3)*8))

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

#define SIRFSOC_I2C_DATA_SHIFT (   x)    (((x)&3)*8)

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

#define SIRFSOC_I2C_DEFAULT_SPEED   100000

Definition at line 66 of file i2c-sirf.c.

#define SIRFSOC_I2C_DIV_MASK   (0xFFFF)

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

#define SIRFSOC_I2C_ERR_INT_EN   BIT(12)

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

#define SIRFSOC_I2C_IO_CTRL   0x14

Definition at line 22 of file i2c-sirf.c.

#define SIRFSOC_I2C_MASTER_MODE   BIT(2)

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

#define SIRFSOC_I2C_NACK   BIT(3)

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

#define SIRFSOC_I2C_READ   BIT(5)

Definition at line 62 of file i2c-sirf.c.

#define SIRFSOC_I2C_RESET   BIT(0)

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

#define SIRFSOC_I2C_SCLF_FILTER   (3<<8)

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

#define SIRFSOC_I2C_SDA_DELAY   0x18

Definition at line 23 of file i2c-sirf.c.

#define SIRFSOC_I2C_SDA_DELAY_MASK   (0xFF)

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

#define SIRFSOC_I2C_START   BIT(7)

Definition at line 64 of file i2c-sirf.c.

#define SIRFSOC_I2C_START_CMD   BIT(0)

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

#define SIRFSOC_I2C_STAT_BUSY   BIT(0)

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

#define SIRFSOC_I2C_STAT_CMD_DONE   BIT(8)

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

#define SIRFSOC_I2C_STAT_ERR   BIT(9)

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

#define SIRFSOC_I2C_STAT_NACK   BIT(2)

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

#define SIRFSOC_I2C_STAT_STOP   BIT(6)

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

#define SIRFSOC_I2C_STAT_TIP   BIT(1)

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

#define SIRFSOC_I2C_STAT_TR_INT   BIT(4)

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

#define SIRFSOC_I2C_STATUS   0x0C

Definition at line 20 of file i2c-sirf.c.

#define SIRFSOC_I2C_STOP   BIT(6)

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

#define SIRFSOC_I2C_WRITE   BIT(4)

Definition at line 61 of file i2c-sirf.c.

Function Documentation

MODULE_AUTHOR ( "Zhiwu Song <[email protected] ,
""Xiangzhen Ye< Xiangzhen.Ye @csr.com >"   
)
MODULE_DESCRIPTION ( "SiRF SoC I2C master controller driver )
MODULE_DEVICE_TABLE ( of  ,
sirfsoc_i2c_of_match   
)
MODULE_LICENSE ( "GPL v2 )
module_platform_driver ( i2c_sirfsoc_driver  )