Skip to content

Commit 82d59c3

Browse files
lkundrakbebarino
authored andcommitted
clk: mmp2: Add clocks for the thermal sensors
The register definitions gotten from OLPC Open Firmware. Signed-off-by: Lubomir Rintel <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 41a8632 commit 82d59c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/clk/mmp/clk-of-mmp2.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#define APMU_DISP1 0x110
5555
#define APMU_CCIC0 0x50
5656
#define APMU_CCIC1 0xf4
57+
#define APBC_THERMAL0 0x90
58+
#define APBC_THERMAL1 0x98
59+
#define APBC_THERMAL2 0x9c
60+
#define APBC_THERMAL3 0xa0
5761
#define APMU_USBHSIC0 0xf8
5862
#define APMU_USBHSIC1 0xfc
5963
#define APMU_GPU 0xcc
@@ -215,6 +219,13 @@ static struct mmp_param_gate_clk apbc_gate_clks[] = {
215219
{MMP2_CLK_SSP2, "ssp2_clk", "ssp2_mux", CLK_SET_RATE_PARENT, APBC_SSP2, 0x7, 0x3, 0x0, 0, &ssp2_lock},
216220
{MMP2_CLK_SSP3, "ssp3_clk", "ssp3_mux", CLK_SET_RATE_PARENT, APBC_SSP3, 0x7, 0x3, 0x0, 0, &ssp3_lock},
217221
{MMP2_CLK_TIMER, "timer_clk", "timer_mux", CLK_SET_RATE_PARENT, APBC_TIMER, 0x7, 0x3, 0x0, 0, &timer_lock},
222+
{MMP2_CLK_THERMAL0, "thermal0_clk", "vctcxo", CLK_SET_RATE_PARENT, APBC_THERMAL0, 0x7, 0x3, 0x0, MMP_CLK_GATE_NEED_DELAY, &reset_lock},
223+
};
224+
225+
static struct mmp_param_gate_clk mmp3_apbc_gate_clks[] = {
226+
{MMP3_CLK_THERMAL1, "thermal1_clk", "vctcxo", CLK_SET_RATE_PARENT, APBC_THERMAL1, 0x7, 0x3, 0x0, MMP_CLK_GATE_NEED_DELAY, &reset_lock},
227+
{MMP3_CLK_THERMAL2, "thermal2_clk", "vctcxo", CLK_SET_RATE_PARENT, APBC_THERMAL2, 0x7, 0x3, 0x0, MMP_CLK_GATE_NEED_DELAY, &reset_lock},
228+
{MMP3_CLK_THERMAL3, "thermal3_clk", "vctcxo", CLK_SET_RATE_PARENT, APBC_THERMAL3, 0x7, 0x3, 0x0, MMP_CLK_GATE_NEED_DELAY, &reset_lock},
218229
};
219230

220231
static void mmp2_apb_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
@@ -226,6 +237,11 @@ static void mmp2_apb_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
226237

227238
mmp_register_gate_clks(unit, apbc_gate_clks, pxa_unit->apbc_base,
228239
ARRAY_SIZE(apbc_gate_clks));
240+
241+
if (pxa_unit->model == CLK_MODEL_MMP3) {
242+
mmp_register_gate_clks(unit, mmp3_apbc_gate_clks, pxa_unit->apbc_base,
243+
ARRAY_SIZE(mmp3_apbc_gate_clks));
244+
}
229245
}
230246

231247
static DEFINE_SPINLOCK(sdh_lock);

0 commit comments

Comments
 (0)