From patchwork Sun Mar 10 01:07:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 2242831 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E09E0DF2F2 for ; Sun, 10 Mar 2013 01:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450Ab3CJBQW (ORCPT ); Sat, 9 Mar 2013 20:16:22 -0500 Received: from mail-ea0-f176.google.com ([209.85.215.176]:52787 "EHLO mail-ea0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751356Ab3CJBQV (ORCPT ); Sat, 9 Mar 2013 20:16:21 -0500 Received: by mail-ea0-f176.google.com with SMTP id h10so690259eaj.35 for ; Sat, 09 Mar 2013 17:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=PbVYCCu4mOJ4GetuwpuDRkqVmuUGdAJKsqec3e7ESXk=; b=Xvt2Dbl5oqkCt5aezcEs5jL4VRxEgu7uU1xHYTH5Y3MksJA/Qwif1p97ka35jI9udU zd0UlJHK4rHXem/aVasBRR00sClu4ntAFNpfrTs2HpWE1s806s48tF6ccoc794RE5vOz i2V/hy1wZ0xCEIv8/pQh1oI+uFjR6cIIeJDWvDIpnx1ZA8CK/1URTqlQYdOk7bHwJtrK cfhOJoeoAijyYoKiBElhUQnvSmR7zrAh1eoZ1x9B7sbmBDmZ7mFOVJAWHQJHOYNj+Jki 9dLFDRrt7+HV6CjJd9LMc2aAIt6VphirnfAID4RIUPDh+GwGzST9sc5YwuBQvD4TURu6 Yc3w== X-Received: by 10.14.200.137 with SMTP id z9mr20862624een.20.1362877692613; Sat, 09 Mar 2013 17:08:12 -0800 (PST) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPS id ca4sm12081493eeb.15.2013.03.09.17.08.10 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 17:08:11 -0800 (PST) From: Grazvydas Ignotas To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Felipe Balbi , NeilBrown , Grazvydas Ignotas Subject: [PATCH 1/7] usb: otg: twl4030-usb: don't enable PHY during init Date: Sun, 10 Mar 2013 03:07:55 +0200 Message-Id: <1362877681-8102-2-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362877681-8102-1-git-send-email-notasas@gmail.com> References: <1362877681-8102-1-git-send-email-notasas@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- drivers/usb/otg/twl4030-usb.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index a994715..1515c0b 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -522,19 +522,17 @@ static void twl4030_usb_phy_init(struct twl4030_usb *twl) { enum omap_musb_vbus_id_status status; - status = twl4030_usb_linkstat(twl); - if (status > 0) { - if (status == OMAP_MUSB_VBUS_OFF || - status == OMAP_MUSB_ID_FLOAT) { - __twl4030_phy_power(twl, 0); - twl->asleep = 1; - } else { - __twl4030_phy_resume(twl); - twl->asleep = 0; - } + /* + * Start in sleep state, we'll get called through set_suspend() + * callback when musb is runtime resumed and it's time to start. + */ + __twl4030_phy_power(twl, 0); + twl->asleep = 1; + status = twl4030_usb_linkstat(twl); + if (status > 0) omap_musb_mailbox(twl->linkstat); - } + sysfs_notify(&twl->dev->kobj, NULL, "vbus"); } @@ -649,9 +647,6 @@ static int 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");