Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27ca8a31 authored by Taniya Das's avatar Taniya Das
Browse files

clk: qcom: clk-alpha-pll: Add support for is_enabled ops



The is_enabled ops for PLL would return the actual PLL status, thus add
support for the same.

Change-Id: Ia2ba987dc7086cf31d8ebe02e100156cc6f0f8ee
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 231957ae
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -554,6 +554,24 @@ void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
	pll->inited = true;
}

static int pll_is_enabled(struct clk_hw *hw, u32 mask)
{
	int ret;
	struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
	u32 val, off = pll->offset;

	ret = regmap_read(pll->clkr.regmap, off + PLL_MODE, &val);
	if (ret)
		return ret;

	return !!(val & mask);
}

static int clk_alpha_pll_is_enabled(struct clk_hw *hw)
{
	return pll_is_enabled(hw, PLL_LOCK_DET);
}

static int clk_fabia_pll_enable(struct clk_hw *hw)
{
	int ret;
@@ -759,6 +777,7 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_hwfsm_ops);
const struct clk_ops clk_fabia_pll_ops = {
	.enable = clk_fabia_pll_enable,
	.disable = clk_fabia_pll_disable,
	.is_enabled = clk_alpha_pll_is_enabled,
	.recalc_rate = clk_fabia_pll_recalc_rate,
	.round_rate = clk_alpha_pll_round_rate,
	.set_rate = clk_fabia_pll_set_rate,
@@ -769,6 +788,7 @@ EXPORT_SYMBOL_GPL(clk_fabia_pll_ops);
const struct clk_ops clk_fabia_fixed_pll_ops = {
	.enable = clk_fabia_pll_enable,
	.disable = clk_fabia_pll_disable,
	.is_enabled = clk_alpha_pll_is_enabled,
	.recalc_rate = clk_fabia_pll_recalc_rate,
	.round_rate = clk_alpha_pll_round_rate,
	.list_registers = clk_fabia_pll_list_registers,