summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-09-05 09:04:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-13 12:07:55 +0200
commit579a72e317362ca2e1d4d9692c1b082c535203b5 (patch)
tree2c4c1d5cfc95749bb219cb4dc34a3b6a99bbcb8e /commands
parent6dd56795a1e6686bb11891777070f41e12a4545a (diff)
downloadbarebox-579a72e317362ca2e1d4d9692c1b082c535203b5.tar.gz
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 <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905070448.539531-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/Kconfig8
-rw-r--r--commands/Makefile1
-rw-r--r--commands/pm_domain.c18
3 files changed, 27 insertions, 0 deletions
diff --git a/commands/Kconfig b/commands/Kconfig
index 3e21dc4c05..9894ecb9aa 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -240,6 +240,14 @@ config CMD_REGULATOR
the regulator command lists the currently registered regulators and
their current state.
+config CMD_PM_DOMAIN
+ bool
+ depends on PM_GENERIC_DOMAINS
+ prompt "pm_domain command"
+ help
+ The pm_domain command lists the currently registered power domains and
+ their current state.
+
config CMD_NVMEM
bool
depends on NVMEM
diff --git a/commands/Makefile b/commands/Makefile
index 0aae8893d6..068fbb32da 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -116,6 +116,7 @@ obj-$(CONFIG_CMD_READF) += readf.o
obj-$(CONFIG_CMD_MENUTREE) += menutree.o
obj-$(CONFIG_CMD_2048) += 2048.o
obj-$(CONFIG_CMD_REGULATOR) += regulator.o
+obj-$(CONFIG_CMD_PM_DOMAIN) += pm_domain.o
obj-$(CONFIG_CMD_LSPCI) += lspci.o
obj-$(CONFIG_CMD_IMD) += imd.o
obj-$(CONFIG_CMD_HWCLOCK) += hwclock.o
diff --git a/commands/pm_domain.c b/commands/pm_domain.c
new file mode 100644
index 0000000000..ec8b769df1
--- /dev/null
+++ b/commands/pm_domain.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <common.h>
+#include <command.h>
+#include <pm_domain.h>
+
+static int do_pm_domain(int argc, char *argv[])
+{
+ pm_genpd_print();
+
+ return 0;
+}
+
+BAREBOX_CMD_START(pm_domain)
+ .cmd = do_pm_domain,
+ BAREBOX_CMD_DESC("list power domains")
+ BAREBOX_CMD_GROUP(CMD_GRP_INFO)
+BAREBOX_CMD_END