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>
This commit is contained in:
parent
2e7b1bfcb9
commit
72370a5cc2
1 changed files with 13 additions and 14 deletions
|
@ -172,6 +172,11 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
|
||||||
.bitrate = 400000,
|
.bitrate = 400000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct gpio mx51_babbage_usbh1_gpios[] = {
|
||||||
|
{ BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp" },
|
||||||
|
{ BABBAGE_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, "usbh1_phy_reset" },
|
||||||
|
};
|
||||||
|
|
||||||
static int gpio_usbh1_active(void)
|
static int gpio_usbh1_active(void)
|
||||||
{
|
{
|
||||||
iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
|
iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
|
||||||
|
@ -179,25 +184,19 @@ static int gpio_usbh1_active(void)
|
||||||
|
|
||||||
/* Set USBH1_STP to GPIO and toggle it */
|
/* Set USBH1_STP to GPIO and toggle it */
|
||||||
mxc_iomux_v3_setup_pad(usbh1stp_gpio);
|
mxc_iomux_v3_setup_pad(usbh1stp_gpio);
|
||||||
ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp");
|
ret = gpio_request_array(mx51_babbage_usbh1_gpios,
|
||||||
|
ARRAY_SIZE(mx51_babbage_usbh1_gpios));
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret);
|
pr_debug("failed to get USBH1 pins: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
gpio_direction_output(BABBAGE_USBH1_STP, 0);
|
|
||||||
gpio_set_value(BABBAGE_USBH1_STP, 1);
|
|
||||||
msleep(100);
|
msleep(100);
|
||||||
gpio_free(BABBAGE_USBH1_STP);
|
gpio_set_value(BABBAGE_USBH1_STP, 1);
|
||||||
|
gpio_set_value(BABBAGE_USB_PHY_RESET, 1);
|
||||||
/* De-assert USB PHY RESETB */
|
gpio_free_array(mx51_babbage_usbh1_gpios,
|
||||||
ret = gpio_request(BABBAGE_USB_PHY_RESET, "phy_reset");
|
ARRAY_SIZE(mx51_babbage_usbh1_gpios));
|
||||||
|
|
||||||
if (ret) {
|
|
||||||
pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
gpio_direction_output(BABBAGE_USB_PHY_RESET, 1);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue