@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
- * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/kernel.h>
@@ -76,6 +76,7 @@ static int clk_branch_wait(const struct clk_branch *br, bool enabling,
udelay(10);
} else if (br->halt_check == BRANCH_HALT_ENABLE ||
br->halt_check == BRANCH_HALT ||
+ br->halt_check == BRANCH_HALT_POLL ||
(enabling && voted)) {
int count = 200;
@@ -97,6 +98,10 @@ static int clk_branch_toggle(struct clk_hw *hw, bool en,
struct clk_branch *br = to_clk_branch(hw);
int ret;
+ if (br->halt_check == BRANCH_HALT_POLL) {
+ return clk_branch_wait(br, en, check_halt);
+ }
+
if (en) {
ret = clk_enable_regmap(hw);
if (ret)
@@ -34,6 +34,7 @@ struct clk_branch {
#define BRANCH_HALT_ENABLE_VOTED (BRANCH_HALT_ENABLE | BRANCH_VOTED)
#define BRANCH_HALT_DELAY 2 /* No bit to check; just delay */
#define BRANCH_HALT_SKIP 3 /* Don't check halt bit */
+#define BRANCH_HALT_POLL 4 /* Don't enable the clock, poll for halt */
struct clk_regmap clkr;
};