diff mbox series

[v1,3/6] clk: bcm2835: Switch to clk_divider.determine_rate

Message ID 20210702225145.2643303-4-martin.blumenstingl@googlemail.com (mailing list archive)
State Accepted, archived
Headers show
Series clk: switch dividers to .determine_rate | expand

Commit Message

Martin Blumenstingl July 2, 2021, 10:51 p.m. UTC
.determine_rate is meant to replace .round_rate in CCF in the future.
Switch over to .determine_rate now that clk_divider_ops has gained
support for that.

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-rpi-kernel@lists.infradead.org
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/clk/bcm/clk-bcm2835.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Marek Szyprowski July 5, 2021, 6:57 a.m. UTC | #1
On 03.07.2021 00:51, Martin Blumenstingl wrote:
> .determine_rate is meant to replace .round_rate in CCF in the future.
> Switch over to .determine_rate now that clk_divider_ops has gained
> support for that.
>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Cc: linux-rpi-kernel@lists.infradead.org
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/clk/bcm/clk-bcm2835.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
> index 1ac803e14fa3..a254512965eb 100644
> --- a/drivers/clk/bcm/clk-bcm2835.c
> +++ b/drivers/clk/bcm/clk-bcm2835.c
> @@ -805,11 +805,10 @@ static int bcm2835_pll_divider_is_on(struct clk_hw *hw)
>   	return !(cprman_read(cprman, data->a2w_reg) & A2W_PLL_CHANNEL_DISABLE);
>   }
>   
> -static long bcm2835_pll_divider_round_rate(struct clk_hw *hw,
> -					   unsigned long rate,
> -					   unsigned long *parent_rate)
> +static int bcm2835_pll_divider_determine_rate(struct clk_hw *hw,
> +					      struct clk_rate_request *req)
>   {
> -	return clk_divider_ops.round_rate(hw, rate, parent_rate);
> +	return clk_divider_ops.determine_rate(hw, req);
>   }
>   
>   static unsigned long bcm2835_pll_divider_get_rate(struct clk_hw *hw,
> @@ -901,7 +900,7 @@ static const struct clk_ops bcm2835_pll_divider_clk_ops = {
>   	.unprepare = bcm2835_pll_divider_off,
>   	.recalc_rate = bcm2835_pll_divider_get_rate,
>   	.set_rate = bcm2835_pll_divider_set_rate,
> -	.round_rate = bcm2835_pll_divider_round_rate,
> +	.determine_rate = bcm2835_pll_divider_determine_rate,
>   	.debug_init = bcm2835_pll_divider_debug_init,
>   };
>   

Best regards
Stephen Boyd Aug. 6, 2021, 1:10 a.m. UTC | #2
Quoting Martin Blumenstingl (2021-07-02 15:51:42)
> .determine_rate is meant to replace .round_rate in CCF in the future.
> Switch over to .determine_rate now that clk_divider_ops has gained
> support for that.
> 
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Cc: linux-rpi-kernel@lists.infradead.org
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 1ac803e14fa3..a254512965eb 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -805,11 +805,10 @@  static int bcm2835_pll_divider_is_on(struct clk_hw *hw)
 	return !(cprman_read(cprman, data->a2w_reg) & A2W_PLL_CHANNEL_DISABLE);
 }
 
-static long bcm2835_pll_divider_round_rate(struct clk_hw *hw,
-					   unsigned long rate,
-					   unsigned long *parent_rate)
+static int bcm2835_pll_divider_determine_rate(struct clk_hw *hw,
+					      struct clk_rate_request *req)
 {
-	return clk_divider_ops.round_rate(hw, rate, parent_rate);
+	return clk_divider_ops.determine_rate(hw, req);
 }
 
 static unsigned long bcm2835_pll_divider_get_rate(struct clk_hw *hw,
@@ -901,7 +900,7 @@  static const struct clk_ops bcm2835_pll_divider_clk_ops = {
 	.unprepare = bcm2835_pll_divider_off,
 	.recalc_rate = bcm2835_pll_divider_get_rate,
 	.set_rate = bcm2835_pll_divider_set_rate,
-	.round_rate = bcm2835_pll_divider_round_rate,
+	.determine_rate = bcm2835_pll_divider_determine_rate,
 	.debug_init = bcm2835_pll_divider_debug_init,
 };