diff options
author | Baoyou Xie <baoyou.xie@linaro.org> | 2017-01-06 04:16:04 -0500 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2017-01-11 03:21:14 -0500 |
commit | 3755584a91c1cb1e50dd24a456e2953fbd276adf (patch) | |
tree | 757c092d18509675afcaf4215f67ca72dae4907d /drivers | |
parent | 4c2c2e39713b8cfbb73d304c830e883f5b2ad9ec (diff) |
soc: zte: pm_domains: Add support for zx296718
This patch introduces the power domain driver of zx296718
which belongs to zte's zx2967 family.
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/zte/Makefile | 1 | ||||
-rw-r--r-- | drivers/soc/zte/zx296718_pm_domains.c | 182 |
2 files changed, 183 insertions, 0 deletions
diff --git a/drivers/soc/zte/Makefile b/drivers/soc/zte/Makefile index 8a37f2f7ed27..96b7cd4c9629 100644 --- a/drivers/soc/zte/Makefile +++ b/drivers/soc/zte/Makefile | |||
@@ -2,3 +2,4 @@ | |||
2 | # ZTE SOC drivers | 2 | # ZTE SOC drivers |
3 | # | 3 | # |
4 | obj-$(CONFIG_ZX2967_PM_DOMAINS) += zx2967_pm_domains.o | 4 | obj-$(CONFIG_ZX2967_PM_DOMAINS) += zx2967_pm_domains.o |
5 | obj-$(CONFIG_ZX2967_PM_DOMAINS) += zx296718_pm_domains.o | ||
diff --git a/drivers/soc/zte/zx296718_pm_domains.c b/drivers/soc/zte/zx296718_pm_domains.c new file mode 100644 index 000000000000..5ed924fee855 --- /dev/null +++ b/drivers/soc/zte/zx296718_pm_domains.c | |||
@@ -0,0 +1,182 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 ZTE Ltd. | ||
3 | * | ||
4 | * Author: Baoyou Xie <baoyou.xie@linaro.org> | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <dt-bindings/soc/zte,pm_domains.h> | ||
9 | #include "zx2967_pm_domains.h" | ||
10 | |||
11 | static u16 zx296718_offsets[REG_ARRAY_SIZE] = { | ||
12 | [REG_CLKEN] = 0x18, | ||
13 | [REG_ISOEN] = 0x1c, | ||
14 | [REG_RSTEN] = 0x20, | ||
15 | [REG_PWREN] = 0x24, | ||
16 | [REG_ACK_SYNC] = 0x28, | ||
17 | }; | ||
18 | |||
19 | enum { | ||
20 | PCU_DM_VOU = 0, | ||
21 | PCU_DM_SAPPU, | ||
22 | PCU_DM_VDE, | ||
23 | PCU_DM_VCE, | ||
24 | PCU_DM_HDE, | ||
25 | PCU_DM_VIU, | ||
26 | PCU_DM_USB20, | ||
27 | PCU_DM_USB21, | ||
28 | PCU_DM_USB30, | ||
29 | PCU_DM_HSIC, | ||
30 | PCU_DM_GMAC, | ||
31 | PCU_DM_TS, | ||
32 | }; | ||
33 | |||
34 | static struct zx2967_pm_domain vou_domain = { | ||
35 | .dm = { | ||
36 | .name = "vou_domain", | ||
37 | }, | ||
38 | .bit = PCU_DM_VOU, | ||
39 | .polarity = PWREN, | ||
40 | .reg_offset = zx296718_offsets, | ||
41 | }; | ||
42 | |||
43 | static struct zx2967_pm_domain sappu_domain = { | ||
44 | .dm = { | ||
45 | .name = "sappu_domain", | ||
46 | }, | ||
47 | .bit = PCU_DM_SAPPU, | ||
48 | .polarity = PWREN, | ||
49 | .reg_offset = zx296718_offsets, | ||
50 | }; | ||
51 | |||
52 | static struct zx2967_pm_domain vde_domain = { | ||
53 | .dm = { | ||
54 | .name = "vde_domain", | ||
55 | }, | ||
56 | .bit = PCU_DM_VDE, | ||
57 | .polarity = PWREN, | ||
58 | .reg_offset = zx296718_offsets, | ||
59 | }; | ||
60 | |||
61 | static struct zx2967_pm_domain vce_domain = { | ||
62 | .dm = { | ||
63 | .name = "vce_domain", | ||
64 | }, | ||
65 | .bit = PCU_DM_VCE, | ||
66 | .polarity = PWREN, | ||
67 | .reg_offset = zx296718_offsets, | ||
68 | }; | ||
69 | |||
70 | static struct zx2967_pm_domain hde_domain = { | ||
71 | .dm = { | ||
72 | .name = "hde_domain", | ||
73 | }, | ||
74 | .bit = PCU_DM_HDE, | ||
75 | .polarity = PWREN, | ||
76 | .reg_offset = zx296718_offsets, | ||
77 | }; | ||
78 | |||
79 | static struct zx2967_pm_domain viu_domain = { | ||
80 | .dm = { | ||
81 | .name = "viu_domain", | ||
82 | }, | ||
83 | .bit = PCU_DM_VIU, | ||
84 | .polarity = PWREN, | ||
85 | .reg_offset = zx296718_offsets, | ||
86 | }; | ||
87 | |||
88 | static struct zx2967_pm_domain usb20_domain = { | ||
89 | .dm = { | ||
90 | .name = "usb20_domain", | ||
91 | }, | ||
92 | .bit = PCU_DM_USB20, | ||
93 | .polarity = PWREN, | ||
94 | .reg_offset = zx296718_offsets, | ||
95 | }; | ||
96 | |||
97 | static struct zx2967_pm_domain usb21_domain = { | ||
98 | .dm = { | ||
99 | .name = "usb21_domain", | ||
100 | }, | ||
101 | .bit = PCU_DM_USB21, | ||
102 | .polarity = PWREN, | ||
103 | .reg_offset = zx296718_offsets, | ||
104 | }; | ||
105 | |||
106 | static struct zx2967_pm_domain usb30_domain = { | ||
107 | .dm = { | ||
108 | .name = "usb30_domain", | ||
109 | }, | ||
110 | .bit = PCU_DM_USB30, | ||
111 | .polarity = PWREN, | ||
112 | .reg_offset = zx296718_offsets, | ||
113 | }; | ||
114 | |||
115 | static struct zx2967_pm_domain hsic_domain = { | ||
116 | .dm = { | ||
117 | .name = "hsic_domain", | ||
118 | }, | ||
119 | .bit = PCU_DM_HSIC, | ||
120 | .polarity = PWREN, | ||
121 | .reg_offset = zx296718_offsets, | ||
122 | }; | ||
123 | |||
124 | static struct zx2967_pm_domain gmac_domain = { | ||
125 | .dm = { | ||
126 | .name = "gmac_domain", | ||
127 | }, | ||
128 | .bit = PCU_DM_GMAC, | ||
129 | .polarity = PWREN, | ||
130 | .reg_offset = zx296718_offsets, | ||
131 | }; | ||
132 | |||
133 | static struct zx2967_pm_domain ts_domain = { | ||
134 | .dm = { | ||
135 | .name = "ts_domain", | ||
136 | }, | ||
137 | .bit = PCU_DM_TS, | ||
138 | .polarity = PWREN, | ||
139 | .reg_offset = zx296718_offsets, | ||
140 | }; | ||
141 | |||
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, | ||
155 | }; | ||
156 | |||
157 | static int zx296718_pd_probe(struct platform_device *pdev) | ||
158 | { | ||
159 | return zx2967_pd_probe(pdev, | ||
160 | zx296718_pm_domains, | ||
161 | ARRAY_SIZE(zx296718_pm_domains)); | ||
162 | } | ||
163 | |||
164 | static const struct of_device_id zx296718_pm_domain_matches[] = { | ||
165 | { .compatible = "zte,zx296718-pcu", }, | ||
166 | { }, | ||
167 | }; | ||
168 | |||
169 | static struct platform_driver zx296718_pd_driver = { | ||
170 | .driver = { | ||
171 | .name = "zx296718-powerdomain", | ||
172 | .owner = THIS_MODULE, | ||
173 | .of_match_table = zx296718_pm_domain_matches, | ||
174 | }, | ||
175 | .probe = zx296718_pd_probe, | ||
176 | }; | ||
177 | |||
178 | static int __init zx296718_pd_init(void) | ||
179 | { | ||
180 | return platform_driver_register(&zx296718_pd_driver); | ||
181 | } | ||
182 | subsys_initcall(zx296718_pd_init); | ||