aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/r8a66597-udc.c
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2011-07-06 20:58:20 -0400
committerFelipe Balbi <balbi@ti.com>2011-07-08 18:08:38 -0400
commit8ca137562a79f573f822f5a84a4e56a0d8cc6792 (patch)
treecf5a8e8e6233fc7bada218e9e040a19d5fcb13e3 /drivers/usb/gadget/r8a66597-udc.c
parent57c97c02de0e7a59cb48d3d7666f4afaf9968e84 (diff)
usb: gadget: r8a66597-udc: add pullup function
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/r8a66597-udc.c')
-rw-r--r--drivers/usb/gadget/r8a66597-udc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index b8b30059f8af..50991e5bd5e8 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1518,10 +1518,26 @@ static int r8a66597_get_frame(struct usb_gadget *_gadget)
1518 return r8a66597_read(r8a66597, FRMNUM) & 0x03FF; 1518 return r8a66597_read(r8a66597, FRMNUM) & 0x03FF;
1519} 1519}
1520 1520
1521static int r8a66597_pullup(struct usb_gadget *gadget, int is_on)
1522{
1523 struct r8a66597 *r8a66597 = gadget_to_r8a66597(gadget);
1524 unsigned long flags;
1525
1526 spin_lock_irqsave(&r8a66597->lock, flags);
1527 if (is_on)
1528 r8a66597_bset(r8a66597, DPRPU, SYSCFG0);
1529 else
1530 r8a66597_bclr(r8a66597, DPRPU, SYSCFG0);
1531 spin_unlock_irqrestore(&r8a66597->lock, flags);
1532
1533 return 0;
1534}
1535
1521static struct usb_gadget_ops r8a66597_gadget_ops = { 1536static struct usb_gadget_ops r8a66597_gadget_ops = {
1522 .get_frame = r8a66597_get_frame, 1537 .get_frame = r8a66597_get_frame,
1523 .start = r8a66597_start, 1538 .start = r8a66597_start,
1524 .stop = r8a66597_stop, 1539 .stop = r8a66597_stop,
1540 .pullup = r8a66597_pullup,
1525}; 1541};
1526 1542
1527static int __exit r8a66597_remove(struct platform_device *pdev) 1543static int __exit r8a66597_remove(struct platform_device *pdev)