Re: [PATCH v3 15/15] pmdomain: mediatek: mtk-mfg: use clk_determine_rate_noop()

From: Ulf Hansson

Date: Wed Jun 03 2026 - 06:17:41 EST


On Wed, May 6, 2026 at 2:49 AM Brian Masney <bmasney@xxxxxxxxxx> wrote:
>
> Drop the driver-specific empty determine_rate() function and use the new
> shared clk_determine_rate_noop() helper.
>
> Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>

Acked-by: Ulf Hansson <ulfh@xxxxxxxxxx>

Kind regards
Uffe

> ---
> To: Ulf Hansson <ulfh@xxxxxxxxxx>
> To: Matthias Brugger <matthias.bgg@xxxxxxxxx>
> To: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
> To: Michael Turquette <mturquette@xxxxxxxxxxxx>
> To: Stephen Boyd <sboyd@xxxxxxxxxx>
> To: Brian Masney <bmasney@xxxxxxxxxx>
> Cc: linux-clk@xxxxxxxxxxxxxxx
> Cc: linux-pm@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-mediatek@xxxxxxxxxxxxxxxxxxx
> ---
> drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c | 23 ++---------------------
> 1 file changed, 2 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c b/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
> index 3ce6fb74dd53..64fef838776e 100644
> --- a/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
> +++ b/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
> @@ -310,25 +310,6 @@ static unsigned long mtk_mfg_recalc_rate_gpu(struct clk_hw *hw,
> return readl(mfg->shared_mem + GF_REG_FREQ_OUT_GPU) * HZ_PER_KHZ;
> }
>
> -static int mtk_mfg_determine_rate(struct clk_hw *hw,
> - struct clk_rate_request *req)
> -{
> - /*
> - * The determine_rate callback needs to be implemented to avoid returning
> - * the current clock frequency, rather than something even remotely
> - * close to the frequency that was asked for.
> - *
> - * Instead of writing considerable amounts of possibly slow code just to
> - * somehow figure out which of the three PLLs to round for, or even to
> - * do a search through one of two OPP tables in order to find the closest
> - * OPP of a frequency, just return the rate as-is. This avoids devfreq
> - * "rounding" a request for the lowest frequency to the possibly very
> - * high current frequency, breaking the powersave governor in the process.
> - */
> -
> - return 0;
> -}
> -
> static unsigned long mtk_mfg_recalc_rate_stack(struct clk_hw *hw,
> unsigned long parent_rate)
> {
> @@ -339,12 +320,12 @@ static unsigned long mtk_mfg_recalc_rate_stack(struct clk_hw *hw,
>
> static const struct clk_ops mtk_mfg_clk_gpu_ops = {
> .recalc_rate = mtk_mfg_recalc_rate_gpu,
> - .determine_rate = mtk_mfg_determine_rate,
> + .determine_rate = clk_determine_rate_noop,
> };
>
> static const struct clk_ops mtk_mfg_clk_stack_ops = {
> .recalc_rate = mtk_mfg_recalc_rate_stack,
> - .determine_rate = mtk_mfg_determine_rate,
> + .determine_rate = clk_determine_rate_noop,
> };
>
> static const struct clk_init_data mtk_mfg_clk_gpu_init = {
>
> --
> 2.54.0