MLK-21052-08 clk: imx: Add CLK_SET_PARENT_NOCACHE
authorRanjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Wed, 10 Jan 2018 17:51:26 +0000 (11:51 -0600)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Implement a CLK_SET_PARENT_NOCACHE flag in clk core for imx8 clk
implementation where the parent needs to be restore after PM domain is
up.

Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
(cherry picked from commit 87e997822c050fc7dc027a863c92f1f0b4816515)
[Leonard: split clk core part]
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
drivers/clk/clk.c
include/linux/clk-provider.h

index 82ce1ad..ae8d42b 100644 (file)
@@ -2215,7 +2215,8 @@ static int clk_core_set_parent_nolock(struct clk_core *core,
        if (!core)
                return 0;
 
-       if (core->parent == parent)
+       if ((core->parent == parent) &&
+               !(core->flags & CLK_SET_PARENT_NOCACHE))
                return 0;
 
        /* verify ops for for multi-parent clks */
index 5e62f1f..7045406 100644 (file)
@@ -40,6 +40,7 @@
 #define CLK_OPS_PARENT_ENABLE  BIT(12)
 /* duty cycle call may be forwarded to the parent clock */
 #define CLK_DUTY_CYCLE_PARENT  BIT(13)
+#define CLK_SET_PARENT_NOCACHE BIT(14) /* do not use the cached clk parent */
 
 struct clk;
 struct clk_hw;