From: Shawn Guo <shawn.guo@linaro.org>
To: Gary Zhang <b13634@freescale.com>
Cc: <kernel@pengutronix.de>, <linux@arm.linux.org.uk>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] ARM: imx: set CKO1 parent clock source in imx6q sabresd
Date: Tue, 29 Jan 2013 19:28:48 +0800 [thread overview]
Message-ID: <20130129112846.GG21504@S2101-09.ap.freescale.net> (raw)
In-Reply-To: <1359445779-2038-1-git-send-email-b13634@freescale.com>
Gary,
For arch/arm/ patches, list linux-arm-kernel@lists.infradead.org rather
than linux-kernel@vger.kernel.org should be copied.
One comment blow.
On Tue, Jan 29, 2013 at 03:49:39PM +0800, Gary Zhang wrote:
> in imx6q sabresd board, wm8962 uses CKO1 as MCLK. set ahb as CKO1
> parent clock source
>
> Signed-off-by: Gary Zhang <b13634@freescale.com>
> ---
> arch/arm/mach-imx/mach-imx6q.c | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 4eb1b3a..ee3f357 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -151,6 +151,36 @@ static void __init imx6q_sabrelite_init(void)
> imx6q_sabrelite_cko1_setup();
> }
>
> +static void __init imx6q_sabresd_cko1_setup(void)
> +{
> + struct clk *cko1_sel, *ahb, *cko1;
> + unsigned long rate;
> +
> + cko1_sel = clk_get_sys(NULL, "cko1_sel");
> + ahb = clk_get_sys(NULL, "ahb");
> + cko1 = clk_get_sys(NULL, "cko1");
> + if (IS_ERR(cko1_sel) || IS_ERR(ahb) || IS_ERR(cko1)) {
> + pr_err("cko1 setup failed!\n");
> + goto put_clk;
> + }
> + clk_set_parent(cko1_sel, ahb);
> + rate = clk_round_rate(cko1, 24000000);
> + clk_set_rate(cko1, rate);
> +
> + return;
> +put_clk:
> + if (!IS_ERR(cko1_sel))
> + clk_put(cko1_sel);
> + if (!IS_ERR(ahb))
> + clk_put(ahb);
> + if (!IS_ERR(cko1))
> + clk_put(cko1);
> +}
So the only difference between this function and imx6q_sabrelite_cko1_setup()
is the frequency set on cko1? If so, we should consolidate them with
frequency passed in as a parameter.
Shawn
> +static void __init imx6q_sabresd_init(void)
> +{
> + imx6q_sabresd_cko1_setup();
> +}
> +
> static void __init imx6q_1588_init(void)
> {
> struct regmap *gpr;
> @@ -193,6 +223,8 @@ static void __init imx6q_init_machine(void)
> {
> if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
> imx6q_sabrelite_init();
> + else if (of_machine_is_compatible("fsl,imx6q-sabresd"))
> + imx6q_sabresd_init();
>
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>
> --
> 1.7.0.4
>
>
next prev parent reply other threads:[~2013-01-29 11:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 7:49 Gary Zhang
2013-01-29 11:28 ` Shawn Guo [this message]
2013-01-31 2:55 ` Zhang Quan-B13634
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=20130129112846.GG21504@S2101-09.ap.freescale.net \
--to=shawn.guo@linaro.org \
--cc=b13634@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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®