[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150604224407.GC8099@codeaurora.org>
Date: Thu, 4 Jun 2015 15:44:07 -0700
From: Stephen Boyd <sboyd@...eaurora.org>
To: Joonyoung Shim <jy0922.shim@...sung.com>
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
mturquette@...aro.org, haojian.zhuang@...il.com,
james.hogan@...tec.com
Subject: Re: [PATCH 1/2] clk: divider: don't set_rate with
CLK_DIVIDER_READ_ONLY flag
On 04/07, Joonyoung Shim wrote:
> Even if use CLK_DIVIDER_READ_ONLY flag, divider setting can be changed
> by set_rate callback. Don't change divider setting from set_rate
> callback of divider with CLK_DIVIDER_READ_ONLY flag.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@...sung.com>
> ---
> drivers/clk/clk-divider.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index 25006a8..ce34d29a 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -384,6 +384,9 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
> unsigned long flags = 0;
> u32 val;
>
> + if (divider->flags & CLK_DIVIDER_READ_ONLY)
> + return 0;
> +
> value = divider_get_val(rate, parent_rate, divider->table,
> divider->width, divider->flags);
>
I wonder if it would make more sense to have different ops for
read only dividers. We would need to have an empty clk_set_rate
op in the case where the CCF tries to set the rate to what it
already is and then the proper recalc_rate and round_rate ops for
read only devices. At the least, this patch looks correct.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists