Re: [PATCH 2/4] clk: Implement clk_set_rate

From: Sascha Hauer
Date: Wed May 25 2011 - 15:03:54 EST


Hi Jeremy,

On Fri, May 20, 2011 at 03:27:49PM +0800, Jeremy Kerr wrote:
> Implemenent clk_set_rate by adding a set_rate callback to clk_hw_ops,
> and core code to handle propagation of rate changes up and down the
> clock tree.
>
> Signed-off-by: Jeremy Kerr <jeremy.kerr@xxxxxxxxxxxxx>
>
> +
> +propagate:
> + ret = clk->ops->set_rate(clk->hw, new_rate, &parent_rate);
> +
> + if (ret < 0)
> + return ret;
> +
> + /* ops->set_rate may require the parent's rate to change (to
> + * parent_rate), we need to propagate the set_rate call to the
> + * parent.
> + */
> + if (ret == CLK_SET_RATE_PROPAGATE) {
> + new_rate = parent_rate;
> + clk = clk->parent;
> + goto propagate;
> + }

I'm unsure about this one. Every clock should have the ability to stop
or continue the rate propagation to the parent. This suggests to leave
the decision whether or not to propagate to the core and not to the
individual clocks.
Right now each mux/div/gate needs an individual propagate flag. By
adding the flag to the core the building block implementations could be
simpler and the knowledge about propagatability might become handy for
the core later.

Sascha


--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/