clk: qcom: Add QCOM_CLK_BOOT_CRITICAL flag

Some clks are critical and required to be on during probe to sync-state,
and also later needs to controlled by consumers. Add QCOM_CLK_BOOT_CRITICAL
flag to achieve turning on clk during probe and also register wih clk
framework so consumers can control after boot.

Change-Id: I7465828ede6cea5614cada6b49f428f84780e995
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
This commit is contained in:
Vivek Aknurwar 2021-09-03 10:54:43 -07:00 committed by Mike Tipton
parent f0e9ac4de0
commit cc59dbb6d2
2 changed files with 4 additions and 2 deletions

View File

@ -288,12 +288,13 @@ int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk)
else if (dev && dev->parent)
rclk->regmap = dev_get_regmap(dev->parent, NULL);
if (rclk->flags & QCOM_CLK_IS_CRITICAL) {
if (rclk->flags & QCOM_CLK_IS_CRITICAL || rclk->flags & QCOM_CLK_BOOT_CRITICAL) {
ops = rclk->hw.init->ops;
if (ops && ops->enable)
ops->enable(&rclk->hw);
return 0;
if (rclk->flags & QCOM_CLK_IS_CRITICAL)
return 0;
}
ret = devm_clk_hw_register(dev, &rclk->hw);

View File

@ -50,6 +50,7 @@ struct clk_regmap {
struct list_head list_node;
struct device *dev;
#define QCOM_CLK_IS_CRITICAL BIT(0)
#define QCOM_CLK_BOOT_CRITICAL BIT(1)
unsigned long flags;
};