Lines Matching defs:scpd
172 static int scpsys_domain_is_on(struct scp_domain *scpd)
174 struct scp *scp = scpd->scp;
177 scpd->data->sta_mask;
179 scpd->data->sta_mask;
194 static int scpsys_regulator_enable(struct scp_domain *scpd)
196 if (!scpd->supply)
199 return regulator_enable(scpd->supply);
202 static int scpsys_regulator_disable(struct scp_domain *scpd)
204 if (!scpd->supply)
207 return regulator_disable(scpd->supply);
233 static int scpsys_sram_enable(struct scp_domain *scpd, void __iomem *ctl_addr)
236 u32 pdn_ack = scpd->data->sram_pdn_ack_bits;
240 val &= ~scpd->data->sram_pdn_bits;
244 if (MTK_SCPD_CAPS(scpd, MTK_SCPD_FWAIT_SRAM)) {
263 static int scpsys_sram_disable(struct scp_domain *scpd, void __iomem *ctl_addr)
266 u32 pdn_ack = scpd->data->sram_pdn_ack_bits;
270 val |= scpd->data->sram_pdn_bits;
279 static int scpsys_bus_protect_enable(struct scp_domain *scpd)
281 struct scp *scp = scpd->scp;
283 if (!scpd->data->bus_prot_mask)
287 scpd->data->bus_prot_mask,
291 static int scpsys_bus_protect_disable(struct scp_domain *scpd)
293 struct scp *scp = scpd->scp;
295 if (!scpd->data->bus_prot_mask)
299 scpd->data->bus_prot_mask,
305 struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd);
306 struct scp *scp = scpd->scp;
307 void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs;
311 ret = scpsys_regulator_enable(scpd);
315 ret = scpsys_clk_enable(scpd->clk, MAX_CLKS);
327 ret = readx_poll_timeout(scpsys_domain_is_on, scpd, tmp, tmp > 0,
341 ret = scpsys_sram_enable(scpd, ctl_addr);
345 ret = scpsys_bus_protect_disable(scpd);
352 scpsys_clk_disable(scpd->clk, MAX_CLKS);
354 scpsys_regulator_disable(scpd);
363 struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd);
364 struct scp *scp = scpd->scp;
365 void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs;
369 ret = scpsys_bus_protect_enable(scpd);
373 ret = scpsys_sram_disable(scpd, ctl_addr);
395 ret = readx_poll_timeout(scpsys_domain_is_on, scpd, tmp, tmp == 0,
400 scpsys_clk_disable(scpd->clk, MAX_CLKS);
402 ret = scpsys_regulator_disable(scpd);
470 struct scp_domain *scpd = &scp->domains[i];
473 scpd->supply = devm_regulator_get_optional(&pdev->dev, data->name);
474 if (IS_ERR(scpd->supply)) {
475 if (PTR_ERR(scpd->supply) == -ENODEV)
476 scpd->supply = NULL;
478 return ERR_CAST(scpd->supply);
487 struct scp_domain *scpd = &scp->domains[i];
488 struct generic_pm_domain *genpd = &scpd->genpd;
492 scpd->scp = scp;
494 scpd->data = data;
505 scpd->clk[j] = c;
511 if (MTK_SCPD_CAPS(scpd, MTK_SCPD_ACTIVE_WAKEUP))
525 struct scp_domain *scpd = &scp->domains[i];
526 struct generic_pm_domain *genpd = &scpd->genpd;