usb: musb: Return error value from musb_mailbox

At least on n900 we have phy-twl4030-usb only generating cable
interrupts, and then have a separate USB PHY.

In order for musb to know the real cable status, we need to
clear any cached state until musb is ready. Otherwise the cable
status interrupts will get just ignored if the status does
not change from the initial state.

To do this, let's add a return value to musb_mailbox(), and
reset cached linkstat to MUSB_UNKNOWN on error. Sorry to cause
a bit of churn here, I should have added that already last time
patching musb_mailbox().

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tony Lindgren
2016-05-31 10:05:19 -05:00
committed by Greg Kroah-Hartman
parent a118df07f5
commit 12b7db2bf8
6 changed files with 32 additions and 16 deletions

View File

@@ -142,10 +142,11 @@ enum musb_vbus_id_status {
};
#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
void musb_mailbox(enum musb_vbus_id_status status);
int musb_mailbox(enum musb_vbus_id_status status);
#else
static inline void musb_mailbox(enum musb_vbus_id_status status)
static inline int musb_mailbox(enum musb_vbus_id_status status)
{
return 0;
}
#endif