[PATCH v6 03/18] clk: mediatek: Add MT8189 apmixedsys clock support
David Lechner
dlechner at baylibre.com
Thu Mar 12 13:06:36 PDT 2026
On Mon, 09 Mar 2026 20:04:45 +0800, irving.ch.lin <irving-ch.lin at mediatek.com> wrote:
> Add support for the MT8189 apmixedsys clock controller, which provides
> PLLs generated from SoC 26m.
>
...
> +static int clk_mt8189_apmixed_probe(struct platform_device *pdev)
> +{
> + int r;
> + struct clk_hw_onecell_data *clk_data;
> + struct device_node *node = pdev->dev.of_node;
> + const u8 *fhctl_node = "mediatek,mt8189-fhctl";
> +
> + clk_data = mtk_alloc_clk_data(ARRAY_SIZE(apmixed_plls));
> + if (!clk_data)
> + return -ENOMEM;
> +
> + fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs));
> +
> + r = mtk_clk_register_pllfhs(&pdev->dev, apmixed_plls, ARRAY_SIZE(apmixed_plls),
> + pllfhs, ARRAY_SIZE(pllfhs), clk_data);
> + if (r)
> + goto free_apmixed_data;
> +
> + r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> + if (r)
> + goto unregister_plls;
> +
> + platform_set_drvdata(pdev, clk_data);
> +
> + return 0;
> +
> +unregister_plls:
> + mtk_clk_unregister_plls(apmixed_plls, ARRAY_SIZE(apmixed_plls),
Should this be mtk_clk_unregister_pllfhs()?
> + clk_data);
> +free_apmixed_data:
> + mtk_free_clk_data(clk_data);
> + return r;
> +}
> +
> +static void clk_mt8189_apmixed_remove(struct platform_device *pdev)
> +{
> + struct device_node *node = pdev->dev.of_node;
> + struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
> +
> + of_clk_del_provider(node);
> + mtk_clk_unregister_pllfhs(apmixed_plls, ARRAY_SIZE(apmixed_plls), pllfhs,
> + ARRAY_SIZE(pllfhs), clk_data);
> + mtk_free_clk_data(clk_data);
> +}
> +
--
David Lechner <dlechner at baylibre.com>
More information about the Linux-mediatek
mailing list