Lines Matching refs:pm_domain
28 struct mmp_pm_domain *pm_domain = to_mmp_pm_domain(genpd); in mmp_pm_domain_power_on() local
32 if (pm_domain->lock) in mmp_pm_domain_power_on()
33 spin_lock_irqsave(pm_domain->lock, flags); in mmp_pm_domain_power_on()
35 val = readl(pm_domain->reg); in mmp_pm_domain_power_on()
38 val |= pm_domain->power_on; in mmp_pm_domain_power_on()
39 writel(val, pm_domain->reg); in mmp_pm_domain_power_on()
43 writel(val, pm_domain->reg); in mmp_pm_domain_power_on()
46 if (pm_domain->reset || pm_domain->clock_enable) { in mmp_pm_domain_power_on()
49 val &= ~pm_domain->reset; in mmp_pm_domain_power_on()
50 writel(val, pm_domain->reg); in mmp_pm_domain_power_on()
52 val |= pm_domain->clock_enable; in mmp_pm_domain_power_on()
53 writel(val, pm_domain->reg); in mmp_pm_domain_power_on()
55 val |= pm_domain->reset; in mmp_pm_domain_power_on()
56 writel(val, pm_domain->reg); in mmp_pm_domain_power_on()
58 writel(after_power_on, pm_domain->reg); in mmp_pm_domain_power_on()
61 if (pm_domain->lock) in mmp_pm_domain_power_on()
62 spin_unlock_irqrestore(pm_domain->lock, flags); in mmp_pm_domain_power_on()
69 struct mmp_pm_domain *pm_domain = to_mmp_pm_domain(genpd); in mmp_pm_domain_power_off() local
73 if (pm_domain->flags & MMP_PM_DOMAIN_NO_DISABLE) in mmp_pm_domain_power_off()
76 if (pm_domain->lock) in mmp_pm_domain_power_off()
77 spin_lock_irqsave(pm_domain->lock, flags); in mmp_pm_domain_power_off()
80 val = readl(pm_domain->reg); in mmp_pm_domain_power_off()
81 val &= ~pm_domain->power_on; in mmp_pm_domain_power_off()
83 writel(val, pm_domain->reg); in mmp_pm_domain_power_off()
85 if (pm_domain->lock) in mmp_pm_domain_power_off()
86 spin_unlock_irqrestore(pm_domain->lock, flags); in mmp_pm_domain_power_off()
96 struct mmp_pm_domain *pm_domain; in mmp_pm_domain_register() local
98 pm_domain = kzalloc(sizeof(*pm_domain), GFP_KERNEL); in mmp_pm_domain_register()
99 if (!pm_domain) in mmp_pm_domain_register()
102 pm_domain->reg = reg; in mmp_pm_domain_register()
103 pm_domain->power_on = power_on; in mmp_pm_domain_register()
104 pm_domain->reset = reset; in mmp_pm_domain_register()
105 pm_domain->clock_enable = clock_enable; in mmp_pm_domain_register()
106 pm_domain->flags = flags; in mmp_pm_domain_register()
107 pm_domain->lock = lock; in mmp_pm_domain_register()
109 pm_genpd_init(&pm_domain->genpd, NULL, true); in mmp_pm_domain_register()
110 pm_domain->genpd.name = name; in mmp_pm_domain_register()
111 pm_domain->genpd.power_on = mmp_pm_domain_power_on; in mmp_pm_domain_register()
112 pm_domain->genpd.power_off = mmp_pm_domain_power_off; in mmp_pm_domain_register()
114 return &pm_domain->genpd; in mmp_pm_domain_register()