Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303811
b: refs/heads/master
c: 1ec9c8a
h: refs/heads/master
i:
  303809: 23c7995
  303807: 9a2c6b9
v: v3
  • Loading branch information
Shimoda, Yoshihiro authored and Felipe Balbi committed May 4, 2012
1 parent 2c44f2f commit 7183a01
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 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: 00c16f9f916eef8999065f72567c7cf08582517c
refs/heads/master: 1ec9c8a299a4a45ab3e08ba594eec82c425d0918
15 changes: 14 additions & 1 deletion trunk/drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ __acquires(r8a66597->lock)

switch (ctrl->bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:
status = 1 << USB_DEVICE_SELF_POWERED;
status = r8a66597->device_status;
break;
case USB_RECIP_INTERFACE:
status = 0;
Expand Down Expand Up @@ -1800,11 +1800,24 @@ static int r8a66597_pullup(struct usb_gadget *gadget, int is_on)
return 0;
}

static int r8a66597_set_selfpowered(struct usb_gadget *gadget, int is_self)
{
struct r8a66597 *r8a66597 = gadget_to_r8a66597(gadget);

if (is_self)
r8a66597->device_status |= 1 << USB_DEVICE_SELF_POWERED;
else
r8a66597->device_status &= ~(1 << USB_DEVICE_SELF_POWERED);

return 0;
}

static struct usb_gadget_ops r8a66597_gadget_ops = {
.get_frame = r8a66597_get_frame,
.udc_start = r8a66597_start,
.udc_stop = r8a66597_stop,
.pullup = r8a66597_pullup,
.set_selfpowered = r8a66597_set_selfpowered,
};

static int __exit r8a66597_remove(struct platform_device *pdev)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/gadget/r8a66597-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct r8a66597 {
u16 old_vbus;
u16 scount;
u16 old_dvsq;
u16 device_status; /* for GET_STATUS */

/* pipe config */
unsigned char bulk;
Expand Down

0 comments on commit 7183a01

Please sign in to comment.