From: b20788@freescale.com (Anson Huang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: correct usecount of IPG, ARM and MMDC clk on i.mx6sl
Date: Mon, 20 Jan 2014 18:44:50 +0800 [thread overview]
Message-ID: <1390214690-13564-1-git-send-email-b20788@freescale.com> (raw)
IPG, ARM and MMDC's clock should be enabled during kernel boot up,
so we need to maintain their use count, otherwise, they may be
disabled unexpectedly if their children's clock are turned off,
which is not allowed.
Signed-off-by: Anson Huang <b20788@freescale.com>
---
arch/arm/mach-imx/clk-imx6sl.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 78f3bd6..8d720f9 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -291,6 +291,21 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
pr_warn("%s: failed to set AHB clock rate %d!\n",
__func__, ret);
+ /* Correct usecount of IPG clk */
+ ret = clk_prepare_enable(clks[IMX6SL_CLK_IPG]);
+ if (ret)
+ pr_warn("%s: failed to enable IPG clock %d\n", __func__, ret);
+
+ /* Correct usecount of ARM clk */
+ ret = clk_prepare_enable(clks[IMX6SL_CLK_ARM]);
+ if (ret)
+ pr_warn("%s: failed to enable ARM clock %d\n", __func__, ret);
+
+ /* Correct usecount of MMDC clk */
+ ret = clk_prepare_enable(clks[IMX6SL_CLK_MMDC_ROOT]);
+ if (ret)
+ pr_warn("%s: failed to enable MMDC clock %d\n", __func__, ret);
+
if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
--
1.7.9.5
next reply other threads:[~2014-01-20 10:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 10:44 Anson Huang [this message]
2014-01-21 10:05 ` [PATCH] ARM: imx: correct usecount of IPG, ARM and MMDC clk on i.mx6sl Lucas Stach
2014-01-21 10:52 ` Anson.Huang at freescale.com
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=1390214690-13564-1-git-send-email-b20788@freescale.com \
--to=b20788@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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