diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-17 04:59:32 -0400 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-07-12 23:39:00 -0400 |
commit | 4c755997ea1eb3e3c2df7ef657494d8188d0c120 (patch) | |
tree | 45cf9ec17f9e086d250430292c98bf09f8b89d7a /arch/arm/mach-tegra/board-trimslice.c | |
parent | 9504940ae03e0ebe6cfef9cd8914199a42128107 (diff) |
ARM: tegra: trimslice: enable USB ports
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-trimslice.c')
-rw-r--r-- | arch/arm/mach-tegra/board-trimslice.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c index a19e90b622ec..a8fff429fb4a 100644 --- a/arch/arm/mach-tegra/board-trimslice.c +++ b/arch/arm/mach-tegra/board-trimslice.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c-tegra.h> | 27 | #include <linux/i2c-tegra.h> |
28 | #include <linux/platform_data/tegra_usb.h> | ||
29 | #include <linux/gpio.h> | ||
28 | 30 | ||
29 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
@@ -32,6 +34,8 @@ | |||
32 | 34 | ||
33 | #include <mach/iomap.h> | 35 | #include <mach/iomap.h> |
34 | #include <mach/sdhci.h> | 36 | #include <mach/sdhci.h> |
37 | #include <mach/usb_phy.h> | ||
38 | #include <mach/gpio.h> | ||
35 | 39 | ||
36 | #include "board.h" | 40 | #include "board.h" |
37 | #include "clock.h" | 41 | #include "clock.h" |
@@ -123,6 +127,41 @@ static void trimslice_i2c_init(void) | |||
123 | ARRAY_SIZE(trimslice_i2c3_board_info)); | 127 | ARRAY_SIZE(trimslice_i2c3_board_info)); |
124 | } | 128 | } |
125 | 129 | ||
130 | struct tegra_ulpi_config ehci2_phy_config = { | ||
131 | .reset_gpio = TRIMSLICE_GPIO_USB2_RST, | ||
132 | .clk = "cdev2", | ||
133 | }; | ||
134 | |||
135 | static struct tegra_ehci_platform_data ehci_ulpi_data = { | ||
136 | .operating_mode = TEGRA_USB_HOST, | ||
137 | .phy_config = &ehci2_phy_config, | ||
138 | }; | ||
139 | |||
140 | static struct tegra_ehci_platform_data ehci_utmi_data = { | ||
141 | .operating_mode = TEGRA_USB_HOST, | ||
142 | }; | ||
143 | |||
144 | static void trimslice_usb_init(void) | ||
145 | { | ||
146 | int err; | ||
147 | |||
148 | tegra_ehci3_device.dev.platform_data = &ehci_utmi_data; | ||
149 | platform_device_register(&tegra_ehci3_device); | ||
150 | |||
151 | tegra_ehci2_device.dev.platform_data = &ehci_ulpi_data; | ||
152 | platform_device_register(&tegra_ehci2_device); | ||
153 | |||
154 | err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH, | ||
155 | "usb1mode"); | ||
156 | if (err) { | ||
157 | pr_err("TrimSlice: failed to obtain USB1 mode gpio: %d\n", err); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | tegra_ehci1_device.dev.platform_data = &ehci_utmi_data; | ||
162 | platform_device_register(&tegra_ehci1_device); | ||
163 | } | ||
164 | |||
126 | static void __init tegra_trimslice_fixup(struct machine_desc *desc, | 165 | static void __init tegra_trimslice_fixup(struct machine_desc *desc, |
127 | struct tag *tags, char **cmdline, struct meminfo *mi) | 166 | struct tag *tags, char **cmdline, struct meminfo *mi) |
128 | { | 167 | { |
@@ -164,6 +203,7 @@ static void __init tegra_trimslice_init(void) | |||
164 | platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); | 203 | platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); |
165 | 204 | ||
166 | trimslice_i2c_init(); | 205 | trimslice_i2c_init(); |
206 | trimslice_usb_init(); | ||
167 | } | 207 | } |
168 | 208 | ||
169 | MACHINE_START(TRIMSLICE, "trimslice") | 209 | MACHINE_START(TRIMSLICE, "trimslice") |