Skip to content

Commit 0a7f99a

Browse files
committed
clk: rockchip: use separate compatibles for rk3288w-cru
Commit 1627f68 ("clk: rockchip: Handle clock tree for rk3288w variant") added the check for rk3288w-specific clock-tree changes but in turn would require a double-compatible due to re-using the main rockchip,rk3288-cru compatible as entry point. The binding change actually describes the compatibles as one or the other so adapt the code accordingly and add a real second entry-point for the clock controller. Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Reviewed-by: Jagan Teki <[email protected]> Tested-by: Jagan Teki <[email protected]> # rock-pi-n8 Link: https://lore.kernel.org/r/[email protected]
1 parent 00bd404 commit 0a7f99a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

drivers/clk/rockchip/clk-rk3288.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
#define RK3288_GRF_SOC_CON(x) (0x244 + x * 4)
1616
#define RK3288_GRF_SOC_STATUS1 0x284
1717

18+
enum rk3288_variant {
19+
RK3288_CRU,
20+
RK3288W_CRU,
21+
};
22+
1823
enum rk3288_plls {
1924
apll, dpll, cpll, gpll, npll,
2025
};
@@ -922,7 +927,8 @@ static struct syscore_ops rk3288_clk_syscore_ops = {
922927
.resume = rk3288_clk_resume,
923928
};
924929

925-
static void __init rk3288_clk_init(struct device_node *np)
930+
static void __init rk3288_common_init(struct device_node *np,
931+
enum rk3288_variant soc)
926932
{
927933
struct rockchip_clk_provider *ctx;
928934

@@ -945,7 +951,7 @@ static void __init rk3288_clk_init(struct device_node *np)
945951
rockchip_clk_register_branches(ctx, rk3288_clk_branches,
946952
ARRAY_SIZE(rk3288_clk_branches));
947953

948-
if (of_device_is_compatible(np, "rockchip,rk3288w-cru"))
954+
if (soc == RK3288W_CRU)
949955
rockchip_clk_register_branches(ctx, rk3288w_hclkvio_branch,
950956
ARRAY_SIZE(rk3288w_hclkvio_branch));
951957
else
@@ -970,4 +976,15 @@ static void __init rk3288_clk_init(struct device_node *np)
970976

971977
rockchip_clk_of_add_provider(np, ctx);
972978
}
979+
980+
static void __init rk3288_clk_init(struct device_node *np)
981+
{
982+
rk3288_common_init(np, RK3288_CRU);
983+
}
973984
CLK_OF_DECLARE(rk3288_cru, "rockchip,rk3288-cru", rk3288_clk_init);
985+
986+
static void __init rk3288w_clk_init(struct device_node *np)
987+
{
988+
rk3288_common_init(np, RK3288W_CRU);
989+
}
990+
CLK_OF_DECLARE(rk3288w_cru, "rockchip,rk3288w-cru", rk3288w_clk_init);

0 commit comments

Comments
 (0)