From patchwork Sun Mar 24 23:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 10867791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF1F717EF for ; Sun, 24 Mar 2019 23:34:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCFD0290F2 for ; Sun, 24 Mar 2019 23:34:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB116290D9; Sun, 24 Mar 2019 23:34:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 630DD2858E for ; Sun, 24 Mar 2019 23:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729130AbfCXXe3 (ORCPT ); Sun, 24 Mar 2019 19:34:29 -0400 Received: from muru.com ([72.249.23.125]:42316 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727275AbfCXXe3 (ORCPT ); Sun, 24 Mar 2019 19:34:29 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 94C4880E1; Sun, 24 Mar 2019 23:34:42 +0000 (UTC) From: Tony Lindgren To: Bin Liu Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] usb: musb: omap2430: Add support for idling phy when musb is idle Date: Sun, 24 Mar 2019 16:34:26 -0700 Message-Id: <20190324233426.4176-1-tony@atomide.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I noticed that musb is blocking core retention for omap4 unlike for omap3. This is because for omap3 we have phy-twl4030-usb implement it's own PM runtime to handle errata "VUSB3V1 VBUS overvoltage debouncer not working when the PHY is powered down". That is done in order to keep the USB PHY powered when phy-twl4030-usb is loaded. For the other USB PHYs, we need to enable and disable the PHY based on musb PM runtime. With the session bit based PM runtime for musb core, we can now idle the USB PHY always when musb is idle. Note that adding these calls will not affect the twl4030 driver as it's phy functions will just query the PHY state without powering the PHY on or off. Signed-off-by: Tony Lindgren --- drivers/usb/musb/omap2430.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -531,6 +531,9 @@ static int omap2430_runtime_suspend(struct device *dev) omap2430_low_level_exit(musb); + phy_power_off(musb->phy); + phy_exit(musb->phy); + return 0; } @@ -542,6 +545,9 @@ static int omap2430_runtime_resume(struct device *dev) if (!musb) return 0; + phy_init(musb->phy); + phy_power_on(musb->phy); + omap2430_low_level_init(musb); musb_writel(musb->mregs, OTG_INTERFSEL, musb->context.otg_interfsel);