提交 fba9e546 编写于 作者: H Heiko Stübner 提交者: Greg Kroah-Hartman

s3c-hsudc: implement vbus_draw hook

When a transceiver is available use otg_set_power to submit
the target current to it.
Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e538dfda
......@@ -1241,10 +1241,24 @@ static int s3c_hsudc_gadget_getframe(struct usb_gadget *gadget)
return s3c_hsudc_read_frameno(to_hsudc(gadget));
}
static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA)
{
struct s3c_hsudc *hsudc = the_controller;
if (!hsudc)
return -ENODEV;
if (hsudc->transceiver)
return otg_set_power(hsudc->transceiver, mA);
return -EOPNOTSUPP;
}
static struct usb_gadget_ops s3c_hsudc_gadget_ops = {
.get_frame = s3c_hsudc_gadget_getframe,
.start = s3c_hsudc_start,
.stop = s3c_hsudc_stop,
.vbus_draw = s3c_hsudc_vbus_draw,
};
static int s3c_hsudc_probe(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册