aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-05-28 09:54:36 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-07-07 03:59:56 -0400
commit72370a5cc28f9efc94a4d7d7dff2ebcb76139088 (patch)
tree9d7acd5a8b04ca565f81bf1a7a97ec2f68bef95b /arch/arm
parent2e7b1bfcb98dd232faf85b4a0a2611a49454c2ea (diff)
ARM: mx5/mx51_babbage: Use gpio_request_array for USBH1 pins
Instead of using gpio_request followed by gpio_direction_output use gpio_request_array when requesting multiple pins. Also fixed the location of the delay for the reset and make the BABBAGE_USB_PHY_RESET to toggle. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index 7b919bc8549c..770f74b5ea50 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -172,6 +172,11 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
172 .bitrate = 400000, 172 .bitrate = 400000,
173}; 173};
174 174
175static 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
175static int gpio_usbh1_active(void) 180static int gpio_usbh1_active(void)
176{ 181{
177 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;
@@ -179,25 +184,19 @@ static int gpio_usbh1_active(void)
179 184
180 /* Set USBH1_STP to GPIO and toggle it */ 185 /* Set USBH1_STP to GPIO and toggle it */
181 mxc_iomux_v3_setup_pad(usbh1stp_gpio); 186 mxc_iomux_v3_setup_pad(usbh1stp_gpio);
182 ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); 187 ret = gpio_request_array(mx51_babbage_usbh1_gpios,
188 ARRAY_SIZE(mx51_babbage_usbh1_gpios));
183 189
184 if (ret) { 190 if (ret) {
185 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);
186 return ret; 192 return ret;
187 } 193 }
188 gpio_direction_output(BABBAGE_USBH1_STP, 0);
189 gpio_set_value(BABBAGE_USBH1_STP, 1);
190 msleep(100);
191 gpio_free(BABBAGE_USBH1_STP);
192
193 /* De-assert USB PHY RESETB */
194 ret = gpio_request(BABBAGE_USB_PHY_RESET, "phy_reset");
195 194
196 if (ret) { 195 msleep(100);
197 pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret); 196 gpio_set_value(BABBAGE_USBH1_STP, 1);
198 return ret; 197 gpio_set_value(BABBAGE_USB_PHY_RESET, 1);
199 } 198 gpio_free_array(mx51_babbage_usbh1_gpios,
200 gpio_direction_output(BABBAGE_USB_PHY_RESET, 1); 199 ARRAY_SIZE(mx51_babbage_usbh1_gpios));
201 return 0; 200 return 0;
202} 201}
203 202