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

Go to the source code of this file.

Data Structures

struct  omap_i2c_dev
 

Macros

#define OMAP_I2C_OMAP1_REV_2   0x20
 
#define OMAP_I2C_REV_ON_2430   0x36
 
#define OMAP_I2C_REV_ON_3430_3530   0x3C
 
#define OMAP_I2C_REV_ON_3630_4430   0x40
 
#define OMAP_I2C_TIMEOUT   (msecs_to_jiffies(1000))
 
#define OMAP_I2C_PM_TIMEOUT   1000 /* ms */
 
#define OMAP_I2C_IE_XDR   (1 << 14) /* TX Buffer drain int enable */
 
#define OMAP_I2C_IE_RDR   (1 << 13) /* RX Buffer drain int enable */
 
#define OMAP_I2C_IE_XRDY   (1 << 4) /* TX data ready int enable */
 
#define OMAP_I2C_IE_RRDY   (1 << 3) /* RX data ready int enable */
 
#define OMAP_I2C_IE_ARDY   (1 << 2) /* Access ready int enable */
 
#define OMAP_I2C_IE_NACK   (1 << 1) /* No ack interrupt enable */
 
#define OMAP_I2C_IE_AL   (1 << 0) /* Arbitration lost int ena */
 
#define OMAP_I2C_STAT_XDR   (1 << 14) /* TX Buffer draining */
 
#define OMAP_I2C_STAT_RDR   (1 << 13) /* RX Buffer draining */
 
#define OMAP_I2C_STAT_BB   (1 << 12) /* Bus busy */
 
#define OMAP_I2C_STAT_ROVR   (1 << 11) /* Receive overrun */
 
#define OMAP_I2C_STAT_XUDF   (1 << 10) /* Transmit underflow */
 
#define OMAP_I2C_STAT_AAS   (1 << 9) /* Address as slave */
 
#define OMAP_I2C_STAT_AD0   (1 << 8) /* Address zero */
 
#define OMAP_I2C_STAT_XRDY   (1 << 4) /* Transmit data ready */
 
#define OMAP_I2C_STAT_RRDY   (1 << 3) /* Receive data ready */
 
#define OMAP_I2C_STAT_ARDY   (1 << 2) /* Register access ready */
 
#define OMAP_I2C_STAT_NACK   (1 << 1) /* No ack interrupt enable */
 
#define OMAP_I2C_STAT_AL   (1 << 0) /* Arbitration lost int ena */
 
#define OMAP_I2C_WE_XDR_WE   (1 << 14) /* TX drain wakup */
 
#define OMAP_I2C_WE_RDR_WE   (1 << 13) /* RX drain wakeup */
 
#define OMAP_I2C_WE_AAS_WE   (1 << 9) /* Address as slave wakeup*/
 
#define OMAP_I2C_WE_BF_WE   (1 << 8) /* Bus free wakeup */
 
#define OMAP_I2C_WE_STC_WE   (1 << 6) /* Start condition wakeup */
 
#define OMAP_I2C_WE_GC_WE   (1 << 5) /* General call wakeup */
 
#define OMAP_I2C_WE_DRDY_WE   (1 << 3) /* TX/RX data ready wakeup */
 
#define OMAP_I2C_WE_ARDY_WE   (1 << 2) /* Reg access ready wakeup */
 
#define OMAP_I2C_WE_NACK_WE   (1 << 1) /* No acknowledgment wakeup */
 
#define OMAP_I2C_WE_AL_WE   (1 << 0) /* Arbitration lost wakeup */
 
#define OMAP_I2C_WE_ALL
 
#define OMAP_I2C_BUF_RDMA_EN   (1 << 15) /* RX DMA channel enable */
 
#define OMAP_I2C_BUF_RXFIF_CLR   (1 << 14) /* RX FIFO Clear */
 
#define OMAP_I2C_BUF_XDMA_EN   (1 << 7) /* TX DMA channel enable */
 
#define OMAP_I2C_BUF_TXFIF_CLR   (1 << 6) /* TX FIFO Clear */
 
#define OMAP_I2C_CON_EN   (1 << 15) /* I2C module enable */
 
#define OMAP_I2C_CON_BE   (1 << 14) /* Big endian mode */
 
#define OMAP_I2C_CON_OPMODE_HS   (1 << 12) /* High Speed support */
 
#define OMAP_I2C_CON_STB   (1 << 11) /* Start byte mode (master) */
 
#define OMAP_I2C_CON_MST   (1 << 10) /* Master/slave mode */
 
#define OMAP_I2C_CON_TRX   (1 << 9) /* TX/RX mode (master only) */
 
#define OMAP_I2C_CON_XA   (1 << 8) /* Expand address */
 
#define OMAP_I2C_CON_RM   (1 << 2) /* Repeat mode (master only) */
 
#define OMAP_I2C_CON_STP   (1 << 1) /* Stop cond (master only) */
 
#define OMAP_I2C_CON_STT   (1 << 0) /* Start condition (master) */
 
#define OMAP_I2C_SCLL_HSSCLL   8
 
#define OMAP_I2C_SCLH_HSSCLH   8
 
#define SYSS_RESETDONE_MASK   (1 << 0)
 
#define SYSC_CLOCKACTIVITY_MASK   (0x3 << 8)
 
#define SYSC_SIDLEMODE_MASK   (0x3 << 3)
 
#define SYSC_ENAWAKEUP_MASK   (1 << 2)
 
#define SYSC_SOFTRESET_MASK   (1 << 1)
 
#define SYSC_AUTOIDLE_MASK   (1 << 0)
 
#define SYSC_IDLEMODE_SMART   0x2
 
#define SYSC_CLOCKACTIVITY_FCLK   0x2
 
#define I2C_OMAP_ERRATA_I207   (1 << 0)
 
#define I2C_OMAP_ERRATA_I462   (1 << 1)
 
#define omap_i2c_omap1_isr   NULL
 
#define OMAP_I2C_PM_OPS   NULL
 

Enumerations

enum  {
  OMAP_I2C_REV_REG = 0, OMAP_I2C_IE_REG, OMAP_I2C_STAT_REG, OMAP_I2C_IV_REG,
  OMAP_I2C_WE_REG, OMAP_I2C_SYSS_REG, OMAP_I2C_BUF_REG, OMAP_I2C_CNT_REG,
  OMAP_I2C_DATA_REG, OMAP_I2C_SYSC_REG, OMAP_I2C_CON_REG, OMAP_I2C_OA_REG,
  OMAP_I2C_SA_REG, OMAP_I2C_PSC_REG, OMAP_I2C_SCLL_REG, OMAP_I2C_SCLH_REG,
  OMAP_I2C_SYSTEST_REG, OMAP_I2C_BUFSTAT_REG, OMAP_I2C_IP_V2_REVNB_LO, OMAP_I2C_IP_V2_REVNB_HI,
  OMAP_I2C_IP_V2_IRQSTATUS_RAW, OMAP_I2C_IP_V2_IRQENABLE_SET, OMAP_I2C_IP_V2_IRQENABLE_CLR
}
 

Functions

 subsys_initcall (omap_i2c_init_driver)
 
 module_exit (omap_i2c_exit_driver)
 
 MODULE_AUTHOR ("MontaVista Software, Inc. (and others)")
 
 MODULE_DESCRIPTION ("TI OMAP I2C bus adapter")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:omap_i2c")
 

Macro Definition Documentation

#define I2C_OMAP_ERRATA_I207   (1 << 0)

Definition at line 178 of file i2c-omap.c.

#define I2C_OMAP_ERRATA_I462   (1 << 1)

Definition at line 179 of file i2c-omap.c.

#define OMAP_I2C_BUF_RDMA_EN   (1 << 15) /* RX DMA channel enable */

Definition at line 131 of file i2c-omap.c.

#define OMAP_I2C_BUF_RXFIF_CLR   (1 << 14) /* RX FIFO Clear */

Definition at line 132 of file i2c-omap.c.

#define OMAP_I2C_BUF_TXFIF_CLR   (1 << 6) /* TX FIFO Clear */

Definition at line 134 of file i2c-omap.c.

#define OMAP_I2C_BUF_XDMA_EN   (1 << 7) /* TX DMA channel enable */

Definition at line 133 of file i2c-omap.c.

#define OMAP_I2C_CON_BE   (1 << 14) /* Big endian mode */

Definition at line 138 of file i2c-omap.c.

#define OMAP_I2C_CON_EN   (1 << 15) /* I2C module enable */

Definition at line 137 of file i2c-omap.c.

#define OMAP_I2C_CON_MST   (1 << 10) /* Master/slave mode */

Definition at line 141 of file i2c-omap.c.

#define OMAP_I2C_CON_OPMODE_HS   (1 << 12) /* High Speed support */

Definition at line 139 of file i2c-omap.c.

#define OMAP_I2C_CON_RM   (1 << 2) /* Repeat mode (master only) */

Definition at line 144 of file i2c-omap.c.

#define OMAP_I2C_CON_STB   (1 << 11) /* Start byte mode (master) */

Definition at line 140 of file i2c-omap.c.

#define OMAP_I2C_CON_STP   (1 << 1) /* Stop cond (master only) */

Definition at line 145 of file i2c-omap.c.

#define OMAP_I2C_CON_STT   (1 << 0) /* Start condition (master) */

Definition at line 146 of file i2c-omap.c.

#define OMAP_I2C_CON_TRX   (1 << 9) /* TX/RX mode (master only) */

Definition at line 142 of file i2c-omap.c.

#define OMAP_I2C_CON_XA   (1 << 8) /* Expand address */

Definition at line 143 of file i2c-omap.c.

#define OMAP_I2C_IE_AL   (1 << 0) /* Arbitration lost int ena */

Definition at line 96 of file i2c-omap.c.

#define OMAP_I2C_IE_ARDY   (1 << 2) /* Access ready int enable */

Definition at line 94 of file i2c-omap.c.

#define OMAP_I2C_IE_NACK   (1 << 1) /* No ack interrupt enable */

Definition at line 95 of file i2c-omap.c.

#define OMAP_I2C_IE_RDR   (1 << 13) /* RX Buffer drain int enable */

Definition at line 91 of file i2c-omap.c.

#define OMAP_I2C_IE_RRDY   (1 << 3) /* RX data ready int enable */

Definition at line 93 of file i2c-omap.c.

#define OMAP_I2C_IE_XDR   (1 << 14) /* TX Buffer drain int enable */

Definition at line 90 of file i2c-omap.c.

#define OMAP_I2C_IE_XRDY   (1 << 4) /* TX data ready int enable */

Definition at line 92 of file i2c-omap.c.

#define omap_i2c_omap1_isr   NULL

Definition at line 764 of file i2c-omap.c.

#define OMAP_I2C_OMAP1_REV_2   0x20

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

#define OMAP_I2C_PM_OPS   NULL

Definition at line 1293 of file i2c-omap.c.

#define OMAP_I2C_PM_TIMEOUT   1000 /* ms */

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

#define OMAP_I2C_REV_ON_2430   0x36

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

#define OMAP_I2C_REV_ON_3430_3530   0x3C

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

#define OMAP_I2C_REV_ON_3630_4430   0x40

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

#define OMAP_I2C_SCLH_HSSCLH   8

Definition at line 150 of file i2c-omap.c.

#define OMAP_I2C_SCLL_HSSCLL   8

Definition at line 149 of file i2c-omap.c.

#define OMAP_I2C_STAT_AAS   (1 << 9) /* Address as slave */

Definition at line 104 of file i2c-omap.c.

#define OMAP_I2C_STAT_AD0   (1 << 8) /* Address zero */

Definition at line 105 of file i2c-omap.c.

#define OMAP_I2C_STAT_AL   (1 << 0) /* Arbitration lost int ena */

Definition at line 110 of file i2c-omap.c.

#define OMAP_I2C_STAT_ARDY   (1 << 2) /* Register access ready */

Definition at line 108 of file i2c-omap.c.

#define OMAP_I2C_STAT_BB   (1 << 12) /* Bus busy */

Definition at line 101 of file i2c-omap.c.

#define OMAP_I2C_STAT_NACK   (1 << 1) /* No ack interrupt enable */

Definition at line 109 of file i2c-omap.c.

#define OMAP_I2C_STAT_RDR   (1 << 13) /* RX Buffer draining */

Definition at line 100 of file i2c-omap.c.

#define OMAP_I2C_STAT_ROVR   (1 << 11) /* Receive overrun */

Definition at line 102 of file i2c-omap.c.

#define OMAP_I2C_STAT_RRDY   (1 << 3) /* Receive data ready */

Definition at line 107 of file i2c-omap.c.

#define OMAP_I2C_STAT_XDR   (1 << 14) /* TX Buffer draining */

Definition at line 99 of file i2c-omap.c.

#define OMAP_I2C_STAT_XRDY   (1 << 4) /* Transmit data ready */

Definition at line 106 of file i2c-omap.c.

#define OMAP_I2C_STAT_XUDF   (1 << 10) /* Transmit underflow */

Definition at line 103 of file i2c-omap.c.

#define OMAP_I2C_TIMEOUT   (msecs_to_jiffies(1000))

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

#define OMAP_I2C_WE_AAS_WE   (1 << 9) /* Address as slave wakeup*/

Definition at line 115 of file i2c-omap.c.

#define OMAP_I2C_WE_AL_WE   (1 << 0) /* Arbitration lost wakeup */

Definition at line 122 of file i2c-omap.c.

#define OMAP_I2C_WE_ALL
Value:
OMAP_I2C_WE_AAS_WE | OMAP_I2C_WE_BF_WE | \
OMAP_I2C_WE_STC_WE | OMAP_I2C_WE_GC_WE | \
OMAP_I2C_WE_DRDY_WE | OMAP_I2C_WE_ARDY_WE | \
OMAP_I2C_WE_NACK_WE | OMAP_I2C_WE_AL_WE)

Definition at line 124 of file i2c-omap.c.

#define OMAP_I2C_WE_ARDY_WE   (1 << 2) /* Reg access ready wakeup */

Definition at line 120 of file i2c-omap.c.

#define OMAP_I2C_WE_BF_WE   (1 << 8) /* Bus free wakeup */

Definition at line 116 of file i2c-omap.c.

#define OMAP_I2C_WE_DRDY_WE   (1 << 3) /* TX/RX data ready wakeup */

Definition at line 119 of file i2c-omap.c.

#define OMAP_I2C_WE_GC_WE   (1 << 5) /* General call wakeup */

Definition at line 118 of file i2c-omap.c.

#define OMAP_I2C_WE_NACK_WE   (1 << 1) /* No acknowledgment wakeup */

Definition at line 121 of file i2c-omap.c.

#define OMAP_I2C_WE_RDR_WE   (1 << 13) /* RX drain wakeup */

Definition at line 114 of file i2c-omap.c.

#define OMAP_I2C_WE_STC_WE   (1 << 6) /* Start condition wakeup */

Definition at line 117 of file i2c-omap.c.

#define OMAP_I2C_WE_XDR_WE   (1 << 14) /* TX drain wakup */

Definition at line 113 of file i2c-omap.c.

#define SYSC_AUTOIDLE_MASK   (1 << 0)

Definition at line 172 of file i2c-omap.c.

#define SYSC_CLOCKACTIVITY_FCLK   0x2

Definition at line 175 of file i2c-omap.c.

#define SYSC_CLOCKACTIVITY_MASK   (0x3 << 8)

Definition at line 168 of file i2c-omap.c.

#define SYSC_ENAWAKEUP_MASK   (1 << 2)

Definition at line 170 of file i2c-omap.c.

#define SYSC_IDLEMODE_SMART   0x2

Definition at line 174 of file i2c-omap.c.

#define SYSC_SIDLEMODE_MASK   (0x3 << 3)

Definition at line 169 of file i2c-omap.c.

#define SYSC_SOFTRESET_MASK   (1 << 1)

Definition at line 171 of file i2c-omap.c.

#define SYSS_RESETDONE_MASK   (1 << 0)

Definition at line 165 of file i2c-omap.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
OMAP_I2C_REV_REG 
OMAP_I2C_IE_REG 
OMAP_I2C_STAT_REG 
OMAP_I2C_IV_REG 
OMAP_I2C_WE_REG 
OMAP_I2C_SYSS_REG 
OMAP_I2C_BUF_REG 
OMAP_I2C_CNT_REG 
OMAP_I2C_DATA_REG 
OMAP_I2C_SYSC_REG 
OMAP_I2C_CON_REG 
OMAP_I2C_OA_REG 
OMAP_I2C_SA_REG 
OMAP_I2C_PSC_REG 
OMAP_I2C_SCLL_REG 
OMAP_I2C_SCLH_REG 
OMAP_I2C_SYSTEST_REG 
OMAP_I2C_BUFSTAT_REG 
OMAP_I2C_IP_V2_REVNB_LO 
OMAP_I2C_IP_V2_REVNB_HI 
OMAP_I2C_IP_V2_IRQSTATUS_RAW 
OMAP_I2C_IP_V2_IRQENABLE_SET 
OMAP_I2C_IP_V2_IRQENABLE_CLR 

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

Function Documentation

MODULE_ALIAS ( "platform:omap_i2c"  )
MODULE_AUTHOR ( "MontaVista  Software,
Inc.(and others)"   
)
MODULE_DESCRIPTION ( "TI OMAP I2C bus adapter )
module_exit ( omap_i2c_exit_driver  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( omap_i2c_init_driver  )