1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
7 #include <linux/platform_device.h>
8 #include <linux/pm_domain.h>
9 #include <linux/bitfield.h>
10 #include <linux/regmap.h>
11 #include <linux/mfd/syscon.h>
13 #include <linux/reset-controller.h>
14 #include <linux/reset.h>
15 #include <linux/clk.h>
16 #include <linux/module.h>
17 #include <dt-bindings/power/meson8-power.h>
18 #include <dt-bindings/power/meson-axg-power.h>
19 #include <dt-bindings/power/meson-g12a-power.h>
20 #include <dt-bindings/power/meson-gxbb-power.h>
21 #include <dt-bindings/power/meson-sm1-power.h>
25 #define GX_AO_RTI_GEN_PWR_SLEEP0 (0x3a << 2)
26 #define GX_AO_RTI_GEN_PWR_ISO0 (0x3b << 2)
29 * Meson8/Meson8b/Meson8m2 only expose the power management registers of the
30 * AO-bus as syscon. 0x3a from GX translates to 0x02, 0x3b translates to 0x03
33 #define MESON8_AO_RTI_GEN_PWR_SLEEP0 (0x02 << 2)
34 #define MESON8_AO_RTI_GEN_PWR_ISO0 (0x03 << 2)
38 #define HHI_MEM_PD_REG0 (0x40 << 2)
39 #define HHI_VPU_MEM_PD_REG0 (0x41 << 2)
40 #define HHI_VPU_MEM_PD_REG1 (0x42 << 2)
41 #define HHI_VPU_MEM_PD_REG3 (0x43 << 2)
42 #define HHI_VPU_MEM_PD_REG4 (0x44 << 2)
43 #define HHI_AUDIO_MEM_PD_REG0 (0x45 << 2)
44 #define HHI_NANOQ_MEM_PD_REG0 (0x46 << 2)
45 #define HHI_NANOQ_MEM_PD_REG1 (0x47 << 2)
46 #define HHI_VPU_MEM_PD_REG2 (0x4d << 2)
48 #define G12A_HHI_NANOQ_MEM_PD_REG0 (0x43 << 2)
49 #define G12A_HHI_NANOQ_MEM_PD_REG1 (0x44 << 2)
52 struct meson_ee_pwrc_domain;
54 struct meson_ee_pwrc_mem_domain {
59 struct meson_ee_pwrc_top_domain {
60 unsigned int sleep_reg;
61 unsigned int sleep_mask;
63 unsigned int iso_mask;
66 struct meson_ee_pwrc_domain_desc {
68 unsigned int reset_names_count;
69 unsigned int clk_names_count;
70 struct meson_ee_pwrc_top_domain *top_pd;
71 unsigned int mem_pd_count;
72 struct meson_ee_pwrc_mem_domain *mem_pd;
73 bool (*is_powered_off)(struct meson_ee_pwrc_domain *pwrc_domain);
76 struct meson_ee_pwrc_domain_data {
78 struct meson_ee_pwrc_domain_desc *domains;
81 /* TOP Power Domains */
83 static struct meson_ee_pwrc_top_domain gx_pwrc_vpu = {
84 .sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0,
86 .iso_reg = GX_AO_RTI_GEN_PWR_SLEEP0,
90 static struct meson_ee_pwrc_top_domain meson8_pwrc_vpu = {
91 .sleep_reg = MESON8_AO_RTI_GEN_PWR_SLEEP0,
93 .iso_reg = MESON8_AO_RTI_GEN_PWR_SLEEP0,
97 #define SM1_EE_PD(__bit) \
99 .sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0, \
100 .sleep_mask = BIT(__bit), \
101 .iso_reg = GX_AO_RTI_GEN_PWR_ISO0, \
102 .iso_mask = BIT(__bit), \
105 static struct meson_ee_pwrc_top_domain sm1_pwrc_vpu = SM1_EE_PD(8);
106 static struct meson_ee_pwrc_top_domain sm1_pwrc_nna = SM1_EE_PD(16);
107 static struct meson_ee_pwrc_top_domain sm1_pwrc_usb = SM1_EE_PD(17);
108 static struct meson_ee_pwrc_top_domain sm1_pwrc_pci = SM1_EE_PD(18);
109 static struct meson_ee_pwrc_top_domain sm1_pwrc_ge2d = SM1_EE_PD(19);
111 static struct meson_ee_pwrc_top_domain g12a_pwrc_nna = {
112 .sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0,
113 .sleep_mask = BIT(16) | BIT(17),
114 .iso_reg = GX_AO_RTI_GEN_PWR_ISO0,
115 .iso_mask = BIT(16) | BIT(17),
118 /* Memory PD Domains */
120 #define VPU_MEMPD(__reg) \
121 { __reg, GENMASK(1, 0) }, \
122 { __reg, GENMASK(3, 2) }, \
123 { __reg, GENMASK(5, 4) }, \
124 { __reg, GENMASK(7, 6) }, \
125 { __reg, GENMASK(9, 8) }, \
126 { __reg, GENMASK(11, 10) }, \
127 { __reg, GENMASK(13, 12) }, \
128 { __reg, GENMASK(15, 14) }, \
129 { __reg, GENMASK(17, 16) }, \
130 { __reg, GENMASK(19, 18) }, \
131 { __reg, GENMASK(21, 20) }, \
132 { __reg, GENMASK(23, 22) }, \
133 { __reg, GENMASK(25, 24) }, \
134 { __reg, GENMASK(27, 26) }, \
135 { __reg, GENMASK(29, 28) }, \
136 { __reg, GENMASK(31, 30) }
138 #define VPU_HHI_MEMPD(__reg) \
141 { __reg, BIT(10) }, \
142 { __reg, BIT(11) }, \
143 { __reg, BIT(12) }, \
144 { __reg, BIT(13) }, \
145 { __reg, BIT(14) }, \
148 static struct meson_ee_pwrc_mem_domain axg_pwrc_mem_vpu[] = {
149 VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
150 VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
153 static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = {
154 VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
155 VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
156 VPU_MEMPD(HHI_VPU_MEM_PD_REG2),
157 VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
160 static struct meson_ee_pwrc_mem_domain gxbb_pwrc_mem_vpu[] = {
161 VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
162 VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
163 VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
166 static struct meson_ee_pwrc_mem_domain meson_pwrc_mem_eth[] = {
167 { HHI_MEM_PD_REG0, GENMASK(3, 2) },
170 static struct meson_ee_pwrc_mem_domain meson8_pwrc_audio_dsp_mem[] = {
171 { HHI_MEM_PD_REG0, GENMASK(1, 0) },
174 static struct meson_ee_pwrc_mem_domain meson8_pwrc_mem_vpu[] = {
175 VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
176 VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
177 VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
180 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_vpu[] = {
181 VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
182 VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
183 VPU_MEMPD(HHI_VPU_MEM_PD_REG2),
184 VPU_MEMPD(HHI_VPU_MEM_PD_REG3),
185 { HHI_VPU_MEM_PD_REG4, GENMASK(1, 0) },
186 { HHI_VPU_MEM_PD_REG4, GENMASK(3, 2) },
187 { HHI_VPU_MEM_PD_REG4, GENMASK(5, 4) },
188 { HHI_VPU_MEM_PD_REG4, GENMASK(7, 6) },
189 VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
192 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_nna[] = {
193 { HHI_NANOQ_MEM_PD_REG0, 0xff },
194 { HHI_NANOQ_MEM_PD_REG1, 0xff },
197 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_usb[] = {
198 { HHI_MEM_PD_REG0, GENMASK(31, 30) },
201 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_pcie[] = {
202 { HHI_MEM_PD_REG0, GENMASK(29, 26) },
205 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_ge2d[] = {
206 { HHI_MEM_PD_REG0, GENMASK(25, 18) },
209 static struct meson_ee_pwrc_mem_domain axg_pwrc_mem_audio[] = {
210 { HHI_MEM_PD_REG0, GENMASK(5, 4) },
213 static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
214 { HHI_MEM_PD_REG0, GENMASK(5, 4) },
215 { HHI_AUDIO_MEM_PD_REG0, GENMASK(1, 0) },
216 { HHI_AUDIO_MEM_PD_REG0, GENMASK(3, 2) },
217 { HHI_AUDIO_MEM_PD_REG0, GENMASK(5, 4) },
218 { HHI_AUDIO_MEM_PD_REG0, GENMASK(7, 6) },
219 { HHI_AUDIO_MEM_PD_REG0, GENMASK(13, 12) },
220 { HHI_AUDIO_MEM_PD_REG0, GENMASK(15, 14) },
221 { HHI_AUDIO_MEM_PD_REG0, GENMASK(17, 16) },
222 { HHI_AUDIO_MEM_PD_REG0, GENMASK(19, 18) },
223 { HHI_AUDIO_MEM_PD_REG0, GENMASK(21, 20) },
224 { HHI_AUDIO_MEM_PD_REG0, GENMASK(23, 22) },
225 { HHI_AUDIO_MEM_PD_REG0, GENMASK(25, 24) },
226 { HHI_AUDIO_MEM_PD_REG0, GENMASK(27, 26) },
229 static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = {
230 { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) },
231 { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) },
234 #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \
237 .reset_names_count = __resets, \
238 .clk_names_count = __clks, \
239 .top_pd = __top_pd, \
240 .mem_pd_count = ARRAY_SIZE(__mem), \
242 .is_powered_off = __is_pwr_off, \
245 #define TOP_PD(__name, __top_pd, __mem, __is_pwr_off) \
248 .top_pd = __top_pd, \
249 .mem_pd_count = ARRAY_SIZE(__mem), \
251 .is_powered_off = __is_pwr_off, \
254 #define MEM_PD(__name, __mem) \
255 TOP_PD(__name, NULL, __mem, NULL)
257 static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain);
259 static struct meson_ee_pwrc_domain_desc axg_pwrc_domains[] = {
260 [PWRC_AXG_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, axg_pwrc_mem_vpu,
261 pwrc_ee_is_powered_off, 5, 2),
262 [PWRC_AXG_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
263 [PWRC_AXG_AUDIO_ID] = MEM_PD("AUDIO", axg_pwrc_mem_audio),
266 static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = {
267 [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu,
268 pwrc_ee_is_powered_off, 11, 2),
269 [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
270 [PWRC_G12A_NNA_ID] = TOP_PD("NNA", &g12a_pwrc_nna, g12a_pwrc_mem_nna,
271 pwrc_ee_is_powered_off),
274 static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = {
275 [PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, gxbb_pwrc_mem_vpu,
276 pwrc_ee_is_powered_off, 12, 2),
277 [PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
280 static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = {
281 [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
283 pwrc_ee_is_powered_off, 0, 1),
284 [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
286 [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
287 meson8_pwrc_audio_dsp_mem),
290 static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = {
291 [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
293 pwrc_ee_is_powered_off, 11, 1),
294 [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
296 [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
297 meson8_pwrc_audio_dsp_mem),
300 static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = {
301 [PWRC_SM1_VPU_ID] = VPU_PD("VPU", &sm1_pwrc_vpu, sm1_pwrc_mem_vpu,
302 pwrc_ee_is_powered_off, 11, 2),
303 [PWRC_SM1_NNA_ID] = TOP_PD("NNA", &sm1_pwrc_nna, sm1_pwrc_mem_nna,
304 pwrc_ee_is_powered_off),
305 [PWRC_SM1_USB_ID] = TOP_PD("USB", &sm1_pwrc_usb, sm1_pwrc_mem_usb,
306 pwrc_ee_is_powered_off),
307 [PWRC_SM1_PCIE_ID] = TOP_PD("PCI", &sm1_pwrc_pci, sm1_pwrc_mem_pcie,
308 pwrc_ee_is_powered_off),
309 [PWRC_SM1_GE2D_ID] = TOP_PD("GE2D", &sm1_pwrc_ge2d, sm1_pwrc_mem_ge2d,
310 pwrc_ee_is_powered_off),
311 [PWRC_SM1_AUDIO_ID] = MEM_PD("AUDIO", sm1_pwrc_mem_audio),
312 [PWRC_SM1_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
315 struct meson_ee_pwrc_domain {
316 struct generic_pm_domain base;
318 struct meson_ee_pwrc *pwrc;
319 struct meson_ee_pwrc_domain_desc desc;
320 struct clk_bulk_data *clks;
322 struct reset_control *rstc;
326 struct meson_ee_pwrc {
327 struct regmap *regmap_ao;
328 struct regmap *regmap_hhi;
329 struct meson_ee_pwrc_domain *domains;
330 struct genpd_onecell_data xlate;
333 static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain)
337 regmap_read(pwrc_domain->pwrc->regmap_ao,
338 pwrc_domain->desc.top_pd->sleep_reg, ®);
340 return (reg & pwrc_domain->desc.top_pd->sleep_mask);
343 static int meson_ee_pwrc_off(struct generic_pm_domain *domain)
345 struct meson_ee_pwrc_domain *pwrc_domain =
346 container_of(domain, struct meson_ee_pwrc_domain, base);
349 if (pwrc_domain->desc.top_pd)
350 regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
351 pwrc_domain->desc.top_pd->sleep_reg,
352 pwrc_domain->desc.top_pd->sleep_mask,
353 pwrc_domain->desc.top_pd->sleep_mask);
356 for (i = 0 ; i < pwrc_domain->desc.mem_pd_count ; ++i)
357 regmap_update_bits(pwrc_domain->pwrc->regmap_hhi,
358 pwrc_domain->desc.mem_pd[i].reg,
359 pwrc_domain->desc.mem_pd[i].mask,
360 pwrc_domain->desc.mem_pd[i].mask);
364 if (pwrc_domain->desc.top_pd)
365 regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
366 pwrc_domain->desc.top_pd->iso_reg,
367 pwrc_domain->desc.top_pd->iso_mask,
368 pwrc_domain->desc.top_pd->iso_mask);
370 if (pwrc_domain->num_clks) {
372 clk_bulk_disable_unprepare(pwrc_domain->num_clks,
379 static int meson_ee_pwrc_on(struct generic_pm_domain *domain)
381 struct meson_ee_pwrc_domain *pwrc_domain =
382 container_of(domain, struct meson_ee_pwrc_domain, base);
385 if (pwrc_domain->desc.top_pd)
386 regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
387 pwrc_domain->desc.top_pd->sleep_reg,
388 pwrc_domain->desc.top_pd->sleep_mask, 0);
391 for (i = 0 ; i < pwrc_domain->desc.mem_pd_count ; ++i)
392 regmap_update_bits(pwrc_domain->pwrc->regmap_hhi,
393 pwrc_domain->desc.mem_pd[i].reg,
394 pwrc_domain->desc.mem_pd[i].mask, 0);
398 ret = reset_control_assert(pwrc_domain->rstc);
402 if (pwrc_domain->desc.top_pd)
403 regmap_update_bits(pwrc_domain->pwrc->regmap_ao,
404 pwrc_domain->desc.top_pd->iso_reg,
405 pwrc_domain->desc.top_pd->iso_mask, 0);
407 ret = reset_control_deassert(pwrc_domain->rstc);
411 return clk_bulk_prepare_enable(pwrc_domain->num_clks,
415 static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
416 struct meson_ee_pwrc *pwrc,
417 struct meson_ee_pwrc_domain *dom)
422 dom->num_rstc = dom->desc.reset_names_count;
423 dom->num_clks = dom->desc.clk_names_count;
426 int count = reset_control_get_count(&pdev->dev);
428 if (count != dom->num_rstc)
429 dev_warn(&pdev->dev, "Invalid resets count %d for domain %s\n",
430 count, dom->desc.name);
432 dom->rstc = devm_reset_control_array_get_exclusive(&pdev->dev);
433 if (IS_ERR(dom->rstc))
434 return PTR_ERR(dom->rstc);
438 int ret = devm_clk_bulk_get_all(&pdev->dev, &dom->clks);
442 if (dom->num_clks != ret) {
443 dev_warn(&pdev->dev, "Invalid clocks count %d for domain %s\n",
444 ret, dom->desc.name);
449 dom->base.name = dom->desc.name;
450 dom->base.power_on = meson_ee_pwrc_on;
451 dom->base.power_off = meson_ee_pwrc_off;
454 * TOFIX: This is a special case for the VPU power domain, which can
455 * be enabled previously by the bootloader. In this case the VPU
456 * pipeline may be functional but no driver maybe never attach
457 * to this power domain, and if the domain is disabled it could
458 * cause system errors. This is why the pm_domain_always_on_gov
460 * For the same reason, the clocks should be enabled in case
461 * we need to power the domain off, otherwise the internal clocks
462 * prepare/enable counters won't be in sync.
464 if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
465 ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
469 dom->base.flags = GENPD_FLAG_ALWAYS_ON;
470 ret = pm_genpd_init(&dom->base, NULL, false);
474 ret = pm_genpd_init(&dom->base, NULL,
475 (dom->desc.is_powered_off ?
476 dom->desc.is_powered_off(dom) : true));
484 static int meson_ee_pwrc_probe(struct platform_device *pdev)
486 const struct meson_ee_pwrc_domain_data *match;
487 struct regmap *regmap_ao, *regmap_hhi;
488 struct device_node *parent_np;
489 struct meson_ee_pwrc *pwrc;
492 match = of_device_get_match_data(&pdev->dev);
494 dev_err(&pdev->dev, "failed to get match data\n");
498 pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL);
502 pwrc->xlate.domains = devm_kcalloc(&pdev->dev, match->count,
503 sizeof(*pwrc->xlate.domains),
505 if (!pwrc->xlate.domains)
508 pwrc->domains = devm_kcalloc(&pdev->dev, match->count,
509 sizeof(*pwrc->domains), GFP_KERNEL);
513 pwrc->xlate.num_domains = match->count;
515 parent_np = of_get_parent(pdev->dev.of_node);
516 regmap_hhi = syscon_node_to_regmap(parent_np);
517 of_node_put(parent_np);
518 if (IS_ERR(regmap_hhi)) {
519 dev_err(&pdev->dev, "failed to get HHI regmap\n");
520 return PTR_ERR(regmap_hhi);
523 regmap_ao = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
524 "amlogic,ao-sysctrl");
525 if (IS_ERR(regmap_ao)) {
526 dev_err(&pdev->dev, "failed to get AO regmap\n");
527 return PTR_ERR(regmap_ao);
530 pwrc->regmap_ao = regmap_ao;
531 pwrc->regmap_hhi = regmap_hhi;
533 platform_set_drvdata(pdev, pwrc);
535 for (i = 0 ; i < match->count ; ++i) {
536 struct meson_ee_pwrc_domain *dom = &pwrc->domains[i];
538 memcpy(&dom->desc, &match->domains[i], sizeof(dom->desc));
540 ret = meson_ee_pwrc_init_domain(pdev, pwrc, dom);
544 pwrc->xlate.domains[i] = &dom->base;
547 return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
550 static void meson_ee_pwrc_shutdown(struct platform_device *pdev)
552 struct meson_ee_pwrc *pwrc = platform_get_drvdata(pdev);
555 for (i = 0 ; i < pwrc->xlate.num_domains ; ++i) {
556 struct meson_ee_pwrc_domain *dom = &pwrc->domains[i];
558 if (dom->desc.is_powered_off && !dom->desc.is_powered_off(dom))
559 meson_ee_pwrc_off(&dom->base);
563 static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = {
564 .count = ARRAY_SIZE(g12a_pwrc_domains),
565 .domains = g12a_pwrc_domains,
568 static struct meson_ee_pwrc_domain_data meson_ee_axg_pwrc_data = {
569 .count = ARRAY_SIZE(axg_pwrc_domains),
570 .domains = axg_pwrc_domains,
573 static struct meson_ee_pwrc_domain_data meson_ee_gxbb_pwrc_data = {
574 .count = ARRAY_SIZE(gxbb_pwrc_domains),
575 .domains = gxbb_pwrc_domains,
578 static struct meson_ee_pwrc_domain_data meson_ee_m8_pwrc_data = {
579 .count = ARRAY_SIZE(meson8_pwrc_domains),
580 .domains = meson8_pwrc_domains,
583 static struct meson_ee_pwrc_domain_data meson_ee_m8b_pwrc_data = {
584 .count = ARRAY_SIZE(meson8b_pwrc_domains),
585 .domains = meson8b_pwrc_domains,
588 static struct meson_ee_pwrc_domain_data meson_ee_sm1_pwrc_data = {
589 .count = ARRAY_SIZE(sm1_pwrc_domains),
590 .domains = sm1_pwrc_domains,
593 static const struct of_device_id meson_ee_pwrc_match_table[] = {
595 .compatible = "amlogic,meson8-pwrc",
596 .data = &meson_ee_m8_pwrc_data,
599 .compatible = "amlogic,meson8b-pwrc",
600 .data = &meson_ee_m8b_pwrc_data,
603 .compatible = "amlogic,meson8m2-pwrc",
604 .data = &meson_ee_m8b_pwrc_data,
607 .compatible = "amlogic,meson-axg-pwrc",
608 .data = &meson_ee_axg_pwrc_data,
611 .compatible = "amlogic,meson-gxbb-pwrc",
612 .data = &meson_ee_gxbb_pwrc_data,
615 .compatible = "amlogic,meson-g12a-pwrc",
616 .data = &meson_ee_g12a_pwrc_data,
619 .compatible = "amlogic,meson-sm1-pwrc",
620 .data = &meson_ee_sm1_pwrc_data,
624 MODULE_DEVICE_TABLE(of, meson_ee_pwrc_match_table);
626 static struct platform_driver meson_ee_pwrc_driver = {
627 .probe = meson_ee_pwrc_probe,
628 .shutdown = meson_ee_pwrc_shutdown,
630 .name = "meson_ee_pwrc",
631 .of_match_table = meson_ee_pwrc_match_table,
634 module_platform_driver(meson_ee_pwrc_driver);
635 MODULE_LICENSE("GPL v2");