summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/s3c-hsudc.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2011-09-04 21:56:02 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-18 01:33:06 -0700
commitfba9e546eac984d46c4a16253344d7297c24d75c (patch)
tree987829f01db3de5f3ba0edee3001826184bb941f /drivers/usb/gadget/s3c-hsudc.c
parente538dfdae85244fd2c4231725d82cc1f1bc4942c (diff)
downloadblackbird-op-linux-fba9e546eac984d46c4a16253344d7297c24d75c.tar.gz
blackbird-op-linux-fba9e546eac984d46c4a16253344d7297c24d75c.zip
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: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/s3c-hsudc.c')
-rw-r--r--drivers/usb/gadget/s3c-hsudc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 25829b4398da..8d54f893cefe 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -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)
OpenPOWER on IntegriCloud