Commit 78ddb79c authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Stephen Boyd

clk: qcom: gfm-mux: fix clk mask

For some reason global GFM_MASK ended up with bit 1 instead of bit 0.
Remove the global GFM_MASK and reuse mux_mask field.

Fixes: a2d8f507 ("clk: qcom: Add support to LPASS AUDIO_CC Glitch Free Mux clocks")
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210119113851.18946-1-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent f28dec1a
...@@ -33,14 +33,13 @@ struct clk_gfm { ...@@ -33,14 +33,13 @@ struct clk_gfm {
void __iomem *gfm_mux; void __iomem *gfm_mux;
}; };
#define GFM_MASK BIT(1)
#define to_clk_gfm(_hw) container_of(_hw, struct clk_gfm, hw) #define to_clk_gfm(_hw) container_of(_hw, struct clk_gfm, hw)
static u8 clk_gfm_get_parent(struct clk_hw *hw) static u8 clk_gfm_get_parent(struct clk_hw *hw)
{ {
struct clk_gfm *clk = to_clk_gfm(hw); struct clk_gfm *clk = to_clk_gfm(hw);
return readl(clk->gfm_mux) & GFM_MASK; return readl(clk->gfm_mux) & clk->mux_mask;
} }
static int clk_gfm_set_parent(struct clk_hw *hw, u8 index) static int clk_gfm_set_parent(struct clk_hw *hw, u8 index)
...@@ -51,9 +50,10 @@ static int clk_gfm_set_parent(struct clk_hw *hw, u8 index) ...@@ -51,9 +50,10 @@ static int clk_gfm_set_parent(struct clk_hw *hw, u8 index)
val = readl(clk->gfm_mux); val = readl(clk->gfm_mux);
if (index) if (index)
val |= GFM_MASK; val |= clk->mux_mask;
else else
val &= ~GFM_MASK; val &= ~clk->mux_mask;
writel(val, clk->gfm_mux); writel(val, clk->gfm_mux);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment