diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-17 22:33:54 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-22 02:39:37 +0300 |
commit | 15837236386191f2a26706b5ee56cdb4ab28e6d5 (patch) | |
tree | dd84bb180cbecfe09bbab7bd1950ba7d87485a1b /drivers/usb/musb-new/sunxi.c | |
parent | fd1bd21bf07d0770bff7b477d501b706dac9987d (diff) | |
download | u-boot-15837236386191f2a26706b5ee56cdb4ab28e6d5.tar.xz |
musb: Allow musb_platform_enable to return an error code
Allow musb_platform_enable to return an error code and propagate it up to
usb_lowlevel_init().
This allows moving the checks for an external vbus being present to be
moved from platform_init to platform_enable, so that the user can unplug a
charger, plug in a host adapter with a usb-device, do a "usb reset" and
have things working.
This also allows adding a check for the id-pin to platform_enable, so that
it can short circuit the 1s delay in usb_lowlevel_init() when no host cable
is plugged in and thus waiting for a device to show up is useless.
Note that all the changes to code shared with the kernel are wrapped in
the kernel.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb/musb-new/sunxi.c')
-rw-r--r-- | drivers/usb/musb-new/sunxi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index 052e0657d0..c123d61af2 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -199,12 +199,12 @@ static irqreturn_t sunxi_musb_interrupt(int irq, void *__hci) /* musb_core does not call enable / disable in a balanced manner <sigh> */ static bool enabled = false; -static void sunxi_musb_enable(struct musb *musb) +static int sunxi_musb_enable(struct musb *musb) { pr_debug("%s():\n", __func__); if (enabled) - return; + return 0; /* select PIO mode */ musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0); @@ -215,6 +215,7 @@ static void sunxi_musb_enable(struct musb *musb) USBC_ForceVbusValidToHigh(musb->mregs); enabled = true; + return 0; } static void sunxi_musb_disable(struct musb *musb) |