USB: serial: option: reimplement interface masking
[linux/fpc-iii.git] / arch / arm / mach-ux500 / pm_domains.c
blob4d71c90f801caf6ac5a6e4d150c7751e6066f2da
1 /*
2 * Copyright (C) 2014 Linaro Ltd.
4 * Author: Ulf Hansson <ulf.hansson@linaro.org>
5 * License terms: GNU General Public License (GPL) version 2
7 * Implements PM domains using the generic PM domain for ux500.
8 */
9 #include <linux/printk.h>
10 #include <linux/slab.h>
11 #include <linux/err.h>
12 #include <linux/of.h>
13 #include <linux/pm_domain.h>
15 #include <dt-bindings/arm/ux500_pm_domains.h>
16 #include "pm_domains.h"
18 static int pd_power_off(struct generic_pm_domain *domain)
21 * Handle the gating of the PM domain regulator here.
23 * Drivers/subsystems handling devices in the PM domain needs to perform
24 * register context save/restore from their respective runtime PM
25 * callbacks, to be able to enable PM domain gating/ungating.
27 return 0;
30 static int pd_power_on(struct generic_pm_domain *domain)
33 * Handle the ungating of the PM domain regulator here.
35 * Drivers/subsystems handling devices in the PM domain needs to perform
36 * register context save/restore from their respective runtime PM
37 * callbacks, to be able to enable PM domain gating/ungating.
39 return 0;
42 static struct generic_pm_domain ux500_pm_domain_vape = {
43 .name = "VAPE",
44 .power_off = pd_power_off,
45 .power_on = pd_power_on,
48 static struct generic_pm_domain *ux500_pm_domains[NR_DOMAINS] = {
49 [DOMAIN_VAPE] = &ux500_pm_domain_vape,
52 static const struct of_device_id ux500_pm_domain_matches[] __initconst = {
53 { .compatible = "stericsson,ux500-pm-domains", },
54 { },
57 int __init ux500_pm_domains_init(void)
59 struct device_node *np;
60 struct genpd_onecell_data *genpd_data;
61 int i;
63 np = of_find_matching_node(NULL, ux500_pm_domain_matches);
64 if (!np)
65 return -ENODEV;
67 genpd_data = kzalloc(sizeof(*genpd_data), GFP_KERNEL);
68 if (!genpd_data)
69 return -ENOMEM;
71 genpd_data->domains = ux500_pm_domains;
72 genpd_data->num_domains = ARRAY_SIZE(ux500_pm_domains);
74 for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
75 pm_genpd_init(ux500_pm_domains[i], NULL, false);
77 of_genpd_add_provider_onecell(np, genpd_data);
78 return 0;