aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/include/mach/usb_phy.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/mach-tegra/include/mach/usb_phy.h
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/usb_phy.h')
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
new file mode 100644
index 00000000000..b5bf001d613
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -0,0 +1,166 @@
1/*
2 * arch/arm/mach-tegra/include/mach/usb_phy.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 NVIDIA Corporation.
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef __MACH_USB_PHY_H
19#define __MACH_USB_PHY_H
20
21#include <linux/clk.h>
22#include <linux/regulator/consumer.h>
23#include <linux/usb/otg.h>
24#include <linux/platform_data/tegra_usb.h>
25
26struct tegra_utmip_config {
27 u8 hssync_start_delay;
28 u8 elastic_limit;
29 u8 idle_wait_delay;
30 u8 term_range_adj;
31 u8 xcvr_setup;
32 signed char xcvr_setup_offset;
33 u8 xcvr_use_fuses;
34 u8 xcvr_lsfslew;
35 u8 xcvr_lsrslew;
36};
37
38struct tegra_ulpi_trimmer {
39 u8 shadow_clk_delay; /* 0 ~ 31 */
40 u8 clock_out_delay; /* 0 ~ 31 */
41 u8 data_trimmer; /* 0 ~ 7 */
42 u8 stpdirnxt_trimmer; /* 0 ~ 7 */
43};
44
45struct tegra_ulpi_config {
46 int enable_gpio;
47 int reset_gpio;
48 const char *clk;
49 const struct tegra_ulpi_trimmer *trimmer;
50 int (*pre_phy_on)(void);
51 int (*post_phy_on)(void);
52 int (*pre_phy_off)(void);
53 int (*post_phy_off)(void);
54 void (*phy_restore_start)(void);
55 void (*phy_restore_end)(void);
56 int phy_restore_gpio; /* null phy restore ack from device */
57 int ulpi_dir_gpio; /* ulpi dir */
58 int ulpi_d0_gpio; /* usb linestate[0] */
59 int ulpi_d1_gpio; /* usb linestate[1] */
60};
61
62struct tegra_uhsic_config {
63 int enable_gpio;
64 int reset_gpio;
65 u8 sync_start_delay;
66 u8 idle_wait_delay;
67 u8 term_range_adj;
68 u8 elastic_underrun_limit;
69 u8 elastic_overrun_limit;
70 int (*postsuspend)(void);
71 int (*preresume)(void);
72 int (*usb_phy_ready)(void);
73 int (*post_phy_off)(void);
74};
75
76enum tegra_usb_phy_port_speed {
77 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
78 TEGRA_USB_PHY_PORT_SPEED_LOW,
79 TEGRA_USB_PHY_PORT_SPEED_HIGH,
80};
81
82enum tegra_usb_phy_mode {
83 TEGRA_USB_PHY_MODE_DEVICE,
84 TEGRA_USB_PHY_MODE_HOST,
85};
86
87struct usb_phy_plat_data {
88 int instance;
89 int vbus_irq;
90 int vbus_gpio;
91 char * vbus_reg_supply;
92};
93
94struct tegra_xtal_freq;
95
96struct tegra_usb_phy {
97 int instance;
98 const struct tegra_xtal_freq *freq;
99 void __iomem *regs;
100 void __iomem *pad_regs;
101 struct clk *clk;
102 struct clk *pll_u;
103 struct clk *pad_clk;
104 enum tegra_usb_phy_mode mode;
105 void *config;
106 struct regulator *reg_vdd;
107 struct regulator *reg_vbus;
108 enum tegra_usb_phy_type usb_phy_type;
109 bool regulator_on;
110 struct otg_transceiver *ulpi;
111 int initialized;
112 bool power_on;
113 bool remote_wakeup;
114 int hotplug;
115 unsigned int xcvr_setup_value;
116};
117
118typedef int (*tegra_phy_fp)(struct tegra_usb_phy *phy, bool is_dpd);
119typedef void (*tegra_phy_restore_start_fp)(struct tegra_usb_phy *phy,
120 enum tegra_usb_phy_port_speed);
121typedef void (*tegra_phy_restore_end_fp)(struct tegra_usb_phy *phy);
122
123struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
124 void *config, enum tegra_usb_phy_mode phy_mode,
125 enum tegra_usb_phy_type usb_phy_type);
126
127int tegra_usb_phy_power_on(struct tegra_usb_phy *phy, bool is_dpd);
128
129void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
130
131void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
132
133void tegra_usb_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd);
134
135void tegra_usb_phy_postsuspend(struct tegra_usb_phy *phy, bool is_dpd);
136
137void tegra_usb_phy_preresume(struct tegra_usb_phy *phy, bool is_dpd);
138
139void tegra_usb_phy_postresume(struct tegra_usb_phy *phy, bool is_dpd);
140
141void tegra_ehci_pre_reset(struct tegra_usb_phy *phy, bool is_dpd);
142
143void tegra_ehci_post_reset(struct tegra_usb_phy *phy, bool is_dpd);
144
145void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
146 enum tegra_usb_phy_port_speed port_speed);
147
148void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
149
150void tegra_usb_phy_close(struct tegra_usb_phy *phy);
151
152int tegra_usb_phy_bus_connect(struct tegra_usb_phy *phy);
153
154int tegra_usb_phy_bus_reset(struct tegra_usb_phy *phy);
155
156int tegra_usb_phy_bus_idle(struct tegra_usb_phy *phy);
157
158bool tegra_usb_phy_is_device_connected(struct tegra_usb_phy *phy);
159
160bool tegra_usb_phy_charger_detect(struct tegra_usb_phy *phy);
161
162int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size);
163
164bool tegra_usb_phy_is_remotewake_detected(struct tegra_usb_phy *phy);
165
166#endif /* __MACH_USB_PHY_H */