linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH] ARM: SAMSUNG: Add s3c_setparent_clksrc in s3c_set_clksrc
Date: Wed, 21 Dec 2011 13:07:01 +0900	[thread overview]
Message-ID: <061a01ccbf95$fe1e6960$fa5b3c20$%kim@samsung.com> (raw)
In-Reply-To: <1323829221-14171-1-git-send-email-jhbird.choi@samsung.com>

jhbird.choi at samsung.com wrote:
> 
> From: Jonghwan Choi <jhbird.choi@samsung.com>
> 
> Currently we have to run clk_set_parent to change clock source.
> But if there are sources & parent defined, it means we will select a
> parent
> in multiple clock sources. So sources & parent are already defined,
> set the parent clock int s3c_set_clksrc.
> Then we can reduce many clk_set_parent function in driver or setup_clock
> function.
> 
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  arch/arm/plat-samsung/clock-clksrc.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-
> samsung/clock-clksrc.c
> index ae8b850..61dfe0d 100644
> --- a/arch/arm/plat-samsung/clock-clksrc.c
> +++ b/arch/arm/plat-samsung/clock-clksrc.c
> @@ -140,6 +140,14 @@ void __init_or_cpufreq s3c_set_clksrc(struct
> clksrc_clk *clk, bool announce)
>  		return;
>  	}
> 
> +	if (clk->sources && clk->clk.parent) {
> +		if (s3c_setparent_clksrc(&clk->clk, clk->clk.parent)) {
> +			printk(KERN_ERR "%s: bad source is %s\n",
> +					clk->clk.name, clk->clk.parent->name);
> +			return;
> +		}
> +	}
> +
>  	clksrc = __raw_readl(clk->reg_src.reg);
>  	clksrc &= mask;
>  	clksrc >>= clk->reg_src.shift;
> --
> 1.7.1

Hmm, I think, this  is not good. If there is a mux which includes clock sources, as you know, its parent clock can be selected
according to the value of reg_src and it should be changed by calling clk_set_parent() even though this can help in some kind of
view. And the clksrc_clk depends on SoC not board so the clk.parent cannot be fixed at the clock.c file.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

  reply	other threads:[~2011-12-21  4:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  2:20 [RESEND PATCH] ARM: SAMSUNG: Add s3c_setparent_clksrc in s3c_set_clksrc jhbird.choi at samsung.com
2011-12-21  4:07 ` Kukjin Kim [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-28  0:31 jhbird.choi at samsung.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='061a01ccbf95$fe1e6960$fa5b3c20$%kim@samsung.com' \
    --to=kgene.kim@samsung.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;
as well as URLs for NNTP newsgroup(s).