Lines Matching refs:genpd
42 struct generic_pm_domain genpd; member
49 #define genpd_to_apple_pmgr_ps(_genpd) container_of(_genpd, struct apple_pmgr_ps, genpd)
52 static int apple_pmgr_ps_set(struct generic_pm_domain *genpd, u32 pstate, bool auto_enable) in apple_pmgr_ps_set() argument
55 struct apple_pmgr_ps *ps = genpd_to_apple_pmgr_ps(genpd); in apple_pmgr_ps_set()
65 genpd->name); in apple_pmgr_ps_set()
70 dev_dbg(ps->dev, "PS %s: pwrstate = 0x%x: 0x%x\n", genpd->name, pstate, reg); in apple_pmgr_ps_set()
80 genpd->name, pstate, reg); in apple_pmgr_ps_set()
106 static int apple_pmgr_ps_power_on(struct generic_pm_domain *genpd) in apple_pmgr_ps_power_on() argument
108 return apple_pmgr_ps_set(genpd, APPLE_PMGR_PS_ACTIVE, true); in apple_pmgr_ps_power_on()
111 static int apple_pmgr_ps_power_off(struct generic_pm_domain *genpd) in apple_pmgr_ps_power_off() argument
113 return apple_pmgr_ps_set(genpd, APPLE_PMGR_PS_PWRGATE, false); in apple_pmgr_ps_power_off()
121 spin_lock_irqsave(&ps->genpd.slock, flags); in apple_pmgr_reset_assert()
123 if (ps->genpd.status == GENPD_STATE_OFF) in apple_pmgr_reset_assert()
133 spin_unlock_irqrestore(&ps->genpd.slock, flags); in apple_pmgr_reset_assert()
143 spin_lock_irqsave(&ps->genpd.slock, flags); in apple_pmgr_reset_deassert()
149 if (ps->genpd.status == GENPD_STATE_OFF) in apple_pmgr_reset_deassert()
152 spin_unlock_irqrestore(&ps->genpd.slock, flags); in apple_pmgr_reset_deassert()
227 ps->genpd.flags |= GENPD_FLAG_IRQ_SAFE; in apple_pmgr_ps_probe()
228 ps->genpd.name = name; in apple_pmgr_ps_probe()
229 ps->genpd.power_on = apple_pmgr_ps_power_on; in apple_pmgr_ps_probe()
230 ps->genpd.power_off = apple_pmgr_ps_power_off; in apple_pmgr_ps_probe()
239 ps->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in apple_pmgr_ps_probe()
243 active = apple_pmgr_ps_power_on(&ps->genpd) == 0; in apple_pmgr_ps_probe()
252 ret = pm_genpd_init(&ps->genpd, NULL, !active); in apple_pmgr_ps_probe()
258 ret = of_genpd_add_provider_simple(node, &ps->genpd); in apple_pmgr_ps_probe()
304 pm_genpd_remove(&ps->genpd); in apple_pmgr_ps_probe()