Lines Matching refs:pmd

75 static int jh71xx_pmu_get_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool *is_on)  in jh71xx_pmu_get_state()  argument
77 struct jh71xx_pmu *pmu = pmd->pmu; in jh71xx_pmu_get_state()
87 static int jh71xx_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on) in jh71xx_pmu_set_state() argument
89 struct jh71xx_pmu *pmu = pmd->pmu; in jh71xx_pmu_set_state()
98 ret = jh71xx_pmu_get_state(pmd, mask, &is_on); in jh71xx_pmu_set_state()
101 pmd->genpd.name); in jh71xx_pmu_set_state()
107 pmd->genpd.name, on ? "en" : "dis"); in jh71xx_pmu_set_state()
162 pmd->genpd.name, on ? "on" : "off"); in jh71xx_pmu_set_state()
171 struct jh71xx_pmu_dev *pmd = container_of(genpd, in jh71xx_pmu_on() local
173 u32 pwr_mask = BIT(pmd->domain_info->bit); in jh71xx_pmu_on()
175 return jh71xx_pmu_set_state(pmd, pwr_mask, true); in jh71xx_pmu_on()
180 struct jh71xx_pmu_dev *pmd = container_of(genpd, in jh71xx_pmu_off() local
182 u32 pwr_mask = BIT(pmd->domain_info->bit); in jh71xx_pmu_off()
184 return jh71xx_pmu_set_state(pmd, pwr_mask, false); in jh71xx_pmu_off()
231 struct jh71xx_pmu_dev *pmd; in jh71xx_pmu_init_domain() local
236 pmd = devm_kzalloc(pmu->dev, sizeof(*pmd), GFP_KERNEL); in jh71xx_pmu_init_domain()
237 if (!pmd) in jh71xx_pmu_init_domain()
240 pmd->domain_info = &pmu->match_data->domain_info[index]; in jh71xx_pmu_init_domain()
241 pmd->pmu = pmu; in jh71xx_pmu_init_domain()
242 pwr_mask = BIT(pmd->domain_info->bit); in jh71xx_pmu_init_domain()
244 pmd->genpd.name = pmd->domain_info->name; in jh71xx_pmu_init_domain()
245 pmd->genpd.flags = pmd->domain_info->flags; in jh71xx_pmu_init_domain()
247 ret = jh71xx_pmu_get_state(pmd, pwr_mask, &is_on); in jh71xx_pmu_init_domain()
250 pmd->genpd.name); in jh71xx_pmu_init_domain()
252 pmd->genpd.power_on = jh71xx_pmu_on; in jh71xx_pmu_init_domain()
253 pmd->genpd.power_off = jh71xx_pmu_off; in jh71xx_pmu_init_domain()
254 pm_genpd_init(&pmd->genpd, NULL, !is_on); in jh71xx_pmu_init_domain()
256 pmu->genpd_data.domains[index] = &pmd->genpd; in jh71xx_pmu_init_domain()