Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119441
b: refs/heads/master
c: 47fd6f7
h: refs/heads/master
i:
  119439: e4d56c4
v: v3
  • Loading branch information
Jaya Kumar authored and Russell King committed Nov 23, 2008
1 parent 2ca5e99 commit 910a614
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 844c6f6a36984c5fe1bcc2d68a88f2ed212d1eef
refs/heads/master: 47fd6f7c94e15eb5f97dd1cbb0427a46b03c8185
14 changes: 7 additions & 7 deletions trunk/drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ static int is_vbus_present(void)

if (mach->gpio_vbus) {
int value = gpio_get_value(mach->gpio_vbus);
return mach->gpio_vbus_inverted ? !value : value;

if (mach->gpio_vbus_inverted)
return !value;
else
return !!value;
}
if (mach->udc_is_connected)
return mach->udc_is_connected();
Expand Down Expand Up @@ -982,7 +986,7 @@ static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
struct pxa25x_udc *udc;

udc = container_of(_gadget, struct pxa25x_udc, gadget);
udc->vbus = (is_active != 0);
udc->vbus = is_active;
DMSG("vbus %s\n", is_active ? "supplied" : "inactive");
pullup(udc);
return 0;
Expand Down Expand Up @@ -1399,12 +1403,8 @@ lubbock_vbus_irq(int irq, void *_dev)
static irqreturn_t udc_vbus_irq(int irq, void *_dev)
{
struct pxa25x_udc *dev = _dev;
int vbus = gpio_get_value(dev->mach->gpio_vbus);

if (dev->mach->gpio_vbus_inverted)
vbus = !vbus;

pxa25x_udc_vbus_session(&dev->gadget, vbus);
pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present());
return IRQ_HANDLED;
}

Expand Down

0 comments on commit 910a614

Please sign in to comment.