From: stanley.miao@windriver.com (stanley.miao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V6 13/63] ST SPEAr: Updating Clock Support
Date: Wed, 16 Feb 2011 09:40:41 +0800 [thread overview]
Message-ID: <4D5B2B19.5070401@windriver.com> (raw)
In-Reply-To: <6e9275be36b831894e51a2adf3ebbe9984831d16.1297763160.git.viresh.kumar@st.com>
Viresh Kumar wrote:
> <snip>
> -/*
> - * Set pclk as cclk's parent and add clock sibling node to current parents
> - * children list
> +/**
> + * clk_round_rate - adjust a rate to the exact rate a clock can provide
> + * @clk: clock source
> + * @rate: desired clock rate in Hz
> + *
> + * Returns rounded clock rate in Hz, or negative errno.
> */
> -static void change_parent(struct clk *cclk, struct clk *pclk)
> +long clk_round_rate(struct clk *clk, unsigned long drate)
> {
> - unsigned long flags;
> + long rate = 0;
> + int index;
> +
> + /*
> + * propagate call to parent who supports calc_rate. Similar approach is
> + * used in clk_set_rate.
> + */
> + if (!clk->calc_rate) {
> + u32 mult;
> + if (!clk->pclk)
> + return clk->rate;
> +
> + mult = clk->div_factor ? clk->div_factor : 1;
> + return clk_round_rate(clk->pclk, mult * drate) / mult;
> + }
>
Now it looks OK.
Reviewed-by: Stanley.Miao <stanley.miao@windriver.com>
Stanley.
>
>
>
prev parent reply other threads:[~2011-02-16 1:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1297763160.git.viresh.kumar@st.com>
2011-02-15 9:47 ` [PATCH V6 13/63] ST SPEAr: Updating Clock Support Viresh Kumar
2011-02-16 1:40 ` stanley.miao [this message]
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=4D5B2B19.5070401@windriver.com \
--to=stanley.miao@windriver.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