Skip to content

Commit 6727f08

Browse files
msperlanholt
authored andcommitted
clk: bcm2835: pll_off should only update CM_PLL_ANARST
bcm2835_pll_off is currently assigning CM_PLL_ANARST to the control register, which may lose the other bits that are currently set by the clock dividers. It also now locks during the read/modify/write cycle of both registers. Fixes: 41691b8 ("clk: bcm2835: Add support for programming the audio domain clocks") Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
1 parent 4d3ac66 commit 6727f08

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/clk/bcm/clk-bcm2835.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,14 @@ static void bcm2835_pll_off(struct clk_hw *hw)
910910
struct bcm2835_cprman *cprman = pll->cprman;
911911
const struct bcm2835_pll_data *data = pll->data;
912912

913-
cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST);
914-
cprman_write(cprman, data->a2w_ctrl_reg, A2W_PLL_CTRL_PWRDN);
913+
spin_lock(&cprman->regs_lock);
914+
cprman_write(cprman, data->cm_ctrl_reg,
915+
cprman_read(cprman, data->cm_ctrl_reg) |
916+
CM_PLL_ANARST);
917+
cprman_write(cprman, data->a2w_ctrl_reg,
918+
cprman_read(cprman, data->a2w_ctrl_reg) |
919+
A2W_PLL_CTRL_PWRDN);
920+
spin_unlock(&cprman->regs_lock);
915921
}
916922

917923
static int bcm2835_pll_on(struct clk_hw *hw)

0 commit comments

Comments
 (0)