summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Worley <scott.worley@microchip.corp-partner.google.com>2017-12-20 15:03:39 -0500
committerchrome-bot <chrome-bot@chromium.org>2017-12-28 14:50:29 -0800
commit304bb8b09c60a75ac8eae72ab017a5996b76afeb (patch)
treeb0b85a518305b921cabf983ceb28a2e102ba0df3
parent5b6ec95320d231fb15a9ec69e2eefeb5eed1fd25 (diff)
downloadchrome-ec-304bb8b09c60a75ac8eae72ab017a5996b76afeb.tar.gz
ec_als: ALS now uses CPRINT macros
Modify ALS module to use CPRINT macros with channel support. BRANCH=none BUG= TEST=Build board(s) with ALS support such glados. Test ALS CPRINT messages go out over EC UART and can be masked off by channel mask UART command. Change-Id: I65ffc889d63a778f3fb8995f508773842ba875ef Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
-rw-r--r--common/als.c7
-rw-r--r--include/console_channel.inc3
2 files changed, 9 insertions, 1 deletions
diff --git a/common/als.c b/common/als.c
index c671aacf12..fee478c280 100644
--- a/common/als.c
+++ b/common/als.c
@@ -18,6 +18,11 @@
#include "timer.h"
#include "util.h"
+#define CPUTS(outstr) cputs(CC_ALS, outstr)
+#define CPRINTS(format, args...) cprints(CC_ALS, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_ALS, format, ## args)
+
+
#define ALS_POLL_PERIOD SECOND
static int task_timeout = -1;
@@ -58,7 +63,7 @@ static void als_task_enable(void)
err = als[i].init();
if (err) {
fail_count++;
- ccprintf("%s ALS sensor failed to initialize, err=%d\n",
+ CPRINTF("%s ALS sensor failed to initialize, err=%d\n",
als[i].name, err);
}
}
diff --git a/include/console_channel.inc b/include/console_channel.inc
index a5dc6d80ec..0d3f7a07f9 100644
--- a/include/console_channel.inc
+++ b/include/console_channel.inc
@@ -78,6 +78,9 @@ CONSOLE_CHANNEL(CC_TOUCHPAD, "touchpad")
#ifdef CONFIG_DPTF
CONSOLE_CHANNEL(CC_DPTF, "dptf")
#endif
+#ifdef CONFIG_ALS
+CONSOLE_CHANNEL(CC_ALS, "als")
+#endif
CONSOLE_CHANNEL(CC_THERMAL, "thermal")
CONSOLE_CHANNEL(CC_TPM, "tpm")
CONSOLE_CHANNEL(CC_USB, "usb")