]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks
authorShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 14 Jun 2024 07:42:02 +0000 (15:42 +0800)
committerAbel Vesa <abel.vesa@linaro.org>
Fri, 21 Jun 2024 06:35:17 +0000 (09:35 +0300)
Add CLK_SET_RATE_PARENT flags that when the device driver sets the
child clock rate, parent clock frequency can be refined accordingly.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1718350923-21392-5-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
drivers/clk/imx/clk-imx8mp-audiomix.c

index 517b1f88661b91df124f1642b36722ad15e101f7..7fd336a96cfe1e56b02c380d9d12cb42648b8ede 100644 (file)
@@ -328,12 +328,12 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
        for (i = 0; i < ARRAY_SIZE(sels); i++) {
                if (sels[i].num_parents == 1) {
                        hw = devm_clk_hw_register_gate_parent_data(dev,
-                               sels[i].name, &sels[i].parent, 0,
+                               sels[i].name, &sels[i].parent, CLK_SET_RATE_PARENT,
                                base + sels[i].reg, sels[i].shift, 0, NULL);
                } else {
                        hw = devm_clk_hw_register_mux_parent_data_table(dev,
                                sels[i].name, sels[i].parents,
-                               sels[i].num_parents, 0,
+                               sels[i].num_parents, CLK_SET_RATE_PARENT,
                                base + sels[i].reg,
                                sels[i].shift, sels[i].width,
                                0, NULL, NULL);
@@ -376,7 +376,8 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
        clk_hw_data->hws[IMX8MP_CLK_AUDIOMIX_SAI_PLL_BYPASS] = hw;
 
        hw = devm_clk_hw_register_gate(dev, "sai_pll_out", "sai_pll_bypass",
-                                      0, base + SAI_PLL_GNRL_CTL, 13,
+                                      CLK_SET_RATE_PARENT,
+                                      base + SAI_PLL_GNRL_CTL, 13,
                                       0, NULL);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
@@ -385,7 +386,8 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
        clk_hw_data->hws[IMX8MP_CLK_AUDIOMIX_SAI_PLL_OUT] = hw;
 
        hw = devm_clk_hw_register_fixed_factor(dev, "sai_pll_out_div2",
-                                              "sai_pll_out", 0, 1, 2);
+                                              "sai_pll_out",
+                                              CLK_SET_RATE_PARENT, 1, 2);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
                goto err_clk_register;