]>
Commit | Line | Data |
---|---|---|
375caec0 GKH |
1 | From 6727f086cfe4ddcc651eb2bf4301abfcf619be06 Mon Sep 17 00:00:00 2001 |
2 | From: Martin Sperl <kernel@martin.sperl.org> | |
3 | Date: Mon, 29 Feb 2016 11:39:17 +0000 | |
4 | Subject: clk: bcm2835: pll_off should only update CM_PLL_ANARST | |
5 | ||
6 | From: Martin Sperl <kernel@martin.sperl.org> | |
7 | ||
8 | commit 6727f086cfe4ddcc651eb2bf4301abfcf619be06 upstream. | |
9 | ||
10 | bcm2835_pll_off is currently assigning CM_PLL_ANARST to the control | |
11 | register, which may lose the other bits that are currently set by the | |
12 | clock dividers. | |
13 | ||
14 | It also now locks during the read/modify/write cycle of both | |
15 | registers. | |
16 | ||
17 | Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the | |
18 | audio domain clocks") | |
19 | ||
20 | Signed-off-by: Martin Sperl <kernel@martin.sperl.org> | |
21 | Signed-off-by: Eric Anholt <eric@anholt.net> | |
22 | Reviewed-by: Eric Anholt <eric@anholt.net> | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
24 | ||
25 | --- | |
26 | drivers/clk/bcm/clk-bcm2835.c | 10 ++++++++-- | |
27 | 1 file changed, 8 insertions(+), 2 deletions(-) | |
28 | ||
29 | --- a/drivers/clk/bcm/clk-bcm2835.c | |
30 | +++ b/drivers/clk/bcm/clk-bcm2835.c | |
31 | @@ -890,8 +890,14 @@ static void bcm2835_pll_off(struct clk_h | |
32 | struct bcm2835_cprman *cprman = pll->cprman; | |
33 | const struct bcm2835_pll_data *data = pll->data; | |
34 | ||
35 | - cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST); | |
36 | - cprman_write(cprman, data->a2w_ctrl_reg, A2W_PLL_CTRL_PWRDN); | |
37 | + spin_lock(&cprman->regs_lock); | |
38 | + cprman_write(cprman, data->cm_ctrl_reg, | |
39 | + cprman_read(cprman, data->cm_ctrl_reg) | | |
40 | + CM_PLL_ANARST); | |
41 | + cprman_write(cprman, data->a2w_ctrl_reg, | |
42 | + cprman_read(cprman, data->a2w_ctrl_reg) | | |
43 | + A2W_PLL_CTRL_PWRDN); | |
44 | + spin_unlock(&cprman->regs_lock); | |
45 | } | |
46 | ||
47 | static int bcm2835_pll_on(struct clk_hw *hw) |