From: Grazvydas Ignotas Date: Mon, 25 Feb 2013 01:12:05 +0000 (+0200) Subject: usb: otg: twl4030-usb: don't enable PHY during init X-Git-Tag: sz_154~30 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19c0628debcf26100d09242dc686436035b4a140;p=pandora-kernel.git usb: otg: twl4030-usb: don't enable PHY during init There is no need to do it, otg.set_suspend(false) (which itself comes from runtime_pm OMAP glue calls) will enable it later anyway. This used to be the place where things were enabled if booted with cable connected before runtime_pm conversion, but now can be dropped. Signed-off-by: Grazvydas Ignotas --- diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 230dd2d9c2a8..26b2f6e86b07 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -569,19 +569,17 @@ static void twl4030_usb_phy_init(struct twl4030_usb *twl) { int status; + /* + * Start in sleep state, we'll get otg.set_suspend(false) call + * and power up when musb runtime_pm enable kicks in. + */ + __twl4030_phy_power(twl, 0); + twl->asleep = 1; + status = twl4030_usb_linkstat(twl); - if (status >= 0) { - if (status == USB_EVENT_NONE) { - __twl4030_phy_power(twl, 0); - twl->asleep = 1; - } else { - __twl4030_phy_resume(twl); - twl->asleep = 0; - } + atomic_notifier_call_chain(&twl->otg.notifier, status, + twl->otg.gadget); - atomic_notifier_call_chain(&twl->otg.notifier, status, - twl->otg.gadget); - } sysfs_notify(&twl->dev->kobj, NULL, "vbus"); } @@ -692,9 +690,6 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) return status; } - /* Power down phy or make it work according to - * current link state. - */ twl4030_usb_phy_init(twl); dev_info(&pdev->dev, "Initialized TWL4030 USB module\n");