提交 8ca13756 编写于 作者: Y Yoshihiro Shimoda 提交者: Felipe Balbi

usb: gadget: r8a66597-udc: add pullup function

Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 57c97c02
......@@ -1518,10 +1518,26 @@ static int r8a66597_get_frame(struct usb_gadget *_gadget)
return r8a66597_read(r8a66597, FRMNUM) & 0x03FF;
}
static int r8a66597_pullup(struct usb_gadget *gadget, int is_on)
{
struct r8a66597 *r8a66597 = gadget_to_r8a66597(gadget);
unsigned long flags;
spin_lock_irqsave(&r8a66597->lock, flags);
if (is_on)
r8a66597_bset(r8a66597, DPRPU, SYSCFG0);
else
r8a66597_bclr(r8a66597, DPRPU, SYSCFG0);
spin_unlock_irqrestore(&r8a66597->lock, flags);
return 0;
}
static struct usb_gadget_ops r8a66597_gadget_ops = {
.get_frame = r8a66597_get_frame,
.start = r8a66597_start,
.stop = r8a66597_stop,
.pullup = r8a66597_pullup,
};
static int __exit r8a66597_remove(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册