Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: sun6i-prcm: Add support for Allwinner A23 PRCM

The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
The differences are the AR100 clock can no longer be modified,
the APB0 clock has different divisors, and some clock gates are
gone.

This patch adds a compatible with a modified subdevice list for
the A23.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Chen-Yu Tsai and committed by
Lee Jones
4eb9560b 4362175d

+31 -1
+1 -1
Documentation/devicetree/bindings/mfd/sun6i-prcm.txt
··· 4 4 (like clks and reset controllers). 5 5 6 6 Required properties: 7 - - compatible: "allwinner,sun6i-a31-prcm" 7 + - compatible: "allwinner,sun6i-a31-prcm" or "allwinner,sun8i-a23-prcm" 8 8 - reg: The PRCM registers range 9 9 10 10 The prcm node may contain several subdevices definitions:
+30
drivers/mfd/sun6i-prcm.c
··· 76 76 }, 77 77 }; 78 78 79 + static const struct mfd_cell sun8i_a23_prcm_subdevs[] = { 80 + { 81 + .name = "sun8i-a23-apb0-clk", 82 + .of_compatible = "allwinner,sun8i-a23-apb0-clk", 83 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_clk_res), 84 + .resources = sun6i_a31_apb0_clk_res, 85 + }, 86 + { 87 + .name = "sun6i-a31-apb0-gates-clk", 88 + .of_compatible = "allwinner,sun8i-a23-apb0-gates-clk", 89 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res), 90 + .resources = sun6i_a31_apb0_gates_clk_res, 91 + }, 92 + { 93 + .name = "sun6i-a31-apb0-clock-reset", 94 + .of_compatible = "allwinner,sun6i-a31-clock-reset", 95 + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_rstc_res), 96 + .resources = sun6i_a31_apb0_rstc_res, 97 + }, 98 + }; 99 + 79 100 static const struct prcm_data sun6i_a31_prcm_data = { 80 101 .nsubdevs = ARRAY_SIZE(sun6i_a31_prcm_subdevs), 81 102 .subdevs = sun6i_a31_prcm_subdevs, 103 + }; 104 + 105 + static const struct prcm_data sun8i_a23_prcm_data = { 106 + .nsubdevs = ARRAY_SIZE(sun8i_a23_prcm_subdevs), 107 + .subdevs = sun8i_a23_prcm_subdevs, 82 108 }; 83 109 84 110 static const struct of_device_id sun6i_prcm_dt_ids[] = { 85 111 { 86 112 .compatible = "allwinner,sun6i-a31-prcm", 87 113 .data = &sun6i_a31_prcm_data, 114 + }, 115 + { 116 + .compatible = "allwinner,sun8i-a23-prcm", 117 + .data = &sun8i_a23_prcm_data, 88 118 }, 89 119 { /* sentinel */ }, 90 120 };