aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2011-03-17 11:55:57 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-19 07:11:04 -0400
commit6f9ec442a07701e0ef241854862fdf2540be1bdb (patch)
treecc291be07bd36c1fd086ec2940078c89356fe001 /arch/arm/mach-mx5
parent2d95378b043f082192a11f8476e3f63291c3477b (diff)
ARM: mx5/babbage: Use gpio_request_one in babbage_usbhub_reset
Current code inside babbage_usbhub_reset uses gpio_direction_output with initial value of the GPIO and also sets the GPIO value via gpio_set_value to the same level right after. This is not needed. By using gpio_request_one it is possible to set the direction and initial value in one shot. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> LAKML-Reference: 1300377359-23212-2-git-send-email-fabio.estevam@freescale.com Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index bea4e4135f9..ab50aa9d268 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -208,18 +208,16 @@ static inline void babbage_usbhub_reset(void)
208{ 208{
209 int ret; 209 int ret;
210 210
211 /* Bring USB hub out of reset */ 211 /* Reset USB hub */
212 ret = gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7"); 212 ret = gpio_request_one(BABBAGE_USB_HUB_RESET,
213 GPIOF_OUT_INIT_LOW, "GPIO1_7");
213 if (ret) { 214 if (ret) {
214 printk(KERN_ERR"failed to get GPIO_USB_HUB_RESET: %d\n", ret); 215 printk(KERN_ERR"failed to get GPIO_USB_HUB_RESET: %d\n", ret);
215 return; 216 return;
216 } 217 }
217 gpio_direction_output(BABBAGE_USB_HUB_RESET, 0);
218 218
219 /* USB HUB RESET - De-assert USB HUB RESET_N */ 219 msleep(2);
220 msleep(1); 220 /* Deassert reset */
221 gpio_set_value(BABBAGE_USB_HUB_RESET, 0);
222 msleep(1);
223 gpio_set_value(BABBAGE_USB_HUB_RESET, 1); 221 gpio_set_value(BABBAGE_USB_HUB_RESET, 1);
224} 222}
225 223