summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/syscon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/syscon.c')
-rw-r--r--drivers/mfd/syscon.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index f1e6559d71..ab458428a6 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -105,10 +105,20 @@ static struct syscon *node_to_syscon(struct device_node *np)
static void __iomem *syscon_node_to_base(struct device_node *np)
{
struct syscon *syscon = node_to_syscon(np);
+ struct clk *clk;
if (IS_ERR(syscon))
return ERR_CAST(syscon);
+ /* Returning the direct pointer here side steps the regmap
+ * and any specified clock wouldn't be enabled on access.
+ * Deal with this by enabling the clock permanently if any
+ * syscon_node_to_base users exist.
+ */
+ clk = of_clk_get(np, 0);
+ if (!IS_ERR(clk))
+ clk_enable(clk);
+
return syscon->base;
}