summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/usb_phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/usb_phy.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 2a7364c12753..b5d3dc575e0c 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -79,6 +79,7 @@ static void print_usb_plat_data_info(struct tegra_usb_phy *phy)
? "enabled" : "disabled");
} else {
pr_info("vbus_gpio: %d\n", pdata->u_data.host.vbus_gpio);
+ pr_info("vbus_gpio_inverted: %d\n", pdata->u_data.host.vbus_gpio_inverted);
pr_info("vbus_reg: %s\n", pdata->u_data.host.vbus_reg ?
pdata->u_data.host.vbus_reg : "NULL");
pr_info("hot_plug: %s\n", pdata->u_data.host.hot_plug ?
@@ -99,7 +100,7 @@ static void usb_host_vbus_enable(struct tegra_usb_phy *phy, bool enable)
int gpio = phy->pdata->u_data.host.vbus_gpio;
if (gpio == -1)
return;
- gpio_set_value_cansleep(gpio, enable ? 1 : 0);
+ gpio_set_value_cansleep(gpio, (enable != phy->pdata->u_data.host.vbus_gpio_inverted)? 1 : 0);
}
}
@@ -326,7 +327,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct platform_device *pdev)
req failed\n", phy->inst);
goto fail_init;
}
- if (gpio_direction_output(gpio, 1) < 0) {
+ if (gpio_direction_output(gpio, !phy->pdata->u_data.host.vbus_gpio_inverted) < 0) {
ERR("inst:[%d] host vbus gpio \
dir failed\n", phy->inst);
goto fail_init;
@@ -369,7 +370,7 @@ fail_init:
else {
int gpio = phy->pdata->u_data.host.vbus_gpio;
if (gpio != -1) {
- gpio_set_value_cansleep(gpio, 0);
+ gpio_set_value_cansleep(gpio, phy->pdata->u_data.host.vbus_gpio_inverted);
gpio_free(gpio);
}
}
@@ -386,6 +387,7 @@ fail_nomem:
fail_inval:
return ERR_PTR(err);
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_open);
void tegra_usb_phy_close(struct tegra_usb_phy *phy)
{
@@ -410,7 +412,7 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
else {
int gpio = phy->pdata->u_data.host.vbus_gpio;
if (gpio != -1) {
- gpio_set_value_cansleep(gpio, 0);
+ gpio_set_value_cansleep(gpio, phy->pdata->u_data.host.vbus_gpio_inverted);
gpio_free(gpio);
}
}
@@ -427,6 +429,7 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
devm_kfree(&phy->pdev->dev, phy->pdata);
devm_kfree(&phy->pdev->dev, phy);
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_close);
irqreturn_t tegra_usb_phy_irq(struct tegra_usb_phy *phy)
{
@@ -452,6 +455,7 @@ int tegra_usb_phy_init(struct tegra_usb_phy *phy)
return status;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_init);
int tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
{
@@ -502,6 +506,7 @@ int tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
return err;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_power_off);
int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
{
@@ -546,6 +551,7 @@ int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
return status;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_power_on);
int tegra_usb_phy_reset(struct tegra_usb_phy *phy)
{
@@ -685,6 +691,7 @@ bool tegra_usb_phy_charger_detected(struct tegra_usb_phy *phy)
return status;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_charger_detected);
bool tegra_usb_phy_hw_accessible(struct tegra_usb_phy *phy)
{
@@ -704,11 +711,13 @@ bool tegra_usb_phy_has_hostpc(struct tegra_usb_phy *phy)
{
return phy->pdata->has_hostpc;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_has_hostpc);
bool tegra_usb_phy_otg_supported(struct tegra_usb_phy *phy)
{
return phy->pdata->port_otg;
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_otg_supported);
void tegra_usb_phy_memory_prefetch_on(struct tegra_usb_phy *phy)
{
@@ -724,6 +733,7 @@ void tegra_usb_phy_memory_prefetch_on(struct tegra_usb_phy *phy)
writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG2);
}
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_memory_prefetch_on);
void tegra_usb_phy_memory_prefetch_off(struct tegra_usb_phy *phy)
{
@@ -739,3 +749,4 @@ void tegra_usb_phy_memory_prefetch_off(struct tegra_usb_phy *phy)
writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG2);
}
}
+EXPORT_SYMBOL_GPL(tegra_usb_phy_memory_prefetch_off);