Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
twl4030-usb.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/usb/otg.h>
#include <linux/usb/musb-omap.h>
#include <linux/usb/ulpi.h>
#include <linux/i2c/twl.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  twl4030_usb
 

Macros

#define MCPC_CTRL   0x30
 
#define MCPC_CTRL_RTSOL   (1 << 7)
 
#define MCPC_CTRL_EXTSWR   (1 << 6)
 
#define MCPC_CTRL_EXTSWC   (1 << 5)
 
#define MCPC_CTRL_VOICESW   (1 << 4)
 
#define MCPC_CTRL_OUT64K   (1 << 3)
 
#define MCPC_CTRL_RTSCTSSW   (1 << 2)
 
#define MCPC_CTRL_HS_UART   (1 << 0)
 
#define MCPC_IO_CTRL   0x33
 
#define MCPC_IO_CTRL_MICBIASEN   (1 << 5)
 
#define MCPC_IO_CTRL_CTS_NPU   (1 << 4)
 
#define MCPC_IO_CTRL_RXD_PU   (1 << 3)
 
#define MCPC_IO_CTRL_TXDTYP   (1 << 2)
 
#define MCPC_IO_CTRL_CTSTYP   (1 << 1)
 
#define MCPC_IO_CTRL_RTSTYP   (1 << 0)
 
#define MCPC_CTRL2   0x36
 
#define MCPC_CTRL2_MCPC_CK_EN   (1 << 0)
 
#define OTHER_FUNC_CTRL   0x80
 
#define OTHER_FUNC_CTRL_BDIS_ACON_EN   (1 << 4)
 
#define OTHER_FUNC_CTRL_FIVEWIRE_MODE   (1 << 2)
 
#define OTHER_IFC_CTRL   0x83
 
#define OTHER_IFC_CTRL_OE_INT_EN   (1 << 6)
 
#define OTHER_IFC_CTRL_CEA2011_MODE   (1 << 5)
 
#define OTHER_IFC_CTRL_FSLSSERIALMODE_4PIN   (1 << 4)
 
#define OTHER_IFC_CTRL_HIZ_ULPI_60MHZ_OUT   (1 << 3)
 
#define OTHER_IFC_CTRL_HIZ_ULPI   (1 << 2)
 
#define OTHER_IFC_CTRL_ALT_INT_REROUTE   (1 << 0)
 
#define OTHER_INT_EN_RISE   0x86
 
#define OTHER_INT_EN_FALL   0x89
 
#define OTHER_INT_STS   0x8C
 
#define OTHER_INT_LATCH   0x8D
 
#define OTHER_INT_VB_SESS_VLD   (1 << 7)
 
#define OTHER_INT_DM_HI   (1 << 6) /* not valid for "latch" reg */
 
#define OTHER_INT_DP_HI   (1 << 5) /* not valid for "latch" reg */
 
#define OTHER_INT_BDIS_ACON   (1 << 3) /* not valid for "fall" regs */
 
#define OTHER_INT_MANU   (1 << 1)
 
#define OTHER_INT_ABNORMAL_STRESS   (1 << 0)
 
#define ID_STATUS   0x96
 
#define ID_RES_FLOAT   (1 << 4)
 
#define ID_RES_440K   (1 << 3)
 
#define ID_RES_200K   (1 << 2)
 
#define ID_RES_102K   (1 << 1)
 
#define ID_RES_GND   (1 << 0)
 
#define POWER_CTRL   0xAC
 
#define POWER_CTRL_OTG_ENAB   (1 << 5)
 
#define OTHER_IFC_CTRL2   0xAF
 
#define OTHER_IFC_CTRL2_ULPI_STP_LOW   (1 << 4)
 
#define OTHER_IFC_CTRL2_ULPI_TXEN_POL   (1 << 3)
 
#define OTHER_IFC_CTRL2_ULPI_4PIN_2430   (1 << 2)
 
#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_MASK   (3 << 0) /* bits 0 and 1 */
 
#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_INT1N   (0 << 0)
 
#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_INT2N   (1 << 0)
 
#define REG_CTRL_EN   0xB2
 
#define REG_CTRL_ERROR   0xB5
 
#define ULPI_I2C_CONFLICT_INTEN   (1 << 0)
 
#define OTHER_FUNC_CTRL2   0xB8
 
#define OTHER_FUNC_CTRL2_VBAT_TIMER_EN   (1 << 0)
 
#define VBUS_DEBOUNCE   0xC0
 
#define ID_DEBOUNCE   0xC1
 
#define VBAT_TIMER   0xD3
 
#define PHY_PWR_CTRL   0xFD
 
#define PHY_PWR_PHYPWD   (1 << 0)
 
#define PHY_CLK_CTRL   0xFE
 
#define PHY_CLK_CTRL_CLOCKGATING_EN   (1 << 2)
 
#define PHY_CLK_CTRL_CLK32K_EN   (1 << 1)
 
#define REQ_PHY_DPLL_CLK   (1 << 0)
 
#define PHY_CLK_CTRL_STS   0xFF
 
#define PHY_DPLL_CLK   (1 << 0)
 
#define STS_HW_CONDITIONS   0x0F
 
#define VUSB_DEDICATED1   0x7D
 
#define VUSB_DEDICATED2   0x7E
 
#define VUSB1V5_DEV_GRP   0x71
 
#define VUSB1V5_TYPE   0x72
 
#define VUSB1V5_REMAP   0x73
 
#define VUSB1V8_DEV_GRP   0x74
 
#define VUSB1V8_TYPE   0x75
 
#define VUSB1V8_REMAP   0x76
 
#define VUSB3V1_DEV_GRP   0x77
 
#define VUSB3V1_TYPE   0x78
 
#define VUSB3V1_REMAP   0x79
 
#define PMBR1   0x0D
 
#define GPIO_USB_4PIN_ULPI_2430C   (3 << 0)
 
#define phy_to_twl(x)   container_of((x), struct twl4030_usb, phy)
 
#define twl4030_usb_write_verify(twl, address, data)   twl4030_i2c_write_u8_verify(twl, TWL4030_MODULE_USB, (data), (address))
 

Functions

 subsys_initcall (twl4030_usb_init)
 
 module_exit (twl4030_usb_exit)
 
 MODULE_ALIAS ("platform:twl4030_usb")
 
 MODULE_AUTHOR ("Texas Instruments, Inc, Nokia Corporation")
 
 MODULE_DESCRIPTION ("TWL4030 USB transceiver driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define GPIO_USB_4PIN_ULPI_2430C   (3 << 0)

Definition at line 144 of file twl4030-usb.c.

#define ID_DEBOUNCE   0xC1

Definition at line 115 of file twl4030-usb.c.

#define ID_RES_102K   (1 << 1)

Definition at line 92 of file twl4030-usb.c.

#define ID_RES_200K   (1 << 2)

Definition at line 91 of file twl4030-usb.c.

#define ID_RES_440K   (1 << 3)

Definition at line 90 of file twl4030-usb.c.

#define ID_RES_FLOAT   (1 << 4)

Definition at line 89 of file twl4030-usb.c.

#define ID_RES_GND   (1 << 0)

Definition at line 93 of file twl4030-usb.c.

#define ID_STATUS   0x96

Definition at line 88 of file twl4030-usb.c.

#define MCPC_CTRL   0x30

Definition at line 45 of file twl4030-usb.c.

#define MCPC_CTRL2   0x36

Definition at line 62 of file twl4030-usb.c.

#define MCPC_CTRL2_MCPC_CK_EN   (1 << 0)

Definition at line 63 of file twl4030-usb.c.

#define MCPC_CTRL_EXTSWC   (1 << 5)

Definition at line 48 of file twl4030-usb.c.

#define MCPC_CTRL_EXTSWR   (1 << 6)

Definition at line 47 of file twl4030-usb.c.

#define MCPC_CTRL_HS_UART   (1 << 0)

Definition at line 52 of file twl4030-usb.c.

#define MCPC_CTRL_OUT64K   (1 << 3)

Definition at line 50 of file twl4030-usb.c.

#define MCPC_CTRL_RTSCTSSW   (1 << 2)

Definition at line 51 of file twl4030-usb.c.

#define MCPC_CTRL_RTSOL   (1 << 7)

Definition at line 46 of file twl4030-usb.c.

#define MCPC_CTRL_VOICESW   (1 << 4)

Definition at line 49 of file twl4030-usb.c.

#define MCPC_IO_CTRL   0x33

Definition at line 54 of file twl4030-usb.c.

#define MCPC_IO_CTRL_CTS_NPU   (1 << 4)

Definition at line 56 of file twl4030-usb.c.

#define MCPC_IO_CTRL_CTSTYP   (1 << 1)

Definition at line 59 of file twl4030-usb.c.

#define MCPC_IO_CTRL_MICBIASEN   (1 << 5)

Definition at line 55 of file twl4030-usb.c.

#define MCPC_IO_CTRL_RTSTYP   (1 << 0)

Definition at line 60 of file twl4030-usb.c.

#define MCPC_IO_CTRL_RXD_PU   (1 << 3)

Definition at line 57 of file twl4030-usb.c.

#define MCPC_IO_CTRL_TXDTYP   (1 << 2)

Definition at line 58 of file twl4030-usb.c.

#define OTHER_FUNC_CTRL   0x80

Definition at line 65 of file twl4030-usb.c.

#define OTHER_FUNC_CTRL2   0xB8

Definition at line 110 of file twl4030-usb.c.

#define OTHER_FUNC_CTRL2_VBAT_TIMER_EN   (1 << 0)

Definition at line 111 of file twl4030-usb.c.

#define OTHER_FUNC_CTRL_BDIS_ACON_EN   (1 << 4)

Definition at line 66 of file twl4030-usb.c.

#define OTHER_FUNC_CTRL_FIVEWIRE_MODE   (1 << 2)

Definition at line 67 of file twl4030-usb.c.

#define OTHER_IFC_CTRL   0x83

Definition at line 69 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2   0xAF

Definition at line 98 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_ULPI_4PIN_2430   (1 << 2)

Definition at line 101 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_ULPI_STP_LOW   (1 << 4)

Definition at line 99 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_ULPI_TXEN_POL   (1 << 3)

Definition at line 100 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_INT1N   (0 << 0)

Definition at line 103 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_INT2N   (1 << 0)

Definition at line 104 of file twl4030-usb.c.

#define OTHER_IFC_CTRL2_USB_INT_OUTSEL_MASK   (3 << 0) /* bits 0 and 1 */

Definition at line 102 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_ALT_INT_REROUTE   (1 << 0)

Definition at line 75 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_CEA2011_MODE   (1 << 5)

Definition at line 71 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_FSLSSERIALMODE_4PIN   (1 << 4)

Definition at line 72 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_HIZ_ULPI   (1 << 2)

Definition at line 74 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_HIZ_ULPI_60MHZ_OUT   (1 << 3)

Definition at line 73 of file twl4030-usb.c.

#define OTHER_IFC_CTRL_OE_INT_EN   (1 << 6)

Definition at line 70 of file twl4030-usb.c.

#define OTHER_INT_ABNORMAL_STRESS   (1 << 0)

Definition at line 86 of file twl4030-usb.c.

#define OTHER_INT_BDIS_ACON   (1 << 3) /* not valid for "fall" regs */

Definition at line 84 of file twl4030-usb.c.

#define OTHER_INT_DM_HI   (1 << 6) /* not valid for "latch" reg */

Definition at line 82 of file twl4030-usb.c.

#define OTHER_INT_DP_HI   (1 << 5) /* not valid for "latch" reg */

Definition at line 83 of file twl4030-usb.c.

#define OTHER_INT_EN_FALL   0x89

Definition at line 78 of file twl4030-usb.c.

#define OTHER_INT_EN_RISE   0x86

Definition at line 77 of file twl4030-usb.c.

#define OTHER_INT_LATCH   0x8D

Definition at line 80 of file twl4030-usb.c.

#define OTHER_INT_MANU   (1 << 1)

Definition at line 85 of file twl4030-usb.c.

#define OTHER_INT_STS   0x8C

Definition at line 79 of file twl4030-usb.c.

#define OTHER_INT_VB_SESS_VLD   (1 << 7)

Definition at line 81 of file twl4030-usb.c.

#define PHY_CLK_CTRL   0xFE

Definition at line 119 of file twl4030-usb.c.

#define PHY_CLK_CTRL_CLK32K_EN   (1 << 1)

Definition at line 121 of file twl4030-usb.c.

#define PHY_CLK_CTRL_CLOCKGATING_EN   (1 << 2)

Definition at line 120 of file twl4030-usb.c.

#define PHY_CLK_CTRL_STS   0xFF

Definition at line 123 of file twl4030-usb.c.

#define PHY_DPLL_CLK   (1 << 0)

Definition at line 124 of file twl4030-usb.c.

#define PHY_PWR_CTRL   0xFD

Definition at line 117 of file twl4030-usb.c.

#define PHY_PWR_PHYPWD   (1 << 0)

Definition at line 118 of file twl4030-usb.c.

#define phy_to_twl (   x)    container_of((x), struct twl4030_usb, phy)

Definition at line 169 of file twl4030-usb.c.

#define PMBR1   0x0D

Definition at line 143 of file twl4030-usb.c.

#define POWER_CTRL   0xAC

Definition at line 95 of file twl4030-usb.c.

#define POWER_CTRL_OTG_ENAB   (1 << 5)

Definition at line 96 of file twl4030-usb.c.

#define REG_CTRL_EN   0xB2

Definition at line 106 of file twl4030-usb.c.

#define REG_CTRL_ERROR   0xB5

Definition at line 107 of file twl4030-usb.c.

#define REQ_PHY_DPLL_CLK   (1 << 0)

Definition at line 122 of file twl4030-usb.c.

#define STS_HW_CONDITIONS   0x0F

Definition at line 127 of file twl4030-usb.c.

#define twl4030_usb_write_verify (   twl,
  address,
  data 
)    twl4030_i2c_write_u8_verify(twl, TWL4030_MODULE_USB, (data), (address))

Definition at line 197 of file twl4030-usb.c.

#define ULPI_I2C_CONFLICT_INTEN   (1 << 0)

Definition at line 108 of file twl4030-usb.c.

#define VBAT_TIMER   0xD3

Definition at line 116 of file twl4030-usb.c.

#define VBUS_DEBOUNCE   0xC0

Definition at line 114 of file twl4030-usb.c.

#define VUSB1V5_DEV_GRP   0x71

Definition at line 132 of file twl4030-usb.c.

#define VUSB1V5_REMAP   0x73

Definition at line 134 of file twl4030-usb.c.

#define VUSB1V5_TYPE   0x72

Definition at line 133 of file twl4030-usb.c.

#define VUSB1V8_DEV_GRP   0x74

Definition at line 135 of file twl4030-usb.c.

#define VUSB1V8_REMAP   0x76

Definition at line 137 of file twl4030-usb.c.

#define VUSB1V8_TYPE   0x75

Definition at line 136 of file twl4030-usb.c.

#define VUSB3V1_DEV_GRP   0x77

Definition at line 138 of file twl4030-usb.c.

#define VUSB3V1_REMAP   0x79

Definition at line 140 of file twl4030-usb.c.

#define VUSB3V1_TYPE   0x78

Definition at line 139 of file twl4030-usb.c.

#define VUSB_DEDICATED1   0x7D

Definition at line 130 of file twl4030-usb.c.

#define VUSB_DEDICATED2   0x7E

Definition at line 131 of file twl4030-usb.c.

Function Documentation

MODULE_ALIAS ( "platform:twl4030_usb"  )
MODULE_AUTHOR ( "Texas  Instruments,
Inc  ,
Nokia Corporation"   
)
MODULE_DESCRIPTION ( "TWL4030 USB transceiver driver )
module_exit ( twl4030_usb_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( twl4030_usb_init  )