Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
tegra_usb_phy.c File Reference
#include <linux/resource.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
#include <asm/mach-types.h>
#include <linux/usb/tegra_usb_phy.h>
#include <mach/iomap.h>

Go to the source code of this file.

Data Structures

struct  tegra_xtal_freq
 

Macros

#define ULPI_VIEWPORT   0x170
 
#define USB_PORTSC1   0x184
 
#define USB_PORTSC1_PTS(x)   (((x) & 0x3) << 30)
 
#define USB_PORTSC1_PSPD(x)   (((x) & 0x3) << 26)
 
#define USB_PORTSC1_PHCD   (1 << 23)
 
#define USB_PORTSC1_WKOC   (1 << 22)
 
#define USB_PORTSC1_WKDS   (1 << 21)
 
#define USB_PORTSC1_WKCN   (1 << 20)
 
#define USB_PORTSC1_PTC(x)   (((x) & 0xf) << 16)
 
#define USB_PORTSC1_PP   (1 << 12)
 
#define USB_PORTSC1_SUSP   (1 << 7)
 
#define USB_PORTSC1_PE   (1 << 2)
 
#define USB_PORTSC1_CCS   (1 << 0)
 
#define USB_SUSP_CTRL   0x400
 
#define USB_WAKE_ON_CNNT_EN_DEV   (1 << 3)
 
#define USB_WAKE_ON_DISCON_EN_DEV   (1 << 4)
 
#define USB_SUSP_CLR   (1 << 5)
 
#define USB_PHY_CLK_VALID   (1 << 7)
 
#define UTMIP_RESET   (1 << 11)
 
#define UHSIC_RESET   (1 << 11)
 
#define UTMIP_PHY_ENABLE   (1 << 12)
 
#define ULPI_PHY_ENABLE   (1 << 13)
 
#define USB_SUSP_SET   (1 << 14)
 
#define USB_WAKEUP_DEBOUNCE_COUNT(x)   (((x) & 0x7) << 16)
 
#define USB1_LEGACY_CTRL   0x410
 
#define USB1_NO_LEGACY_MODE   (1 << 0)
 
#define USB1_VBUS_SENSE_CTL_MASK   (3 << 1)
 
#define USB1_VBUS_SENSE_CTL_VBUS_WAKEUP   (0 << 1)
 
#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD_OR_VBUS_WAKEUP   (1 << 1)
 
#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD   (2 << 1)
 
#define USB1_VBUS_SENSE_CTL_A_SESS_VLD   (3 << 1)
 
#define ULPI_TIMING_CTRL_0   0x424
 
#define ULPI_OUTPUT_PINMUX_BYP   (1 << 10)
 
#define ULPI_CLKOUT_PINMUX_BYP   (1 << 11)
 
#define ULPI_TIMING_CTRL_1   0x428
 
#define ULPI_DATA_TRIMMER_LOAD   (1 << 0)
 
#define ULPI_DATA_TRIMMER_SEL(x)   (((x) & 0x7) << 1)
 
#define ULPI_STPDIRNXT_TRIMMER_LOAD   (1 << 16)
 
#define ULPI_STPDIRNXT_TRIMMER_SEL(x)   (((x) & 0x7) << 17)
 
#define ULPI_DIR_TRIMMER_LOAD   (1 << 24)
 
#define ULPI_DIR_TRIMMER_SEL(x)   (((x) & 0x7) << 25)
 
#define UTMIP_PLL_CFG1   0x804
 
#define UTMIP_XTAL_FREQ_COUNT(x)   (((x) & 0xfff) << 0)
 
#define UTMIP_PLLU_ENABLE_DLY_COUNT(x)   (((x) & 0x1f) << 27)
 
#define UTMIP_XCVR_CFG0   0x808
 
#define UTMIP_XCVR_SETUP(x)   (((x) & 0xf) << 0)
 
#define UTMIP_XCVR_LSRSLEW(x)   (((x) & 0x3) << 8)
 
#define UTMIP_XCVR_LSFSLEW(x)   (((x) & 0x3) << 10)
 
#define UTMIP_FORCE_PD_POWERDOWN   (1 << 14)
 
#define UTMIP_FORCE_PD2_POWERDOWN   (1 << 16)
 
#define UTMIP_FORCE_PDZI_POWERDOWN   (1 << 18)
 
#define UTMIP_XCVR_HSSLEW_MSB(x)   (((x) & 0x7f) << 25)
 
#define UTMIP_BIAS_CFG0   0x80c
 
#define UTMIP_OTGPD   (1 << 11)
 
#define UTMIP_BIASPD   (1 << 10)
 
#define UTMIP_HSRX_CFG0   0x810
 
#define UTMIP_ELASTIC_LIMIT(x)   (((x) & 0x1f) << 10)
 
#define UTMIP_IDLE_WAIT(x)   (((x) & 0x1f) << 15)
 
#define UTMIP_HSRX_CFG1   0x814
 
#define UTMIP_HS_SYNC_START_DLY(x)   (((x) & 0x1f) << 1)
 
#define UTMIP_TX_CFG0   0x820
 
#define UTMIP_FS_PREABMLE_J   (1 << 19)
 
#define UTMIP_HS_DISCON_DISABLE   (1 << 8)
 
#define UTMIP_MISC_CFG0   0x824
 
#define UTMIP_DPDM_OBSERVE   (1 << 26)
 
#define UTMIP_DPDM_OBSERVE_SEL(x)   (((x) & 0xf) << 27)
 
#define UTMIP_DPDM_OBSERVE_SEL_FS_J   UTMIP_DPDM_OBSERVE_SEL(0xf)
 
#define UTMIP_DPDM_OBSERVE_SEL_FS_K   UTMIP_DPDM_OBSERVE_SEL(0xe)
 
#define UTMIP_DPDM_OBSERVE_SEL_FS_SE1   UTMIP_DPDM_OBSERVE_SEL(0xd)
 
#define UTMIP_DPDM_OBSERVE_SEL_FS_SE0   UTMIP_DPDM_OBSERVE_SEL(0xc)
 
#define UTMIP_SUSPEND_EXIT_ON_EDGE   (1 << 22)
 
#define UTMIP_MISC_CFG1   0x828
 
#define UTMIP_PLL_ACTIVE_DLY_COUNT(x)   (((x) & 0x1f) << 18)
 
#define UTMIP_PLLU_STABLE_COUNT(x)   (((x) & 0xfff) << 6)
 
#define UTMIP_DEBOUNCE_CFG0   0x82c
 
#define UTMIP_BIAS_DEBOUNCE_A(x)   (((x) & 0xffff) << 0)
 
#define UTMIP_BAT_CHRG_CFG0   0x830
 
#define UTMIP_PD_CHRG   (1 << 0)
 
#define UTMIP_SPARE_CFG0   0x834
 
#define FUSE_SETUP_SEL   (1 << 3)
 
#define UTMIP_XCVR_CFG1   0x838
 
#define UTMIP_FORCE_PDDISC_POWERDOWN   (1 << 0)
 
#define UTMIP_FORCE_PDCHRP_POWERDOWN   (1 << 2)
 
#define UTMIP_FORCE_PDDR_POWERDOWN   (1 << 4)
 
#define UTMIP_XCVR_TERM_RANGE_ADJ(x)   (((x) & 0xf) << 18)
 
#define UTMIP_BIAS_CFG1   0x83c
 
#define UTMIP_BIAS_PDTRK_COUNT(x)   (((x) & 0x1f) << 3)
 

Functions

struct tegra_usb_phytegra_usb_phy_open (struct device *dev, int instance, void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode)
 
 EXPORT_SYMBOL_GPL (tegra_usb_phy_open)
 
void tegra_usb_phy_preresume (struct tegra_usb_phy *phy)
 
 EXPORT_SYMBOL_GPL (tegra_usb_phy_preresume)
 
void tegra_usb_phy_postresume (struct tegra_usb_phy *phy)
 
 EXPORT_SYMBOL_GPL (tegra_usb_phy_postresume)
 
void tegra_ehci_phy_restore_start (struct tegra_usb_phy *phy, enum tegra_usb_phy_port_speed port_speed)
 
 EXPORT_SYMBOL_GPL (tegra_ehci_phy_restore_start)
 
void tegra_ehci_phy_restore_end (struct tegra_usb_phy *phy)
 
 EXPORT_SYMBOL_GPL (tegra_ehci_phy_restore_end)
 
void tegra_usb_phy_clk_disable (struct tegra_usb_phy *phy)
 
 EXPORT_SYMBOL_GPL (tegra_usb_phy_clk_disable)
 
void tegra_usb_phy_clk_enable (struct tegra_usb_phy *phy)
 
 EXPORT_SYMBOL_GPL (tegra_usb_phy_clk_enable)
 

Macro Definition Documentation

#define FUSE_SETUP_SEL   (1 << 3)

Definition at line 130 of file tegra_usb_phy.c.

#define UHSIC_RESET   (1 << 11)

Definition at line 55 of file tegra_usb_phy.c.

#define ULPI_CLKOUT_PINMUX_BYP   (1 << 11)

Definition at line 72 of file tegra_usb_phy.c.

#define ULPI_DATA_TRIMMER_LOAD   (1 << 0)

Definition at line 75 of file tegra_usb_phy.c.

#define ULPI_DATA_TRIMMER_SEL (   x)    (((x) & 0x7) << 1)

Definition at line 76 of file tegra_usb_phy.c.

#define ULPI_DIR_TRIMMER_LOAD   (1 << 24)

Definition at line 79 of file tegra_usb_phy.c.

#define ULPI_DIR_TRIMMER_SEL (   x)    (((x) & 0x7) << 25)

Definition at line 80 of file tegra_usb_phy.c.

#define ULPI_OUTPUT_PINMUX_BYP   (1 << 10)

Definition at line 71 of file tegra_usb_phy.c.

#define ULPI_PHY_ENABLE   (1 << 13)

Definition at line 57 of file tegra_usb_phy.c.

#define ULPI_STPDIRNXT_TRIMMER_LOAD   (1 << 16)

Definition at line 77 of file tegra_usb_phy.c.

#define ULPI_STPDIRNXT_TRIMMER_SEL (   x)    (((x) & 0x7) << 17)

Definition at line 78 of file tegra_usb_phy.c.

#define ULPI_TIMING_CTRL_0   0x424

Definition at line 70 of file tegra_usb_phy.c.

#define ULPI_TIMING_CTRL_1   0x428

Definition at line 74 of file tegra_usb_phy.c.

#define ULPI_VIEWPORT   0x170

Definition at line 34 of file tegra_usb_phy.c.

#define USB1_LEGACY_CTRL   0x410

Definition at line 61 of file tegra_usb_phy.c.

#define USB1_NO_LEGACY_MODE   (1 << 0)

Definition at line 62 of file tegra_usb_phy.c.

#define USB1_VBUS_SENSE_CTL_A_SESS_VLD   (3 << 1)

Definition at line 68 of file tegra_usb_phy.c.

#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD   (2 << 1)

Definition at line 67 of file tegra_usb_phy.c.

#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD_OR_VBUS_WAKEUP   (1 << 1)

Definition at line 65 of file tegra_usb_phy.c.

#define USB1_VBUS_SENSE_CTL_MASK   (3 << 1)

Definition at line 63 of file tegra_usb_phy.c.

#define USB1_VBUS_SENSE_CTL_VBUS_WAKEUP   (0 << 1)

Definition at line 64 of file tegra_usb_phy.c.

#define USB_PHY_CLK_VALID   (1 << 7)

Definition at line 53 of file tegra_usb_phy.c.

#define USB_PORTSC1   0x184

Definition at line 36 of file tegra_usb_phy.c.

#define USB_PORTSC1_CCS   (1 << 0)

Definition at line 47 of file tegra_usb_phy.c.

#define USB_PORTSC1_PE   (1 << 2)

Definition at line 46 of file tegra_usb_phy.c.

#define USB_PORTSC1_PHCD   (1 << 23)

Definition at line 39 of file tegra_usb_phy.c.

#define USB_PORTSC1_PP   (1 << 12)

Definition at line 44 of file tegra_usb_phy.c.

#define USB_PORTSC1_PSPD (   x)    (((x) & 0x3) << 26)

Definition at line 38 of file tegra_usb_phy.c.

#define USB_PORTSC1_PTC (   x)    (((x) & 0xf) << 16)

Definition at line 43 of file tegra_usb_phy.c.

#define USB_PORTSC1_PTS (   x)    (((x) & 0x3) << 30)

Definition at line 37 of file tegra_usb_phy.c.

#define USB_PORTSC1_SUSP   (1 << 7)

Definition at line 45 of file tegra_usb_phy.c.

#define USB_PORTSC1_WKCN   (1 << 20)

Definition at line 42 of file tegra_usb_phy.c.

#define USB_PORTSC1_WKDS   (1 << 21)

Definition at line 41 of file tegra_usb_phy.c.

#define USB_PORTSC1_WKOC   (1 << 22)

Definition at line 40 of file tegra_usb_phy.c.

#define USB_SUSP_CLR   (1 << 5)

Definition at line 52 of file tegra_usb_phy.c.

#define USB_SUSP_CTRL   0x400

Definition at line 49 of file tegra_usb_phy.c.

#define USB_SUSP_SET   (1 << 14)

Definition at line 58 of file tegra_usb_phy.c.

#define USB_WAKE_ON_CNNT_EN_DEV   (1 << 3)

Definition at line 50 of file tegra_usb_phy.c.

#define USB_WAKE_ON_DISCON_EN_DEV   (1 << 4)

Definition at line 51 of file tegra_usb_phy.c.

#define USB_WAKEUP_DEBOUNCE_COUNT (   x)    (((x) & 0x7) << 16)

Definition at line 59 of file tegra_usb_phy.c.

#define UTMIP_BAT_CHRG_CFG0   0x830

Definition at line 126 of file tegra_usb_phy.c.

#define UTMIP_BIAS_CFG0   0x80c

Definition at line 95 of file tegra_usb_phy.c.

#define UTMIP_BIAS_CFG1   0x83c

Definition at line 138 of file tegra_usb_phy.c.

#define UTMIP_BIAS_DEBOUNCE_A (   x)    (((x) & 0xffff) << 0)

Definition at line 124 of file tegra_usb_phy.c.

#define UTMIP_BIAS_PDTRK_COUNT (   x)    (((x) & 0x1f) << 3)

Definition at line 139 of file tegra_usb_phy.c.

#define UTMIP_BIASPD   (1 << 10)

Definition at line 97 of file tegra_usb_phy.c.

#define UTMIP_DEBOUNCE_CFG0   0x82c

Definition at line 123 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE   (1 << 26)

Definition at line 111 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE_SEL (   x)    (((x) & 0xf) << 27)

Definition at line 112 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE_SEL_FS_J   UTMIP_DPDM_OBSERVE_SEL(0xf)

Definition at line 113 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE_SEL_FS_K   UTMIP_DPDM_OBSERVE_SEL(0xe)

Definition at line 114 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE_SEL_FS_SE0   UTMIP_DPDM_OBSERVE_SEL(0xc)

Definition at line 116 of file tegra_usb_phy.c.

#define UTMIP_DPDM_OBSERVE_SEL_FS_SE1   UTMIP_DPDM_OBSERVE_SEL(0xd)

Definition at line 115 of file tegra_usb_phy.c.

#define UTMIP_ELASTIC_LIMIT (   x)    (((x) & 0x1f) << 10)

Definition at line 100 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PD2_POWERDOWN   (1 << 16)

Definition at line 91 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PD_POWERDOWN   (1 << 14)

Definition at line 90 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PDCHRP_POWERDOWN   (1 << 2)

Definition at line 134 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PDDISC_POWERDOWN   (1 << 0)

Definition at line 133 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PDDR_POWERDOWN   (1 << 4)

Definition at line 135 of file tegra_usb_phy.c.

#define UTMIP_FORCE_PDZI_POWERDOWN   (1 << 18)

Definition at line 92 of file tegra_usb_phy.c.

#define UTMIP_FS_PREABMLE_J   (1 << 19)

Definition at line 107 of file tegra_usb_phy.c.

#define UTMIP_HS_DISCON_DISABLE   (1 << 8)

Definition at line 108 of file tegra_usb_phy.c.

#define UTMIP_HS_SYNC_START_DLY (   x)    (((x) & 0x1f) << 1)

Definition at line 104 of file tegra_usb_phy.c.

#define UTMIP_HSRX_CFG0   0x810

Definition at line 99 of file tegra_usb_phy.c.

#define UTMIP_HSRX_CFG1   0x814

Definition at line 103 of file tegra_usb_phy.c.

#define UTMIP_IDLE_WAIT (   x)    (((x) & 0x1f) << 15)

Definition at line 101 of file tegra_usb_phy.c.

#define UTMIP_MISC_CFG0   0x824

Definition at line 110 of file tegra_usb_phy.c.

#define UTMIP_MISC_CFG1   0x828

Definition at line 119 of file tegra_usb_phy.c.

#define UTMIP_OTGPD   (1 << 11)

Definition at line 96 of file tegra_usb_phy.c.

#define UTMIP_PD_CHRG   (1 << 0)

Definition at line 127 of file tegra_usb_phy.c.

#define UTMIP_PHY_ENABLE   (1 << 12)

Definition at line 56 of file tegra_usb_phy.c.

#define UTMIP_PLL_ACTIVE_DLY_COUNT (   x)    (((x) & 0x1f) << 18)

Definition at line 120 of file tegra_usb_phy.c.

#define UTMIP_PLL_CFG1   0x804

Definition at line 82 of file tegra_usb_phy.c.

#define UTMIP_PLLU_ENABLE_DLY_COUNT (   x)    (((x) & 0x1f) << 27)

Definition at line 84 of file tegra_usb_phy.c.

#define UTMIP_PLLU_STABLE_COUNT (   x)    (((x) & 0xfff) << 6)

Definition at line 121 of file tegra_usb_phy.c.

#define UTMIP_RESET   (1 << 11)

Definition at line 54 of file tegra_usb_phy.c.

#define UTMIP_SPARE_CFG0   0x834

Definition at line 129 of file tegra_usb_phy.c.

#define UTMIP_SUSPEND_EXIT_ON_EDGE   (1 << 22)

Definition at line 117 of file tegra_usb_phy.c.

#define UTMIP_TX_CFG0   0x820

Definition at line 106 of file tegra_usb_phy.c.

#define UTMIP_XCVR_CFG0   0x808

Definition at line 86 of file tegra_usb_phy.c.

#define UTMIP_XCVR_CFG1   0x838

Definition at line 132 of file tegra_usb_phy.c.

#define UTMIP_XCVR_HSSLEW_MSB (   x)    (((x) & 0x7f) << 25)

Definition at line 93 of file tegra_usb_phy.c.

#define UTMIP_XCVR_LSFSLEW (   x)    (((x) & 0x3) << 10)

Definition at line 89 of file tegra_usb_phy.c.

#define UTMIP_XCVR_LSRSLEW (   x)    (((x) & 0x3) << 8)

Definition at line 88 of file tegra_usb_phy.c.

#define UTMIP_XCVR_SETUP (   x)    (((x) & 0xf) << 0)

Definition at line 87 of file tegra_usb_phy.c.

#define UTMIP_XCVR_TERM_RANGE_ADJ (   x)    (((x) & 0xf) << 18)

Definition at line 136 of file tegra_usb_phy.c.

#define UTMIP_XTAL_FREQ_COUNT (   x)    (((x) & 0xfff) << 0)

Definition at line 83 of file tegra_usb_phy.c.

Function Documentation

EXPORT_SYMBOL_GPL ( tegra_usb_phy_open  )
EXPORT_SYMBOL_GPL ( tegra_usb_phy_preresume  )
EXPORT_SYMBOL_GPL ( tegra_usb_phy_postresume  )
EXPORT_SYMBOL_GPL ( tegra_ehci_phy_restore_start  )
EXPORT_SYMBOL_GPL ( tegra_ehci_phy_restore_end  )
EXPORT_SYMBOL_GPL ( tegra_usb_phy_clk_disable  )
EXPORT_SYMBOL_GPL ( tegra_usb_phy_clk_enable  )
void tegra_ehci_phy_restore_end ( struct tegra_usb_phy phy)

Definition at line 819 of file tegra_usb_phy.c.

void tegra_ehci_phy_restore_start ( struct tegra_usb_phy phy,
enum tegra_usb_phy_port_speed  port_speed 
)

Definition at line 811 of file tegra_usb_phy.c.

void tegra_usb_phy_clk_disable ( struct tegra_usb_phy phy)

Definition at line 826 of file tegra_usb_phy.c.

void tegra_usb_phy_clk_enable ( struct tegra_usb_phy phy)

Definition at line 833 of file tegra_usb_phy.c.

struct tegra_usb_phy* tegra_usb_phy_open ( struct device dev,
int  instance,
void __iomem regs,
void config,
enum tegra_usb_phy_mode  phy_mode 
)
read

Definition at line 733 of file tegra_usb_phy.c.

void tegra_usb_phy_postresume ( struct tegra_usb_phy phy)

Definition at line 804 of file tegra_usb_phy.c.

void tegra_usb_phy_preresume ( struct tegra_usb_phy phy)

Definition at line 797 of file tegra_usb_phy.c.