From 579a72e317362ca2e1d4d9692c1b082c535203b5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Sep 2022 09:04:48 +0200 Subject: commands: add pm_domain for listing power domains Like the regulator command, this new pm_domain command gives an easy way for listing registered power domains and whether barebox had them activated. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220905070448.539531-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- drivers/base/power.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/base/power.c b/drivers/base/power.c index 4a206051b1..3eabf3c897 100644 --- a/drivers/base/power.c +++ b/drivers/base/power.c @@ -266,3 +266,13 @@ int genpd_dev_pm_attach(struct device_d *dev) return __genpd_dev_pm_attach(dev, dev->device_node, 0, true); } EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); + +void pm_genpd_print(void) +{ + struct generic_pm_domain *genpd; + + printf("%-20s %6s\n", "name", "active"); + list_for_each_entry(genpd, &gpd_list, gpd_list_node) + printf("%-20s %6s\n", genpd->name, + genpd->status == GPD_STATE_ACTIVE ? "on" : "off"); +} -- cgit v1.2.3