From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: balbi@ti.com
Cc: rob.herring@calxeda.com, pawel.moll@arm.com,
mark.rutland@arm.com, swarren@wwwdotorg.org,
ijc+devicetree@hellion.org.uk, rob@landley.net,
davidb@codeaurora.org, dwalker@fifo99.com, bryanh@codeaurora.org,
linux@arm.linux.org.uk, gregkh@linuxfoundation.org,
grant.likely@linaro.org, jackp@codeaurora.org,
mgautam@codeaurora.org, dsegal@codeaurora.org,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
Stephen Boyd <sboyd@codeaurora.org>
Subject: [PATCH v3 10/13] usb: phy: msm: Switch clock consumer strings
Date: Mon, 14 Oct 2013 18:24:37 +0300 [thread overview]
Message-ID: <1381764280-28420-11-git-send-email-iivanov@mm-sol.com> (raw)
In-Reply-To: <1381764280-28420-1-git-send-email-iivanov@mm-sol.com>
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Replace the USB specific clock names in driver
with the more standard 'core' and 'iface' ... names.
Cc: David Brown <davidb@codeaurora.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
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
--
1.7.9.5
next prev parent reply other threads:[~2013-10-14 15:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 15:24 [PATCH v3 00/13] usb: phy: msm: Fixes, cleanups and DT support Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 01/13] usb: phy: msm: Move mach depndend code to platform data Ivan T. Ivanov
2013-10-14 22:52 ` Felipe Balbi
2013-10-15 7:01 ` Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 02/13] usb: phy: msm: Move global regulators variables to driver state Ivan T. Ivanov
2013-10-14 22:52 ` Felipe Balbi
2013-10-14 15:24 ` [PATCH v3 03/13] usb: phy: msm: Migrate to Managed Device Resource allocation Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 04/13] usb: phy: msm: Remove unnecessarily check for valid regulators Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 05/13] usb: phy: msm: Fix WARNING: quoted string split across lines Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 06/13] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 07/13] usb: phy: msm: Replace custom enum usb_mode_type with enum usb_dr_mode Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 08/13] usb: phy: msm: Drop default usb_dr_mode from platform data Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 09/13] usb: phy: msm: Remove unused pclk_src_name Ivan T. Ivanov
2013-10-14 15:24 ` Ivan T. Ivanov [this message]
2013-10-14 15:24 ` [PATCH v3 11/13] usb: phy: msm: Remove HSUSB prefix from requlator names Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 12/13] usb: phy: msm: Properly check core interrupt number Ivan T. Ivanov
2013-10-14 22:59 ` Felipe Balbi
2013-10-15 7:12 ` Ivan T. Ivanov
2013-10-14 15:24 ` [PATCH v3 13/13] usb: phy: msm: Add device tree support and binding information Ivan T. Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381764280-28420-11-git-send-email-iivanov@mm-sol.com \
--to=iivanov@mm-sol.com \
--cc=balbi@ti.com \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=dsegal@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jackp@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mgautam@codeaurora.org \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sboyd@codeaurora.org \
--cc=swarren@wwwdotorg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®