aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Singh Rawat <sanjay.rawat@linaro.com>2013-02-22 17:57:18 +0530
committerSanjay Singh Rawat <sanjay.rawat@linaro.com>2013-02-25 17:49:24 +0530
commit9fe0c0521fd74387c4ca00b9c1b768762273502f (patch)
tree98095a7dc9c4947f5b039c45226176409a485a34
parent228a759e803b8cf9a85c9a0687a58d3e8aed6351 (diff)
Version 0.6.2
- include gpio debug module for android - fix compliation issue and set env variables needed for android Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.com>
-rw-r--r--Android.mk2
-rw-r--r--powerdebug.c10
-rw-r--r--regulator.c8
3 files changed, 17 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index e062c1c..36c73cd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -29,6 +29,6 @@ LOCAL_C_INCLUDES += external/stlport/stlport/ \
LOCAL_SRC_FILES += \
powerdebug.c sensor.c clocks.c regulator.c \
- display.c tree.c utils.c mainloop.c
+ display.c tree.c utils.c mainloop.c gpio.c
include $(BUILD_EXECUTABLE)
diff --git a/powerdebug.c b/powerdebug.c
index cc9e871..073fd42 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -216,6 +216,16 @@ int main(int argc, char **argv)
struct powerdebug_options *options;
int ret;
+#ifdef __ANDROID__
+ if (setenv("TERM", "xterm", 1) < 0) {
+ fprintf(stderr, "setenv failure");
+ return 1;
+ }
+ if (setenv("TERMINFO", "/system/etc/terminfo", 1) < 0) {
+ fprintf(stderr, "setenv failure");
+ return 1;
+ }
+#endif
options = powerdebug_init();
if (!options) {
fprintf(stderr, "not enough memory to allocate options\n");
diff --git a/regulator.c b/regulator.c
index 55bd3e9..0da924a 100644
--- a/regulator.c
+++ b/regulator.c
@@ -90,13 +90,17 @@ static int regulator_dump_cb(struct tree *tree, void *data)
printf("\n%s:\n", tree->name);
for (i = 0; i < nregdata; i++) {
+ int val;
if (file_read_value(tree->path, regdata[i].name,
regdata[i].ifmt, buffer))
continue;
- printf(regdata[i].ofmt, regdata[i].derefme ?
- *((int *)buffer) : buffer);
+ if (regdata[i].derefme) {
+ val = atoi(buffer);
+ printf(regdata[i].ofmt, val);
+ } else
+ printf(regdata[i].ofmt, buffer);
}
return 0;