2 * Copyright (C) 2017 ZTE Ltd.
4 * Author: Baoyou Xie <baoyou.xie@linaro.org>
5 * License terms: GNU General Public License (GPL) version 2
8 #include <dt-bindings/soc/zte,pm_domains.h>
9 #include "zx2967_pm_domains.h"
11 static u16 zx296718_offsets
[REG_ARRAY_SIZE
] = {
16 [REG_ACK_SYNC
] = 0x28,
34 static struct zx2967_pm_domain vou_domain
= {
40 .reg_offset
= zx296718_offsets
,
43 static struct zx2967_pm_domain sappu_domain
= {
45 .name
= "sappu_domain",
49 .reg_offset
= zx296718_offsets
,
52 static struct zx2967_pm_domain vde_domain
= {
58 .reg_offset
= zx296718_offsets
,
61 static struct zx2967_pm_domain vce_domain
= {
67 .reg_offset
= zx296718_offsets
,
70 static struct zx2967_pm_domain hde_domain
= {
76 .reg_offset
= zx296718_offsets
,
79 static struct zx2967_pm_domain viu_domain
= {
85 .reg_offset
= zx296718_offsets
,
88 static struct zx2967_pm_domain usb20_domain
= {
90 .name
= "usb20_domain",
94 .reg_offset
= zx296718_offsets
,
97 static struct zx2967_pm_domain usb21_domain
= {
99 .name
= "usb21_domain",
103 .reg_offset
= zx296718_offsets
,
106 static struct zx2967_pm_domain usb30_domain
= {
108 .name
= "usb30_domain",
112 .reg_offset
= zx296718_offsets
,
115 static struct zx2967_pm_domain hsic_domain
= {
117 .name
= "hsic_domain",
121 .reg_offset
= zx296718_offsets
,
124 static struct zx2967_pm_domain gmac_domain
= {
126 .name
= "gmac_domain",
130 .reg_offset
= zx296718_offsets
,
133 static struct zx2967_pm_domain ts_domain
= {
139 .reg_offset
= zx296718_offsets
,
142 static struct generic_pm_domain
*zx296718_pm_domains
[] = {
143 [DM_ZX296718_VOU
] = &vou_domain
.dm
,
144 [DM_ZX296718_SAPPU
] = &sappu_domain
.dm
,
145 [DM_ZX296718_VDE
] = &vde_domain
.dm
,
146 [DM_ZX296718_VCE
] = &vce_domain
.dm
,
147 [DM_ZX296718_HDE
] = &hde_domain
.dm
,
148 [DM_ZX296718_VIU
] = &viu_domain
.dm
,
149 [DM_ZX296718_USB20
] = &usb20_domain
.dm
,
150 [DM_ZX296718_USB21
] = &usb21_domain
.dm
,
151 [DM_ZX296718_USB30
] = &usb30_domain
.dm
,
152 [DM_ZX296718_HSIC
] = &hsic_domain
.dm
,
153 [DM_ZX296718_GMAC
] = &gmac_domain
.dm
,
154 [DM_ZX296718_TS
] = &ts_domain
.dm
,
157 static int zx296718_pd_probe(struct platform_device
*pdev
)
159 return zx2967_pd_probe(pdev
,
161 ARRAY_SIZE(zx296718_pm_domains
));
164 static const struct of_device_id zx296718_pm_domain_matches
[] = {
165 { .compatible
= "zte,zx296718-pcu", },
169 static struct platform_driver zx296718_pd_driver
= {
171 .name
= "zx296718-powerdomain",
172 .of_match_table
= zx296718_pm_domain_matches
,
174 .probe
= zx296718_pd_probe
,
177 static int __init
zx296718_pd_init(void)
179 return platform_driver_register(&zx296718_pd_driver
);
181 subsys_initcall(zx296718_pd_init
);