From 15837236386191f2a26706b5ee56cdb4ab28e6d5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 17 Jun 2015 21:33:54 +0200 Subject: 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 Acked-by: Simon Glass --- drivers/usb/musb-new/musb_dsps.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/usb/musb-new/musb_dsps.c') diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c index 17ed224488..895939773a 100644 --- a/drivers/usb/musb-new/musb_dsps.c +++ b/drivers/usb/musb-new/musb_dsps.c @@ -156,7 +156,11 @@ struct dsps_glue { /** * dsps_musb_enable - enable interrupts */ +#ifndef __UBOOT__ static void dsps_musb_enable(struct musb *musb) +#else +static int dsps_musb_enable(struct musb *musb) +#endif { #ifndef __UBOOT__ struct device *dev = musb->controller; @@ -181,6 +185,8 @@ static void dsps_musb_enable(struct musb *musb) if (is_otg_enabled(musb)) dsps_writel(reg_base, wrp->coreintr_set, (1 << wrp->drvvbus) << wrp->usb_shift); +#else + return 0; #endif } -- cgit v1.2.1