diff options
Diffstat (limited to 'arch/arm/mach-mx5/board-mx51_babbage.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_babbage.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 6021dd00ec75..e54e4bf61cfd 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | #define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7) | 37 | #define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7) |
38 | #define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27) | 38 | #define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27) |
39 | #define BABBAGE_PHY_RESET IMX_GPIO_NR(2, 5) | 39 | #define BABBAGE_USB_PHY_RESET IMX_GPIO_NR(2, 5) |
40 | #define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14) | 40 | #define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14) |
41 | #define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21) | 41 | #define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21) |
42 | #define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24) | 42 | #define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24) |
@@ -110,6 +110,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = { | |||
110 | /* USB HUB reset line*/ | 110 | /* USB HUB reset line*/ |
111 | MX51_PAD_GPIO1_7__GPIO1_7, | 111 | MX51_PAD_GPIO1_7__GPIO1_7, |
112 | 112 | ||
113 | /* USB PHY reset line */ | ||
114 | MX51_PAD_EIM_D21__GPIO2_5, | ||
115 | |||
113 | /* FEC */ | 116 | /* FEC */ |
114 | MX51_PAD_EIM_EB2__FEC_MDIO, | 117 | MX51_PAD_EIM_EB2__FEC_MDIO, |
115 | MX51_PAD_EIM_EB3__FEC_RDATA1, | 118 | MX51_PAD_EIM_EB3__FEC_RDATA1, |
@@ -169,34 +172,31 @@ static struct imxi2c_platform_data babbage_hsi2c_data = { | |||
169 | .bitrate = 400000, | 172 | .bitrate = 400000, |
170 | }; | 173 | }; |
171 | 174 | ||
175 | static struct gpio mx51_babbage_usbh1_gpios[] = { | ||
176 | { BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp" }, | ||
177 | { BABBAGE_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, "usbh1_phy_reset" }, | ||
178 | }; | ||
179 | |||
172 | static int gpio_usbh1_active(void) | 180 | static int gpio_usbh1_active(void) |
173 | { | 181 | { |
174 | iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27; | 182 | iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27; |
175 | iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5; | ||
176 | int ret; | 183 | int ret; |
177 | 184 | ||
178 | /* Set USBH1_STP to GPIO and toggle it */ | 185 | /* Set USBH1_STP to GPIO and toggle it */ |
179 | mxc_iomux_v3_setup_pad(usbh1stp_gpio); | 186 | mxc_iomux_v3_setup_pad(usbh1stp_gpio); |
180 | ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); | 187 | ret = gpio_request_array(mx51_babbage_usbh1_gpios, |
188 | ARRAY_SIZE(mx51_babbage_usbh1_gpios)); | ||
181 | 189 | ||
182 | if (ret) { | 190 | if (ret) { |
183 | pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret); | 191 | pr_debug("failed to get USBH1 pins: %d\n", ret); |
184 | return ret; | 192 | return ret; |
185 | } | 193 | } |
186 | gpio_direction_output(BABBAGE_USBH1_STP, 0); | ||
187 | gpio_set_value(BABBAGE_USBH1_STP, 1); | ||
188 | msleep(100); | ||
189 | gpio_free(BABBAGE_USBH1_STP); | ||
190 | |||
191 | /* De-assert USB PHY RESETB */ | ||
192 | mxc_iomux_v3_setup_pad(phyreset_gpio); | ||
193 | ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); | ||
194 | 194 | ||
195 | if (ret) { | 195 | msleep(100); |
196 | pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret); | 196 | gpio_set_value(BABBAGE_USBH1_STP, 1); |
197 | return ret; | 197 | gpio_set_value(BABBAGE_USB_PHY_RESET, 1); |
198 | } | 198 | gpio_free_array(mx51_babbage_usbh1_gpios, |
199 | gpio_direction_output(BABBAGE_PHY_RESET, 1); | 199 | ARRAY_SIZE(mx51_babbage_usbh1_gpios)); |
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||