Hello. On 13-12-2011 16:13, Neil Zhang wrote:
This patch impletments system suspend/resume functions for Marvell
Implements.
otg controller. If OTG is enabled, OTG driver will do most of the work. If not, we will check clock gating. If clock gating is enabled, the UDC will be start/stop automatically.
Started/stopped.
If not, UDC will be start/stop in suspend/resume functions.
Same here.
Signed-off-by: Neil Zhang<zhangwm@xxxxxxxxxxx> --- drivers/usb/gadget/mv_udc_core.c | 47 +++++++++++++++++++++++++++++--------- 1 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 251bc0d..316dc0d 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -2384,7 +2384,30 @@ static int mv_udc_suspend(struct device *_dev) { struct mv_udc *udc = the_controller; - udc_stop(udc); + /* if OTG is enabled, the following will be done in OTG driver*/
Add space before */ please.
+ if (udc->transceiver) + return 0; + + if (udc->pdata->vbus && udc->pdata->vbus->poll) + if (udc->pdata->vbus->poll() == VBUS_HIGH) { + dev_info(&udc->dev->dev, "USB cable is connected!\n"); + return -EAGAIN; + } + + /* + * only cable is unplugged, udc can suspend.
Missed "ïf" or "when" here... WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html