Skip to content

Commit 391bbbd

Browse files
lkundrakbebarino
authored andcommitted
clk: mmp2: Check for MMP3
The MMP3's are similar enough to MMP2, but there are differencies, such are more clocks available on the newer model. We want to tell which platform are we on. Signed-off-by: Lubomir Rintel <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent b90e0eb commit 391bbbd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,14 @@
6262
#define MPMU_UART_PLL 0x14
6363
#define MPMU_PLL2_CR 0x34
6464

65+
enum mmp2_clk_model {
66+
CLK_MODEL_MMP2,
67+
CLK_MODEL_MMP3,
68+
};
69+
6570
struct mmp2_clk_unit {
6671
struct mmp_clk_unit unit;
72+
enum mmp2_clk_model model;
6773
void __iomem *mpmu_base;
6874
void __iomem *apmu_base;
6975
void __iomem *apbc_base;
@@ -326,6 +332,11 @@ static void __init mmp2_clk_init(struct device_node *np)
326332
if (!pxa_unit)
327333
return;
328334

335+
if (of_device_is_compatible(np, "marvell,mmp3-clock"))
336+
pxa_unit->model = CLK_MODEL_MMP3;
337+
else
338+
pxa_unit->model = CLK_MODEL_MMP2;
339+
329340
pxa_unit->mpmu_base = of_iomap(np, 0);
330341
if (!pxa_unit->mpmu_base) {
331342
pr_err("failed to map mpmu registers\n");
@@ -365,3 +376,4 @@ static void __init mmp2_clk_init(struct device_node *np)
365376
}
366377

367378
CLK_OF_DECLARE(mmp2_clk, "marvell,mmp2-clock", mmp2_clk_init);
379+
CLK_OF_DECLARE(mmp3_clk, "marvell,mmp3-clock", mmp2_clk_init);

0 commit comments

Comments
 (0)