Skip to content

Commit

Permalink
clk: qcom: gfm-mux: fix clk mask
Browse files Browse the repository at this point in the history
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: a2d8f50 ("clk: qcom: Add support to LPASS AUDIO_CC Glitch Free Mux clocks")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210119113851.18946-1-srinivas.kandagatla@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Srinivas Kandagatla authored and Stephen Boyd committed Feb 8, 2021
1 parent f28dec1 commit 78ddb79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/clk/qcom/lpass-gfm-sm8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ struct clk_gfm {
void __iomem *gfm_mux;
};

#define GFM_MASK BIT(1)
#define to_clk_gfm(_hw) container_of(_hw, struct clk_gfm, hw)

static u8 clk_gfm_get_parent(struct clk_hw *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)
Expand All @@ -51,9 +50,10 @@ static int clk_gfm_set_parent(struct clk_hw *hw, u8 index)
val = readl(clk->gfm_mux);

if (index)
val |= GFM_MASK;
val |= clk->mux_mask;
else
val &= ~GFM_MASK;
val &= ~clk->mux_mask;


writel(val, clk->gfm_mux);

Expand Down

0 comments on commit 78ddb79

Please sign in to comment.