summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]arch/arm/mach-tegra/usb_phy.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index ef22c89e59f5..adf7a4f3aad1 100644..100755
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -1923,6 +1923,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
unsigned long parent_rate;
int i;
int err;
+ int reset_gpio, enable_gpio;
phy = kzalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
if (!phy)
@@ -2005,27 +2006,29 @@ struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
#ifndef CONFIG_ARCH_TEGRA_2x_SOC
else if (phy->usb_phy_type == TEGRA_USB_PHY_TYPE_HSIC) {
uhsic_config = config;
- gpio_request(uhsic_config->enable_gpio,
+ enable_gpio = gpio_request(uhsic_config->enable_gpio,
"uhsic_enable");
- if (uhsic_config->reset_gpio != -1)
- gpio_request(uhsic_config->reset_gpio,
+ reset_gpio = gpio_request(uhsic_config->reset_gpio,
"uhsic_reset");
/* hsic enable signal deasserted, hsic reset asserted */
- gpio_direction_output(uhsic_config->enable_gpio,
+ if (!enable_gpio)
+ gpio_direction_output(uhsic_config->enable_gpio,
0 /* deasserted */);
- if (uhsic_config->reset_gpio != -1)
+ if (!reset_gpio)
gpio_direction_output(uhsic_config->reset_gpio,
0 /* asserted */);
- tegra_gpio_enable(uhsic_config->enable_gpio);
- if (uhsic_config->reset_gpio != -1)
+ if (!enable_gpio)
+ tegra_gpio_enable(uhsic_config->enable_gpio);
+ if (!reset_gpio)
tegra_gpio_enable(uhsic_config->reset_gpio);
/* keep hsic reset asserted for 1 ms */
udelay(1000);
/* enable (power on) hsic */
- gpio_set_value_cansleep(uhsic_config->enable_gpio, 1);
+ if (!enable_gpio)
+ gpio_set_value_cansleep(uhsic_config->enable_gpio, 1);
udelay(1000);
/* deassert reset */
- if (uhsic_config->reset_gpio != -1)
+ if (!reset_gpio)
gpio_set_value_cansleep(uhsic_config->reset_gpio, 1);
}
#endif