From patchwork Mon Oct 14 15:24:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 3037501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A00B5BF924 for ; Mon, 14 Oct 2013 16:03:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 166EC20221 for ; Mon, 14 Oct 2013 16:03:48 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24491201FF for ; Mon, 14 Oct 2013 16:03:46 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVk5h-0003x2-IX; Mon, 14 Oct 2013 15:29:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVk4p-0002Wu-2B; Mon, 14 Oct 2013 15:28:59 +0000 Received: from ns.mm-sol.com ([212.124.72.66] helo=extserv.mm-sol.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVk2m-0002Hy-4h for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2013 15:27:11 +0000 Received: from iivanov-dev.int.mm-sol.com (unknown [172.18.0.3]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 600724F888; Mon, 14 Oct 2013 18:26:03 +0300 (EEST) From: "Ivan T. Ivanov" To: balbi@ti.com Subject: [PATCH v3 10/13] usb: phy: msm: Switch clock consumer strings Date: Mon, 14 Oct 2013 18:24:37 +0300 Message-Id: <1381764280-28420-11-git-send-email-iivanov@mm-sol.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381764280-28420-1-git-send-email-iivanov@mm-sol.com> References: <1381764280-28420-1-git-send-email-iivanov@mm-sol.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131014_112653_891184_D0D0ED6E X-CRM114-Status: GOOD ( 15.79 ) X-Spam-Score: 0.6 (/) Cc: mark.rutland@arm.com, linux-doc@vger.kernel.org, dwalker@fifo99.com, linux@arm.linux.org.uk, swarren@wwwdotorg.org, grant.likely@linaro.org, davidb@codeaurora.org, devicetree@vger.kernel.org, jackp@codeaurora.org, rob@landley.net, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, linux-arm-msm@vger.kernel.org, rob.herring@calxeda.com, linux-arm-kernel@lists.infradead.org, dsegal@codeaurora.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Stephen Boyd , linux-kernel@vger.kernel.org, mgautam@codeaurora.org, bryanh@codeaurora.org, "Ivan T. Ivanov" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Ivan T. Ivanov" Replace the USB specific clock names in driver with the more standard 'core' and 'iface' ... names. Cc: David Brown Cc: Stephen Boyd Signed-off-by: Ivan T. Ivanov --- arch/arm/mach-msm/devices-msm7x00.c | 4 +- arch/arm/mach-msm/devices-msm7x30.c | 8 ++-- arch/arm/mach-msm/devices-qsd8x50.c | 6 +-- drivers/usb/phy/phy-msm-usb.c | 79 +++++++++++++++++++---------------- include/linux/usb/msm_hsusb.h | 14 +++---- 5 files changed, 58 insertions(+), 53 deletions(-) diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c index d83404d..e7274e1 100644 --- a/arch/arm/mach-msm/devices-msm7x00.c +++ b/arch/arm/mach-msm/devices-msm7x00.c @@ -461,8 +461,8 @@ static struct clk_pcom_desc msm_clocks_7x01a[] = { CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF), CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), - CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF), - CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, "msm_hsusb", OFF), + CLK_PCOM("core", USB_HS_CLK, "msm_hsusb", OFF), + CLK_PCOM("iface", USB_HS_P_CLK, "msm_hsusb", OFF), CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ), CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c index c15ea8a..b7d00fa 100644 --- a/arch/arm/mach-msm/devices-msm7x30.c +++ b/arch/arm/mach-msm/devices-msm7x30.c @@ -212,10 +212,10 @@ static struct clk_pcom_desc msm_clocks_7x30[] = { CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), CLK_PCOM("core", UART2_CLK, "msm_serial.1", 0), - CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), - CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), - CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), - CLK_PCOM("usb_hs_core_clk", USB_HS_CORE_CLK, NULL, OFF), + CLK_PCOM("phy", USB_PHY_CLK, NULL, 0), + CLK_PCOM("core", USB_HS_CLK, NULL, OFF), + CLK_PCOM("iface", USB_HS_P_CLK, NULL, OFF), + CLK_PCOM("alt_core", USB_HS_CORE_CLK, NULL, OFF), CLK_PCOM("usb_hs2_clk", USB_HS2_CLK, NULL, OFF), CLK_PCOM("usb_hs2_pclk", USB_HS2_P_CLK, NULL, OFF), CLK_PCOM("usb_hs2_core_clk", USB_HS2_CORE_CLK, NULL, OFF), diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c index 9e1e9ce..c9614b8 100644 --- a/arch/arm/mach-msm/devices-qsd8x50.c +++ b/arch/arm/mach-msm/devices-qsd8x50.c @@ -363,8 +363,8 @@ static struct clk_pcom_desc msm_clocks_8x50[] = { CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF), CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), - CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), - CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), + CLK_PCOM("core", USB_HS_CLK, NULL, OFF), + CLK_PCOM("iface", USB_HS_P_CLK, NULL, OFF), CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF | CLK_MIN), CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), @@ -374,7 +374,7 @@ static struct clk_pcom_desc msm_clocks_8x50[] = { CLK_PCOM("usb_hs2_pclk", USB_HS2_P_CLK, NULL, OFF), CLK_PCOM("usb_hs3_clk", USB_HS3_CLK, NULL, OFF), CLK_PCOM("usb_hs3_pclk", USB_HS3_P_CLK, NULL, OFF), - CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), + CLK_PCOM("phy", USB_PHY_CLK, NULL, 0), }; static struct pcom_clk_pdata msm_clock_8x50_pdata = { diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index c1020d9..0bd3ba5 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -262,7 +262,7 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert) if (!motg->pdata->link_clk_reset) return ret; - ret = motg->pdata->link_clk_reset(motg->clk, assert); + ret = motg->pdata->link_clk_reset(motg->core_clk, assert); if (ret) dev_err(motg->phy.dev, "usb link clk reset failed\n"); @@ -276,7 +276,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg) if (!motg->pdata->phy_clk_reset) return ret; - ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); + ret = motg->pdata->phy_clk_reset(motg->phy_clk); if (ret) dev_err(motg->phy.dev, "usb phy clk assert failed\n"); @@ -459,10 +459,10 @@ static int msm_otg_suspend(struct msm_otg *motg) motg->pdata->otg_control == OTG_PMIC_CONTROL) writel(readl(USB_PHY_CTRL) | PHY_RETEN, USB_PHY_CTRL); - clk_disable_unprepare(motg->pclk); - clk_disable_unprepare(motg->clk); - if (!IS_ERR(motg->core_clk)) - clk_disable_unprepare(motg->core_clk); + clk_disable_unprepare(motg->iface_clk); + clk_disable_unprepare(motg->core_clk); + if (!IS_ERR(motg->alt_core_clk)) + clk_disable_unprepare(motg->alt_core_clk); if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY && motg->pdata->otg_control == OTG_PMIC_CONTROL) { @@ -493,10 +493,10 @@ static int msm_otg_resume(struct msm_otg *motg) if (!atomic_read(&motg->in_lpm)) return 0; - clk_prepare_enable(motg->pclk); - clk_prepare_enable(motg->clk); - if (!IS_ERR(motg->core_clk)) - clk_prepare_enable(motg->core_clk); + clk_prepare_enable(motg->iface_clk); + clk_prepare_enable(motg->core_clk); + if (!IS_ERR(motg->alt_core_clk)) + clk_prepare_enable(motg->alt_core_clk); if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY && motg->pdata->otg_control == OTG_PMIC_CONTROL) { @@ -1372,16 +1372,16 @@ static int __init msm_otg_probe(struct platform_device *pdev) phy = &motg->phy; phy->dev = &pdev->dev; - motg->phy_reset_clk = devm_clk_get(&pdev->dev, "usb_phy_clk"); - if (IS_ERR(motg->phy_reset_clk)) { - dev_err(&pdev->dev, "failed to get usb_phy_clk\n"); - return PTR_ERR(motg->phy_reset_clk); + motg->phy_clk = devm_clk_get(&pdev->dev, "phy"); + if (IS_ERR(motg->phy_clk)) { + dev_err(&pdev->dev, "failed to get phy clock\n"); + return PTR_ERR(motg->phy_clk); } - motg->clk = devm_clk_get(&pdev->dev, "usb_hs_clk"); - if (IS_ERR(motg->clk)) { - dev_err(&pdev->dev, "failed to get usb_hs_clk\n"); - return PTR_ERR(motg->clk); + motg->core_clk = devm_clk_get(&pdev->dev, "core"); + if (IS_ERR(motg->core_clk)) { + dev_err(&pdev->dev, "failed to get core clock\n"); + return PTR_ERR(motg->core_clk); } /* @@ -1390,18 +1390,22 @@ static int __init msm_otg_probe(struct platform_device *pdev) * operation and USB core cannot tolerate frequency changes on * CORE CLK. */ - motg->pclk = devm_clk_get(&pdev->dev, "usb_hs_pclk"); - if (IS_ERR(motg->pclk)) { - dev_err(&pdev->dev, "failed to get usb_hs_pclk\n"); - return PTR_ERR(motg->pclk); + + motg->iface_clk = devm_clk_get(&pdev->dev, "iface"); + if (IS_ERR(motg->iface_clk)) { + dev_err(&pdev->dev, "failed to get iface clock\n"); + return PTR_ERR(motg->iface_clk); } /* - * USB core clock is not present on all MSM chips. This + * USB alt_core clock is not present on all MSM chips. This * clock is introduced to remove the dependency on AXI * bus frequency. + * + * Targets on which link uses asynchronous reset methodology, + * free running clock is not required during the reset. */ - motg->core_clk = devm_clk_get(&pdev->dev, "usb_hs_core_clk"); + motg->alt_core_clk = devm_clk_get(&pdev->dev, "alt_core"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); motg->regs = devm_ioremap_resource(&pdev->dev, res); @@ -1434,13 +1438,13 @@ static int __init msm_otg_probe(struct platform_device *pdev) return PTR_ERR(motg->v1p8); } - clk_set_rate(motg->clk, 60000000); + clk_set_rate(motg->core_clk, 60000000); - clk_prepare_enable(motg->clk); - clk_prepare_enable(motg->pclk); + clk_prepare_enable(motg->core_clk); + clk_prepare_enable(motg->iface_clk); - if (!IS_ERR(motg->core_clk)) - clk_prepare_enable(motg->core_clk); + if (!IS_ERR(motg->alt_core_clk)) + clk_prepare_enable(motg->alt_core_clk); ret = msm_hsusb_init_vddcx(motg, 1); if (ret) { @@ -1506,10 +1510,10 @@ disable_ldo: disable_vddcx: msm_hsusb_init_vddcx(motg, 0); disable_clks: - clk_disable_unprepare(motg->pclk); - clk_disable_unprepare(motg->clk); - if (!IS_ERR(motg->core_clk)) - clk_disable_unprepare(motg->core_clk); + clk_disable_unprepare(motg->iface_clk); + clk_disable_unprepare(motg->core_clk); + if (!IS_ERR(motg->alt_core_clk)) + clk_disable_unprepare(motg->alt_core_clk); return ret; } @@ -1550,10 +1554,11 @@ static int msm_otg_remove(struct platform_device *pdev) if (cnt >= PHY_SUSPEND_TIMEOUT_USEC) dev_err(phy->dev, "Unable to suspend PHY\n"); - clk_disable_unprepare(motg->pclk); - clk_disable_unprepare(motg->clk); - if (!IS_ERR(motg->core_clk)) - clk_disable_unprepare(motg->core_clk); + clk_disable_unprepare(motg->iface_clk); + clk_disable_unprepare(motg->core_clk); + if (!IS_ERR(motg->alt_core_clk)) + clk_disable_unprepare(motg->alt_core_clk); + msm_hsusb_ldo_init(motg, 0); pm_runtime_set_suspended(&pdev->dev); diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 262ed80..f1b98f2 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h @@ -124,10 +124,10 @@ struct msm_otg_platform_data { * @otg: USB OTG Transceiver structure. * @pdata: otg device platform data. * @irq: IRQ number assigned for HSUSB controller. - * @clk: clock struct of usb_hs_clk. - * @pclk: clock struct of usb_hs_pclk. - * @phy_reset_clk: clock struct of usb_phy_clk. - * @core_clk: clock struct of usb_hs_core_clk. + * @core_clk: reference to core clock struct. + * @iface_clk: reference to interface clock struct. + * @phy_clk: reference to PHY clock struct. + * @alt_core_clk: reference to alternative clock struct * @regs: ioremapped register base address. * @inputs: OTG state machine inputs(Id, SessValid etc). * @sm_work: OTG state machine work. @@ -144,10 +144,10 @@ struct msm_otg { struct usb_phy phy; struct msm_otg_platform_data *pdata; int irq; - struct clk *clk; - struct clk *pclk; - struct clk *phy_reset_clk; struct clk *core_clk; + struct clk *iface_clk; + struct clk *phy_clk; + struct clk *alt_core_clk; void __iomem *regs; #define ID 0 #define B_SESS_VLD 1