aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mach-mx31_3ds.c
diff options
context:
space:
mode:
authorFabio Estevam <fabioestevam@yahoo.com>2010-06-21 16:33:05 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:18:31 -0400
commit41f634758a73ad2e8554382c5b5edaff011975b9 (patch)
tree38f78e0c2007db6d93f61770243fc6b4baf9aae0 /arch/arm/mach-mx3/mach-mx31_3ds.c
parentf747847e8f0312ddc50fe7cb7ed4f6399ec154e0 (diff)
mx31_3ds: Handle USB OTG GPIO Errors
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mach-mx31_3ds.c')
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 58e57291b79d..7e8d09ab9e6c 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -182,8 +182,10 @@ static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = {
182 182
183#define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) 183#define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR)
184 184
185static void mx31_3ds_usbotg_init(void) 185static int mx31_3ds_usbotg_init(void)
186{ 186{
187 int err;
188
187 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); 189 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG);
188 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); 190 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG);
189 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); 191 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG);
@@ -197,10 +199,25 @@ static void mx31_3ds_usbotg_init(void)
197 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); 199 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG);
198 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); 200 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG);
199 201
200 gpio_request(USBOTG_RST_B, "otgusb-reset"); 202 err = gpio_request(USBOTG_RST_B, "otgusb-reset");
201 gpio_direction_output(USBOTG_RST_B, 0); 203 if (err) {
204 pr_err("Failed to request the USB OTG reset gpio\n");
205 return err;
206 }
207
208 err = gpio_direction_output(USBOTG_RST_B, 0);
209 if (err) {
210 pr_err("Failed to drive the USB OTG reset gpio\n");
211 goto usbotg_free_reset;
212 }
213
202 mdelay(1); 214 mdelay(1);
203 gpio_set_value(USBOTG_RST_B, 1); 215 gpio_set_value(USBOTG_RST_B, 1);
216 return 0;
217
218usbotg_free_reset:
219 gpio_free(USBOTG_RST_B);
220 return err;
204} 221}
205 222
206static struct fsl_usb2_platform_data usbotg_pdata = { 223static struct fsl_usb2_platform_data usbotg_pdata = {