diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2011-11-28 14:34:24 +0900 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 16:52:02 +0530 |
commit | 8b5f5d8d5035974f87ae34d666b4d24c8af7e001 (patch) | |
tree | ab5155aafa3f8c98f5059d3b1063e7e22459f311 /arch/arm/mach-tegra/usb_phy.c | |
parent | 0626342fb086e56a91697d72b7396c7f85f868f9 (diff) |
usb: tegra: allow to use GPIO expander for VBUS
Change the GPIO VBUS control code to only call tegra_gpio_enable if the
gpio is in the range of Tegra-controlled gpios, and allow get/set to
sleep as i2c gpio controllers requires. This is safe as vbus
enable/disable is only called from preemptible context.
Bug 884315
Change-Id: I87d91c1030a7723ad0aafc61c377c5897d3ded9e
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-on: http://git-master/r/66874
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/usb_phy.c')
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index fab702a5bd72..532bf73c10d1 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -863,14 +863,14 @@ static void vbus_enable(struct tegra_usb_phy *phy) WARN_ON(1); return; } - tegra_gpio_enable(gpio); + if (gpio < TEGRA_NR_GPIOS) tegra_gpio_enable(gpio); gpio_status = gpio_direction_output(gpio, 1); if (gpio_status < 0) { printk("VBUS_USB request GPIO DIRECTION FAILED \n"); WARN_ON(1); return; } - gpio_set_value(gpio, 1); + gpio_set_value_cansleep(gpio, 1); #else if (phy->reg_vbus) regulator_enable(phy->reg_vbus); @@ -885,7 +885,7 @@ static void vbus_disable(struct tegra_usb_phy *phy) if (gpio == -1) return; - gpio_set_value(gpio, 0); + gpio_set_value_cansleep(gpio, 0); gpio_free(gpio); #else if (phy->reg_vbus) |