Lines Matching full:scp

112  * struct scp_domain_data - scp domain data for power on/off flow
133 struct scp;
137 struct scp *scp; member
148 struct scp { struct
174 struct scp *scp = scpd->scp; in scpsys_domain_is_on() argument
176 u32 status = readl(scp->base + scp->ctrl_reg.pwr_sta_offs) & in scpsys_domain_is_on()
178 u32 status2 = readl(scp->base + scp->ctrl_reg.pwr_sta2nd_offs) & in scpsys_domain_is_on()
281 struct scp *scp = scpd->scp; in scpsys_bus_protect_enable() local
286 return mtk_infracfg_set_bus_protection(scp->infracfg, in scpsys_bus_protect_enable()
288 scp->bus_prot_reg_update); in scpsys_bus_protect_enable()
293 struct scp *scp = scpd->scp; in scpsys_bus_protect_disable() local
298 return mtk_infracfg_clear_bus_protection(scp->infracfg, in scpsys_bus_protect_disable()
300 scp->bus_prot_reg_update); in scpsys_bus_protect_disable()
306 struct scp *scp = scpd->scp; in scpsys_power_on() local
307 void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs; in scpsys_power_on()
356 dev_err(scp->dev, "Failed to power on domain %s\n", genpd->name); in scpsys_power_on()
364 struct scp *scp = scpd->scp; in scpsys_power_off() local
365 void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs; in scpsys_power_off()
409 dev_err(scp->dev, "Failed to power off domain %s\n", genpd->name); in scpsys_power_off()
422 static struct scp *init_scp(struct platform_device *pdev, in init_scp()
429 struct scp *scp; in init_scp() local
432 scp = devm_kzalloc(&pdev->dev, sizeof(*scp), GFP_KERNEL); in init_scp()
433 if (!scp) in init_scp()
436 scp->ctrl_reg.pwr_sta_offs = scp_ctrl_reg->pwr_sta_offs; in init_scp()
437 scp->ctrl_reg.pwr_sta2nd_offs = scp_ctrl_reg->pwr_sta2nd_offs; in init_scp()
439 scp->bus_prot_reg_update = bus_prot_reg_update; in init_scp()
441 scp->dev = &pdev->dev; in init_scp()
443 scp->base = devm_platform_ioremap_resource(pdev, 0); in init_scp()
444 if (IS_ERR(scp->base)) in init_scp()
445 return ERR_CAST(scp->base); in init_scp()
447 scp->domains = devm_kcalloc(&pdev->dev, in init_scp()
448 num, sizeof(*scp->domains), GFP_KERNEL); in init_scp()
449 if (!scp->domains) in init_scp()
452 pd_data = &scp->pd_data; in init_scp()
459 scp->infracfg = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in init_scp()
461 if (IS_ERR(scp->infracfg)) { in init_scp()
463 PTR_ERR(scp->infracfg)); in init_scp()
464 return ERR_CAST(scp->infracfg); in init_scp()
468 struct scp_domain *scpd = &scp->domains[i]; in init_scp()
485 struct scp_domain *scpd = &scp->domains[i]; in init_scp()
490 scpd->scp = scp; in init_scp()
513 return scp; in init_scp()
517 struct scp *scp, int num) in mtk_register_power_domains() argument
523 struct scp_domain *scpd = &scp->domains[i]; in mtk_register_power_domains()
544 pd_data = &scp->pd_data; in mtk_register_power_domains()
1110 struct scp *scp; in scpsys_probe() local
1116 scp = init_scp(pdev, soc->domains, soc->num_domains, &soc->regs, in scpsys_probe()
1118 if (IS_ERR(scp)) in scpsys_probe()
1119 return PTR_ERR(scp); in scpsys_probe()
1121 mtk_register_power_domains(pdev, scp, soc->num_domains); in scpsys_probe()
1123 pd_data = &scp->pd_data; in scpsys_probe()