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

Go to the source code of this file.

Macros

#define I2C_PNX_TIMEOUT_DEFAULT   10 /* msec */
 
#define I2C_PNX_SPEED_KHZ_DEFAULT   100
 
#define I2C_PNX_REGION_SIZE   0x100
 
#define I2C_REG_RX(a)   ((a)->ioaddr) /* Rx FIFO reg (RO) */
 
#define I2C_REG_TX(a)   ((a)->ioaddr) /* Tx FIFO reg (WO) */
 
#define I2C_REG_STS(a)   ((a)->ioaddr + 0x04) /* Status reg (RO) */
 
#define I2C_REG_CTL(a)   ((a)->ioaddr + 0x08) /* Ctl reg */
 
#define I2C_REG_CKL(a)   ((a)->ioaddr + 0x0c) /* Clock divider low */
 
#define I2C_REG_CKH(a)   ((a)->ioaddr + 0x10) /* Clock divider high */
 
#define I2C_REG_ADR(a)   ((a)->ioaddr + 0x14) /* I2C address */
 
#define I2C_REG_RFL(a)   ((a)->ioaddr + 0x18) /* Rx FIFO level (RO) */
 
#define I2C_REG_TFL(a)   ((a)->ioaddr + 0x1c) /* Tx FIFO level (RO) */
 
#define I2C_REG_RXB(a)   ((a)->ioaddr + 0x20) /* Num of bytes Rx-ed (RO) */
 
#define I2C_REG_TXB(a)   ((a)->ioaddr + 0x24) /* Num of bytes Tx-ed (RO) */
 
#define I2C_REG_TXS(a)   ((a)->ioaddr + 0x28) /* Tx slave FIFO (RO) */
 
#define I2C_REG_STFL(a)   ((a)->ioaddr + 0x2c) /* Tx slave FIFO level (RO) */
 
#define PNX_I2C_PM   NULL
 

Enumerations

enum  {
  mstatus_tdi = 0x00000001, mstatus_afi = 0x00000002, mstatus_nai = 0x00000004, mstatus_drmi = 0x00000008,
  mstatus_active = 0x00000020, mstatus_scl = 0x00000040, mstatus_sda = 0x00000080, mstatus_rff = 0x00000100,
  mstatus_rfe = 0x00000200, mstatus_tff = 0x00000400, mstatus_tfe = 0x00000800
}
 
enum  {
  mcntrl_tdie = 0x00000001, mcntrl_afie = 0x00000002, mcntrl_naie = 0x00000004, mcntrl_drmie = 0x00000008,
  mcntrl_drsie = 0x00000010, mcntrl_rffie = 0x00000020, mcntrl_daie = 0x00000040, mcntrl_tffie = 0x00000080,
  mcntrl_reset = 0x00000100, mcntrl_cdbmode = 0x00000400
}
 
enum  { rw_bit = 1 << 0, start_bit = 1 << 8, stop_bit = 1 << 9 }
 

Functions

 MODULE_AUTHOR ("Vitaly Wool, Dennis Kovalev <source@mvista.com>")
 
 MODULE_DESCRIPTION ("I2C driver for Philips IP3204-based I2C busses")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:pnx-i2c")
 
 subsys_initcall (i2c_adap_pnx_init)
 
 module_exit (i2c_adap_pnx_exit)
 

Macro Definition Documentation

#define I2C_PNX_REGION_SIZE   0x100

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

#define I2C_PNX_SPEED_KHZ_DEFAULT   100

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

#define I2C_PNX_TIMEOUT_DEFAULT   10 /* msec */

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

#define I2C_REG_ADR (   a)    ((a)->ioaddr + 0x14) /* I2C address */

Definition at line 71 of file i2c-pnx.c.

#define I2C_REG_CKH (   a)    ((a)->ioaddr + 0x10) /* Clock divider high */

Definition at line 70 of file i2c-pnx.c.

#define I2C_REG_CKL (   a)    ((a)->ioaddr + 0x0c) /* Clock divider low */

Definition at line 69 of file i2c-pnx.c.

#define I2C_REG_CTL (   a)    ((a)->ioaddr + 0x08) /* Ctl reg */

Definition at line 68 of file i2c-pnx.c.

#define I2C_REG_RFL (   a)    ((a)->ioaddr + 0x18) /* Rx FIFO level (RO) */

Definition at line 72 of file i2c-pnx.c.

#define I2C_REG_RX (   a)    ((a)->ioaddr) /* Rx FIFO reg (RO) */

Definition at line 65 of file i2c-pnx.c.

#define I2C_REG_RXB (   a)    ((a)->ioaddr + 0x20) /* Num of bytes Rx-ed (RO) */

Definition at line 74 of file i2c-pnx.c.

#define I2C_REG_STFL (   a)    ((a)->ioaddr + 0x2c) /* Tx slave FIFO level (RO) */

Definition at line 77 of file i2c-pnx.c.

#define I2C_REG_STS (   a)    ((a)->ioaddr + 0x04) /* Status reg (RO) */

Definition at line 67 of file i2c-pnx.c.

#define I2C_REG_TFL (   a)    ((a)->ioaddr + 0x1c) /* Tx FIFO level (RO) */

Definition at line 73 of file i2c-pnx.c.

#define I2C_REG_TX (   a)    ((a)->ioaddr) /* Tx FIFO reg (WO) */

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

#define I2C_REG_TXB (   a)    ((a)->ioaddr + 0x24) /* Num of bytes Tx-ed (RO) */

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

#define I2C_REG_TXS (   a)    ((a)->ioaddr + 0x28) /* Tx slave FIFO (RO) */

Definition at line 76 of file i2c-pnx.c.

#define PNX_I2C_PM   NULL

Definition at line 619 of file i2c-pnx.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
mstatus_tdi 
mstatus_afi 
mstatus_nai 
mstatus_drmi 
mstatus_active 
mstatus_scl 
mstatus_sda 
mstatus_rff 
mstatus_rfe 
mstatus_tff 
mstatus_tfe 

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

anonymous enum
Enumerator:
mcntrl_tdie 
mcntrl_afie 
mcntrl_naie 
mcntrl_drmie 
mcntrl_drsie 
mcntrl_rffie 
mcntrl_daie 
mcntrl_tffie 
mcntrl_reset 
mcntrl_cdbmode 

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

anonymous enum
Enumerator:
rw_bit 
start_bit 
stop_bit 

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

Function Documentation

MODULE_ALIAS ( "platform:pnx-i2c"  )
MODULE_AUTHOR ( "Vitaly  Wool,
Dennis Kovalev< source @mvista.com >"   
)
MODULE_DESCRIPTION ( "I2C driver for Philips IP3204-based I2C busses"  )
module_exit ( i2c_adap_pnx_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( i2c_adap_pnx_init  )