summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pxa25x_udc.c
diff options
context:
space:
mode:
authorIan Molton <spyro@f2s.com>2008-06-25 22:34:51 +0100
committerIan Molton <spyro@f2s.com>2008-07-10 20:15:10 +0100
commit8fb105f5cc7f31ff37755945378a668f4c21590e (patch)
tree52f2b358d2f6f2c7cb2a9af1b9f022d539d06a2d /drivers/usb/gadget/pxa25x_udc.c
parentb3d354b8d8d676c97794a5b984613d51ad683f17 (diff)
downloadlinux-8fb105f5cc7f31ff37755945378a668f4c21590e.tar.gz
linux-8fb105f5cc7f31ff37755945378a668f4c21590e.tar.bz2
linux-8fb105f5cc7f31ff37755945378a668f4c21590e.zip
PXA UDC - allow use of inverted GPIO for pullup
Signed-off-by: Ian Molton <spyro@f2s.com>
Diffstat (limited to 'drivers/usb/gadget/pxa25x_udc.c')
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 031dceb93023..5d50031938ab 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -152,9 +152,10 @@ static int is_vbus_present(void)
static void pullup_off(void)
{
struct pxa2xx_udc_mach_info *mach = the_controller->mach;
+ int off_level = mach->gpio_pullup_inverted;
if (mach->gpio_pullup)
- gpio_set_value(mach->gpio_pullup, 0);
+ gpio_set_value(mach->gpio_pullup, off_level);
else if (mach->udc_command)
mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
}
@@ -162,9 +163,10 @@ static void pullup_off(void)
static void pullup_on(void)
{
struct pxa2xx_udc_mach_info *mach = the_controller->mach;
+ int on_level = !mach->gpio_pullup_inverted;
if (mach->gpio_pullup)
- gpio_set_value(mach->gpio_pullup, 1);
+ gpio_set_value(mach->gpio_pullup, on_level);
else if (mach->udc_command)
mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
}