Merge branch 'kvm-hv-xmm-hypercall-fixes' into HEAD
[linux-2.6-microblaze.git] / drivers / soc / qcom / rpmhpd.c
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2018, The Linux Foundation. All rights reserved.*/
3
4 #include <linux/err.h>
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/module.h>
8 #include <linux/mutex.h>
9 #include <linux/pm_domain.h>
10 #include <linux/slab.h>
11 #include <linux/of.h>
12 #include <linux/of_device.h>
13 #include <linux/platform_device.h>
14 #include <linux/pm_opp.h>
15 #include <soc/qcom/cmd-db.h>
16 #include <soc/qcom/rpmh.h>
17 #include <dt-bindings/power/qcom-rpmpd.h>
18
19 #define domain_to_rpmhpd(domain) container_of(domain, struct rpmhpd, pd)
20
21 #define RPMH_ARC_MAX_LEVELS     16
22
23 /**
24  * struct rpmhpd - top level RPMh power domain resource data structure
25  * @dev:                rpmh power domain controller device
26  * @pd:                 generic_pm_domain corrresponding to the power domain
27  * @parent:             generic_pm_domain corrresponding to the parent's power domain
28  * @peer:               A peer power domain in case Active only Voting is
29  *                      supported
30  * @active_only:        True if it represents an Active only peer
31  * @corner:             current corner
32  * @active_corner:      current active corner
33  * @enable_corner:      lowest non-zero corner
34  * @level:              An array of level (vlvl) to corner (hlvl) mappings
35  *                      derived from cmd-db
36  * @level_count:        Number of levels supported by the power domain. max
37  *                      being 16 (0 - 15)
38  * @enabled:            true if the power domain is enabled
39  * @res_name:           Resource name used for cmd-db lookup
40  * @addr:               Resource address as looped up using resource name from
41  *                      cmd-db
42  */
43 struct rpmhpd {
44         struct device   *dev;
45         struct generic_pm_domain pd;
46         struct generic_pm_domain *parent;
47         struct rpmhpd   *peer;
48         const bool      active_only;
49         unsigned int    corner;
50         unsigned int    active_corner;
51         unsigned int    enable_corner;
52         u32             level[RPMH_ARC_MAX_LEVELS];
53         size_t          level_count;
54         bool            enabled;
55         const char      *res_name;
56         u32             addr;
57 };
58
59 struct rpmhpd_desc {
60         struct rpmhpd **rpmhpds;
61         size_t num_pds;
62 };
63
64 static DEFINE_MUTEX(rpmhpd_lock);
65
66 /* RPMH powerdomains */
67
68 static struct rpmhpd cx_ao;
69 static struct rpmhpd mx;
70 static struct rpmhpd mx_ao;
71 static struct rpmhpd cx = {
72         .pd = { .name = "cx", },
73         .peer = &cx_ao,
74         .res_name = "cx.lvl",
75 };
76
77 static struct rpmhpd cx_ao = {
78         .pd = { .name = "cx_ao", },
79         .active_only = true,
80         .peer = &cx,
81         .res_name = "cx.lvl",
82 };
83
84 static struct rpmhpd cx_ao_w_mx_parent;
85 static struct rpmhpd cx_w_mx_parent = {
86         .pd = { .name = "cx", },
87         .peer = &cx_ao_w_mx_parent,
88         .parent = &mx.pd,
89         .res_name = "cx.lvl",
90 };
91
92 static struct rpmhpd cx_ao_w_mx_parent = {
93         .pd = { .name = "cx_ao", },
94         .active_only = true,
95         .peer = &cx_w_mx_parent,
96         .parent = &mx_ao.pd,
97         .res_name = "cx.lvl",
98 };
99
100 static struct rpmhpd ebi = {
101         .pd = { .name = "ebi", },
102         .res_name = "ebi.lvl",
103 };
104
105 static struct rpmhpd gfx = {
106         .pd = { .name = "gfx", },
107         .res_name = "gfx.lvl",
108 };
109
110 static struct rpmhpd lcx = {
111         .pd = { .name = "lcx", },
112         .res_name = "lcx.lvl",
113 };
114
115 static struct rpmhpd lmx = {
116         .pd = { .name = "lmx", },
117         .res_name = "lmx.lvl",
118 };
119
120 static struct rpmhpd mmcx_ao;
121 static struct rpmhpd mmcx = {
122         .pd = { .name = "mmcx", },
123         .peer = &mmcx_ao,
124         .res_name = "mmcx.lvl",
125 };
126
127 static struct rpmhpd mmcx_ao = {
128         .pd = { .name = "mmcx_ao", },
129         .active_only = true,
130         .peer = &mmcx,
131         .res_name = "mmcx.lvl",
132 };
133
134 static struct rpmhpd mmcx_ao_w_cx_parent;
135 static struct rpmhpd mmcx_w_cx_parent = {
136         .pd = { .name = "mmcx", },
137         .peer = &mmcx_ao_w_cx_parent,
138         .parent = &cx.pd,
139         .res_name = "mmcx.lvl",
140 };
141
142 static struct rpmhpd mmcx_ao_w_cx_parent = {
143         .pd = { .name = "mmcx_ao", },
144         .active_only = true,
145         .peer = &mmcx_w_cx_parent,
146         .parent = &cx_ao.pd,
147         .res_name = "mmcx.lvl",
148 };
149
150 static struct rpmhpd mss = {
151         .pd = { .name = "mss", },
152         .res_name = "mss.lvl",
153 };
154
155 static struct rpmhpd mx_ao;
156 static struct rpmhpd mx = {
157         .pd = { .name = "mx", },
158         .peer = &mx_ao,
159         .res_name = "mx.lvl",
160 };
161
162 static struct rpmhpd mx_ao = {
163         .pd = { .name = "mx_ao", },
164         .active_only = true,
165         .peer = &mx,
166         .res_name = "mx.lvl",
167 };
168
169 static struct rpmhpd mxc_ao;
170 static struct rpmhpd mxc = {
171         .pd = { .name = "mxc", },
172         .peer = &mxc_ao,
173         .res_name = "mxc.lvl",
174 };
175
176 static struct rpmhpd mxc_ao = {
177         .pd = { .name = "mxc_ao", },
178         .active_only = true,
179         .peer = &mxc,
180         .res_name = "mxc.lvl",
181 };
182
183 /* SDM845 RPMH powerdomains */
184 static struct rpmhpd *sdm845_rpmhpds[] = {
185         [SDM845_CX] = &cx_w_mx_parent,
186         [SDM845_CX_AO] = &cx_ao_w_mx_parent,
187         [SDM845_EBI] = &ebi,
188         [SDM845_GFX] = &gfx,
189         [SDM845_LCX] = &lcx,
190         [SDM845_LMX] = &lmx,
191         [SDM845_MSS] = &mss,
192         [SDM845_MX] = &mx,
193         [SDM845_MX_AO] = &mx_ao,
194 };
195
196 static const struct rpmhpd_desc sdm845_desc = {
197         .rpmhpds = sdm845_rpmhpds,
198         .num_pds = ARRAY_SIZE(sdm845_rpmhpds),
199 };
200
201 /* SDX55 RPMH powerdomains */
202 static struct rpmhpd *sdx55_rpmhpds[] = {
203         [SDX55_CX] = &cx_w_mx_parent,
204         [SDX55_MSS] = &mss,
205         [SDX55_MX] = &mx,
206 };
207
208 static const struct rpmhpd_desc sdx55_desc = {
209         .rpmhpds = sdx55_rpmhpds,
210         .num_pds = ARRAY_SIZE(sdx55_rpmhpds),
211 };
212
213 /* SM6350 RPMH powerdomains */
214 static struct rpmhpd *sm6350_rpmhpds[] = {
215         [SM6350_CX] = &cx_w_mx_parent,
216         [SM6350_GFX] = &gfx,
217         [SM6350_LCX] = &lcx,
218         [SM6350_LMX] = &lmx,
219         [SM6350_MSS] = &mss,
220         [SM6350_MX] = &mx,
221 };
222
223 static const struct rpmhpd_desc sm6350_desc = {
224         .rpmhpds = sm6350_rpmhpds,
225         .num_pds = ARRAY_SIZE(sm6350_rpmhpds),
226 };
227
228 /* SM8150 RPMH powerdomains */
229 static struct rpmhpd *sm8150_rpmhpds[] = {
230         [SM8150_CX] = &cx_w_mx_parent,
231         [SM8150_CX_AO] = &cx_ao_w_mx_parent,
232         [SM8150_EBI] = &ebi,
233         [SM8150_GFX] = &gfx,
234         [SM8150_LCX] = &lcx,
235         [SM8150_LMX] = &lmx,
236         [SM8150_MMCX] = &mmcx,
237         [SM8150_MMCX_AO] = &mmcx_ao,
238         [SM8150_MSS] = &mss,
239         [SM8150_MX] = &mx,
240         [SM8150_MX_AO] = &mx_ao,
241 };
242
243 static const struct rpmhpd_desc sm8150_desc = {
244         .rpmhpds = sm8150_rpmhpds,
245         .num_pds = ARRAY_SIZE(sm8150_rpmhpds),
246 };
247
248 /* SM8250 RPMH powerdomains */
249 static struct rpmhpd *sm8250_rpmhpds[] = {
250         [SM8250_CX] = &cx_w_mx_parent,
251         [SM8250_CX_AO] = &cx_ao_w_mx_parent,
252         [SM8250_EBI] = &ebi,
253         [SM8250_GFX] = &gfx,
254         [SM8250_LCX] = &lcx,
255         [SM8250_LMX] = &lmx,
256         [SM8250_MMCX] = &mmcx,
257         [SM8250_MMCX_AO] = &mmcx_ao,
258         [SM8250_MX] = &mx,
259         [SM8250_MX_AO] = &mx_ao,
260 };
261
262 static const struct rpmhpd_desc sm8250_desc = {
263         .rpmhpds = sm8250_rpmhpds,
264         .num_pds = ARRAY_SIZE(sm8250_rpmhpds),
265 };
266
267 /* SM8350 Power domains */
268 static struct rpmhpd *sm8350_rpmhpds[] = {
269         [SM8350_CX] = &cx_w_mx_parent,
270         [SM8350_CX_AO] = &cx_ao_w_mx_parent,
271         [SM8350_EBI] = &ebi,
272         [SM8350_GFX] = &gfx,
273         [SM8350_LCX] = &lcx,
274         [SM8350_LMX] = &lmx,
275         [SM8350_MMCX] = &mmcx,
276         [SM8350_MMCX_AO] = &mmcx_ao,
277         [SM8350_MSS] = &mss,
278         [SM8350_MX] = &mx,
279         [SM8350_MX_AO] = &mx_ao,
280         [SM8350_MXC] = &mxc,
281         [SM8350_MXC_AO] = &mxc_ao,
282 };
283
284 static const struct rpmhpd_desc sm8350_desc = {
285         .rpmhpds = sm8350_rpmhpds,
286         .num_pds = ARRAY_SIZE(sm8350_rpmhpds),
287 };
288
289 /* SM8450 RPMH powerdomains */
290 static struct rpmhpd *sm8450_rpmhpds[] = {
291         [SM8450_CX] = &cx,
292         [SM8450_CX_AO] = &cx_ao,
293         [SM8450_EBI] = &ebi,
294         [SM8450_GFX] = &gfx,
295         [SM8450_LCX] = &lcx,
296         [SM8450_LMX] = &lmx,
297         [SM8450_MMCX] = &mmcx_w_cx_parent,
298         [SM8450_MMCX_AO] = &mmcx_ao_w_cx_parent,
299         [SM8450_MSS] = &mss,
300         [SM8450_MX] = &mx,
301         [SM8450_MX_AO] = &mx_ao,
302         [SM8450_MXC] = &mxc,
303         [SM8450_MXC_AO] = &mxc_ao,
304 };
305
306 static const struct rpmhpd_desc sm8450_desc = {
307         .rpmhpds = sm8450_rpmhpds,
308         .num_pds = ARRAY_SIZE(sm8450_rpmhpds),
309 };
310
311 /* SC7180 RPMH powerdomains */
312 static struct rpmhpd *sc7180_rpmhpds[] = {
313         [SC7180_CX] = &cx_w_mx_parent,
314         [SC7180_CX_AO] = &cx_ao_w_mx_parent,
315         [SC7180_GFX] = &gfx,
316         [SC7180_LCX] = &lcx,
317         [SC7180_LMX] = &lmx,
318         [SC7180_MSS] = &mss,
319         [SC7180_MX] = &mx,
320         [SC7180_MX_AO] = &mx_ao,
321 };
322
323 static const struct rpmhpd_desc sc7180_desc = {
324         .rpmhpds = sc7180_rpmhpds,
325         .num_pds = ARRAY_SIZE(sc7180_rpmhpds),
326 };
327
328 /* SC7280 RPMH powerdomains */
329 static struct rpmhpd *sc7280_rpmhpds[] = {
330         [SC7280_CX] = &cx,
331         [SC7280_CX_AO] = &cx_ao,
332         [SC7280_EBI] = &ebi,
333         [SC7280_GFX] = &gfx,
334         [SC7280_LCX] = &lcx,
335         [SC7280_LMX] = &lmx,
336         [SC7280_MSS] = &mss,
337         [SC7280_MX] = &mx,
338         [SC7280_MX_AO] = &mx_ao,
339 };
340
341 static const struct rpmhpd_desc sc7280_desc = {
342         .rpmhpds = sc7280_rpmhpds,
343         .num_pds = ARRAY_SIZE(sc7280_rpmhpds),
344 };
345
346 /* SC8180x RPMH powerdomains */
347 static struct rpmhpd *sc8180x_rpmhpds[] = {
348         [SC8180X_CX] = &cx_w_mx_parent,
349         [SC8180X_CX_AO] = &cx_ao_w_mx_parent,
350         [SC8180X_EBI] = &ebi,
351         [SC8180X_GFX] = &gfx,
352         [SC8180X_LCX] = &lcx,
353         [SC8180X_LMX] = &lmx,
354         [SC8180X_MMCX] = &mmcx,
355         [SC8180X_MMCX_AO] = &mmcx_ao,
356         [SC8180X_MSS] = &mss,
357         [SC8180X_MX] = &mx,
358         [SC8180X_MX_AO] = &mx_ao,
359 };
360
361 static const struct rpmhpd_desc sc8180x_desc = {
362         .rpmhpds = sc8180x_rpmhpds,
363         .num_pds = ARRAY_SIZE(sc8180x_rpmhpds),
364 };
365
366 static const struct of_device_id rpmhpd_match_table[] = {
367         { .compatible = "qcom,sc7180-rpmhpd", .data = &sc7180_desc },
368         { .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc },
369         { .compatible = "qcom,sc8180x-rpmhpd", .data = &sc8180x_desc },
370         { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc },
371         { .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc},
372         { .compatible = "qcom,sm6350-rpmhpd", .data = &sm6350_desc },
373         { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc },
374         { .compatible = "qcom,sm8250-rpmhpd", .data = &sm8250_desc },
375         { .compatible = "qcom,sm8350-rpmhpd", .data = &sm8350_desc },
376         { .compatible = "qcom,sm8450-rpmhpd", .data = &sm8450_desc },
377         { }
378 };
379 MODULE_DEVICE_TABLE(of, rpmhpd_match_table);
380
381 static int rpmhpd_send_corner(struct rpmhpd *pd, int state,
382                               unsigned int corner, bool sync)
383 {
384         struct tcs_cmd cmd = {
385                 .addr = pd->addr,
386                 .data = corner,
387         };
388
389         /*
390          * Wait for an ack only when we are increasing the
391          * perf state of the power domain
392          */
393         if (sync)
394                 return rpmh_write(pd->dev, state, &cmd, 1);
395         else
396                 return rpmh_write_async(pd->dev, state, &cmd, 1);
397 }
398
399 static void to_active_sleep(struct rpmhpd *pd, unsigned int corner,
400                             unsigned int *active, unsigned int *sleep)
401 {
402         *active = corner;
403
404         if (pd->active_only)
405                 *sleep = 0;
406         else
407                 *sleep = *active;
408 }
409
410 /*
411  * This function is used to aggregate the votes across the active only
412  * resources and its peers. The aggregated votes are sent to RPMh as
413  * ACTIVE_ONLY votes (which take effect immediately), as WAKE_ONLY votes
414  * (applied by RPMh on system wakeup) and as SLEEP votes (applied by RPMh
415  * on system sleep).
416  * We send ACTIVE_ONLY votes for resources without any peers. For others,
417  * which have an active only peer, all 3 votes are sent.
418  */
419 static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner)
420 {
421         int ret;
422         struct rpmhpd *peer = pd->peer;
423         unsigned int active_corner, sleep_corner;
424         unsigned int this_active_corner = 0, this_sleep_corner = 0;
425         unsigned int peer_active_corner = 0, peer_sleep_corner = 0;
426
427         to_active_sleep(pd, corner, &this_active_corner, &this_sleep_corner);
428
429         if (peer && peer->enabled)
430                 to_active_sleep(peer, peer->corner, &peer_active_corner,
431                                 &peer_sleep_corner);
432
433         active_corner = max(this_active_corner, peer_active_corner);
434
435         ret = rpmhpd_send_corner(pd, RPMH_ACTIVE_ONLY_STATE, active_corner,
436                                  active_corner > pd->active_corner);
437         if (ret)
438                 return ret;
439
440         pd->active_corner = active_corner;
441
442         if (peer) {
443                 peer->active_corner = active_corner;
444
445                 ret = rpmhpd_send_corner(pd, RPMH_WAKE_ONLY_STATE,
446                                          active_corner, false);
447                 if (ret)
448                         return ret;
449
450                 sleep_corner = max(this_sleep_corner, peer_sleep_corner);
451
452                 return rpmhpd_send_corner(pd, RPMH_SLEEP_STATE, sleep_corner,
453                                           false);
454         }
455
456         return ret;
457 }
458
459 static int rpmhpd_power_on(struct generic_pm_domain *domain)
460 {
461         struct rpmhpd *pd = domain_to_rpmhpd(domain);
462         unsigned int corner;
463         int ret;
464
465         mutex_lock(&rpmhpd_lock);
466
467         corner = max(pd->corner, pd->enable_corner);
468         ret = rpmhpd_aggregate_corner(pd, corner);
469         if (!ret)
470                 pd->enabled = true;
471
472         mutex_unlock(&rpmhpd_lock);
473
474         return ret;
475 }
476
477 static int rpmhpd_power_off(struct generic_pm_domain *domain)
478 {
479         struct rpmhpd *pd = domain_to_rpmhpd(domain);
480         int ret;
481
482         mutex_lock(&rpmhpd_lock);
483
484         ret = rpmhpd_aggregate_corner(pd, 0);
485         if (!ret)
486                 pd->enabled = false;
487
488         mutex_unlock(&rpmhpd_lock);
489
490         return ret;
491 }
492
493 static int rpmhpd_set_performance_state(struct generic_pm_domain *domain,
494                                         unsigned int level)
495 {
496         struct rpmhpd *pd = domain_to_rpmhpd(domain);
497         int ret = 0, i;
498
499         mutex_lock(&rpmhpd_lock);
500
501         for (i = 0; i < pd->level_count; i++)
502                 if (level <= pd->level[i])
503                         break;
504
505         /*
506          * If the level requested is more than that supported by the
507          * max corner, just set it to max anyway.
508          */
509         if (i == pd->level_count)
510                 i--;
511
512         if (pd->enabled) {
513                 /* Ensure that the domain isn't turn off */
514                 if (i < pd->enable_corner)
515                         i = pd->enable_corner;
516
517                 ret = rpmhpd_aggregate_corner(pd, i);
518                 if (ret)
519                         goto out;
520         }
521
522         pd->corner = i;
523 out:
524         mutex_unlock(&rpmhpd_lock);
525
526         return ret;
527 }
528
529 static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd,
530                                                  struct dev_pm_opp *opp)
531 {
532         return dev_pm_opp_get_level(opp);
533 }
534
535 static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd)
536 {
537         int i;
538         const u16 *buf;
539
540         buf = cmd_db_read_aux_data(rpmhpd->res_name, &rpmhpd->level_count);
541         if (IS_ERR(buf))
542                 return PTR_ERR(buf);
543
544         /* 2 bytes used for each command DB aux data entry */
545         rpmhpd->level_count >>= 1;
546
547         if (rpmhpd->level_count > RPMH_ARC_MAX_LEVELS)
548                 return -EINVAL;
549
550         for (i = 0; i < rpmhpd->level_count; i++) {
551                 rpmhpd->level[i] = buf[i];
552
553                 /* Remember the first corner with non-zero level */
554                 if (!rpmhpd->level[rpmhpd->enable_corner] && rpmhpd->level[i])
555                         rpmhpd->enable_corner = i;
556
557                 /*
558                  * The AUX data may be zero padded.  These 0 valued entries at
559                  * the end of the map must be ignored.
560                  */
561                 if (i > 0 && rpmhpd->level[i] == 0) {
562                         rpmhpd->level_count = i;
563                         break;
564                 }
565                 pr_debug("%s: ARC hlvl=%2d --> vlvl=%4u\n", rpmhpd->res_name, i,
566                          rpmhpd->level[i]);
567         }
568
569         return 0;
570 }
571
572 static int rpmhpd_probe(struct platform_device *pdev)
573 {
574         int i, ret;
575         size_t num_pds;
576         struct device *dev = &pdev->dev;
577         struct genpd_onecell_data *data;
578         struct rpmhpd **rpmhpds;
579         const struct rpmhpd_desc *desc;
580
581         desc = of_device_get_match_data(dev);
582         if (!desc)
583                 return -EINVAL;
584
585         rpmhpds = desc->rpmhpds;
586         num_pds = desc->num_pds;
587
588         data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
589         if (!data)
590                 return -ENOMEM;
591
592         data->domains = devm_kcalloc(dev, num_pds, sizeof(*data->domains),
593                                      GFP_KERNEL);
594         if (!data->domains)
595                 return -ENOMEM;
596
597         data->num_domains = num_pds;
598
599         for (i = 0; i < num_pds; i++) {
600                 if (!rpmhpds[i]) {
601                         dev_warn(dev, "rpmhpds[%d] is empty\n", i);
602                         continue;
603                 }
604
605                 rpmhpds[i]->dev = dev;
606                 rpmhpds[i]->addr = cmd_db_read_addr(rpmhpds[i]->res_name);
607                 if (!rpmhpds[i]->addr) {
608                         dev_err(dev, "Could not find RPMh address for resource %s\n",
609                                 rpmhpds[i]->res_name);
610                         return -ENODEV;
611                 }
612
613                 ret = cmd_db_read_slave_id(rpmhpds[i]->res_name);
614                 if (ret != CMD_DB_HW_ARC) {
615                         dev_err(dev, "RPMh slave ID mismatch\n");
616                         return -EINVAL;
617                 }
618
619                 ret = rpmhpd_update_level_mapping(rpmhpds[i]);
620                 if (ret)
621                         return ret;
622
623                 rpmhpds[i]->pd.power_off = rpmhpd_power_off;
624                 rpmhpds[i]->pd.power_on = rpmhpd_power_on;
625                 rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state;
626                 rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state;
627                 pm_genpd_init(&rpmhpds[i]->pd, NULL, true);
628
629                 data->domains[i] = &rpmhpds[i]->pd;
630         }
631
632         /* Add subdomains */
633         for (i = 0; i < num_pds; i++) {
634                 if (!rpmhpds[i])
635                         continue;
636                 if (rpmhpds[i]->parent)
637                         pm_genpd_add_subdomain(rpmhpds[i]->parent,
638                                                &rpmhpds[i]->pd);
639         }
640
641         return of_genpd_add_provider_onecell(pdev->dev.of_node, data);
642 }
643
644 static struct platform_driver rpmhpd_driver = {
645         .driver = {
646                 .name = "qcom-rpmhpd",
647                 .of_match_table = rpmhpd_match_table,
648                 .suppress_bind_attrs = true,
649         },
650         .probe = rpmhpd_probe,
651 };
652
653 static int __init rpmhpd_init(void)
654 {
655         return platform_driver_register(&rpmhpd_driver);
656 }
657 core_initcall(rpmhpd_init);
658
659 MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPMh Power Domain Driver");
660 MODULE_LICENSE("GPL v2");