mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
pmdomain: arm_scmi: add support for domain hierarchies
After primary SCMI pmdomain is created, use new of_genpd helper which checks for child domain mappings defined in power-domains-child-ids. Also remove any child domain mappings when SCMI domain is removed. Signed-off-by: Kevin Hilman (TI) <khilman@baylibre.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
29e34a882b
commit
fba9c703c1
|
|
@ -113,6 +113,15 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
|
|||
goto err_rm_genpds;
|
||||
|
||||
dev_set_drvdata(dev, scmi_pd_data);
|
||||
|
||||
/*
|
||||
* Parse (optional) power-domains-child-ids property to establish
|
||||
* parent-child relationships.
|
||||
*/
|
||||
ret = of_genpd_add_child_ids(np, scmi_pd_data);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to add child domain hierarchy: %d\n", ret);
|
||||
|
||||
dev_info(dev, "Initialized %d power domains", num_domains);
|
||||
|
||||
return 0;
|
||||
|
|
@ -130,9 +139,13 @@ static void scmi_pm_domain_remove(struct scmi_device *sdev)
|
|||
struct device *dev = &sdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
|
||||
scmi_pd_data = dev_get_drvdata(dev);
|
||||
|
||||
/* Remove any parent-child relationships established at probe time */
|
||||
of_genpd_remove_child_ids(np, scmi_pd_data);
|
||||
|
||||
of_genpd_del_provider(np);
|
||||
|
||||
scmi_pd_data = dev_get_drvdata(dev);
|
||||
for (i = 0; i < scmi_pd_data->num_domains; i++) {
|
||||
if (!scmi_pd_data->domains[i])
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user