summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-26 09:51:09 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-26 09:51:09 +0100
commit412665b46134f93464c09405e02f08ac9c62526d (patch)
tree7d45bfd311e81d2d750c0c67edef17ceba17df3f /common
parentb6379e15a70cc2e22486e5962927d9de374d877b (diff)
parentce0c1bc13556fbf1bdfa2a4a27ca6744e7beb32a (diff)
downloadu-boot-imx-412665b46134f93464c09405e02f08ac9c62526d.zip
u-boot-imx-412665b46134f93464c09405e02f08ac9c62526d.tar.gz
u-boot-imx-412665b46134f93464c09405e02f08ac9c62526d.tar.bz2
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
Diffstat (limited to 'common')
-rw-r--r--common/cmd_dtt.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
index cd94423..edbd4a8 100644
--- a/common/cmd_dtt.c
+++ b/common/cmd_dtt.c
@@ -27,7 +27,9 @@
#include <dtt.h>
#include <i2c.h>
+#include <tmu.h>
+#if defined CONFIG_DTT_SENSORS
static unsigned long sensor_initialized;
static void _initialize_dtt(void)
@@ -59,9 +61,11 @@ void dtt_init(void)
/* switch back to original I2C bus */
I2C_SET_BUS(old_bus);
}
+#endif
-int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int dtt_i2c(void)
{
+#if defined CONFIG_DTT_SENSORS
int i;
unsigned char sensors[] = CONFIG_DTT_SENSORS;
int old_bus;
@@ -83,8 +87,34 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
/* switch back to original I2C bus */
I2C_SET_BUS(old_bus);
+#endif
return 0;
+}
+
+int dtt_tmu(void)
+{
+#if defined CONFIG_TMU_CMD_DTT
+ int cur_temp;
+
+ /* Sense and return latest thermal info */
+ if (tmu_monitor(&cur_temp) == TMU_STATUS_INIT) {
+ puts("TMU is in unknown state, temperature is invalid\n");
+ return -1;
+ }
+ printf("Current temperature: %u degrees Celsius\n", cur_temp);
+#endif
+ return 0;
+}
+
+int do_dtt(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+ int err = 0;
+
+ err |= dtt_i2c();
+ err |= dtt_tmu();
+
+ return err;
} /* do_dtt() */
/***************************************************/