aboutsummaryrefslogtreecommitdiff
path: root/powerdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'powerdebug.c')
-rw-r--r--powerdebug.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/powerdebug.c b/powerdebug.c
index 188c91d..e18670e 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -35,14 +35,15 @@ void usage(void)
printf("Usage: powerdebug [OPTIONS]\n");
printf("\n");
printf("powerdebug -d [ -r ] [ -s ] [ -c [ -f <clock-name> ] ] "
- "[ -g ] [ -v ]\n");
- printf("powerdebug [ -r | -s | -c | -g]\n");
+ "[ -g ] [ -p ] [ -v ]\n");
+ printf("powerdebug [ -r | -s | -c | -g | -p]\n");
printf(" -r, --regulator Show regulator information\n");
printf(" -s, --sensor Show sensor information\n");
printf(" -c, --clock Show clock information\n");
printf(" -f, --findparents Show all parents for a particular"
" clock\n");
printf(" -g, --gpio Show gpio information\n");
+ printf(" -p, --powerdomain Show powerdomain information\n");
printf(" -t, --time Set ticktime in seconds (eg. 10.0)\n");
printf(" -d, --dump Dump information once (no refresh)\n");
printf(" -v, --verbose Verbose mode (use with -r and/or"
@@ -62,6 +63,7 @@ void version()
* -s, --sensor : sensors
* -c, --clock : clocks
* -g, --gpio : gpios
+ * -p, --powerdomain : powerdomains
* -f, --findparents : clockname whose parents have to be found
* -t, --time : ticktime
* -d, --dump : dump
@@ -76,6 +78,7 @@ static struct option long_options[] = {
{ "sensor", 0, 0, 's' },
{ "clock", 0, 0, 'c' },
{ "gpio", 0, 0, 'g' },
+ { "powerdomain", 0, 0, 'p' },
{ "findparents", 1, 0, 'f' },
{ "time", 1, 0, 't' },
{ "dump", 0, 0, 'd' },
@@ -95,7 +98,7 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options)
while (1) {
int optindex = 0;
- c = getopt_long(argc, argv, "rscgf:t:dvVh",
+ c = getopt_long(argc, argv, "rscgpf:t:dvVh",
long_options, &optindex);
if (c == -1)
break;
@@ -113,6 +116,9 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options)
case 'g':
options->flags |= GPIO_OPTION;
break;
+ case 'p':
+ options->flags |= GENPD_OPTION;
+ break;
case 'd':
options->flags |= DUMP_OPTION;
break;
@@ -162,6 +168,9 @@ static int powerdebug_dump(struct powerdebug_options *options)
if (options->flags & GPIO_OPTION)
gpio_dump();
+ if (options->flags & GENPD_OPTION)
+ genpd_dump();
+
return 0;
}
@@ -240,6 +249,11 @@ int main(int argc, char **argv)
options->flags &= GPIO_OPTION;
}
+ if (genpd_init(options)) {
+ printf("failed to initialize genpd details\n");
+ options->flags &= GENPD_OPTION;
+ }
+
ret = options->flags & DUMP_OPTION ? powerdebug_dump(options) :
powerdebug_display(options);