diff options
author | Todd Broch <tbroch@chromium.org> | 2014-10-17 19:25:14 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-21 22:44:36 +0000 |
commit | 3e2f1329abfa729fe6786ff64d9545e6ce94f042 (patch) | |
tree | 6ee022791771be4cbdddb49c058c4ca7acd3cc7b /board/dingdong | |
parent | 5d12e9b41058adda60f86a994c098046be6d86cf (diff) | |
download | chrome-ec-3e2f1329abfa729fe6786ff64d9545e6ce94f042.tar.gz |
pd: Correct use of console printing in USB PD policy files.
All non-interactive console prints should use their tasks channel
parameter to make it easy for developers to inhibit console output.
This CL corrects printf's in the various usb_pd_policy files that
belong to the USB PD task to use cprintf(CC_USBPD, ...) instead of the
macro reserved for interactive console commands ccprintf.
BRANCH=none
BUG=none
TEST=manual, set 'chan 1' and see none of the previous chatter
relating to USB PD. set 'chan 0x08000000' and see it return.
Output from DFP side for SVDM discovery now looks:
SVDM/4 [1] ff008041 340018d1 00000000 11000008
[1119.966911 DONE]
SVDM/2 [2] ff008042 ff010000
[1119.970135 DONE]
SVDM/2 [3] ff018043 00100081
[1119.973437 DONE]
SVDM/1 [4] ff018184
Change-Id: I47e5f4ec2d4a6a25f171177ead5ebc99409f80b6
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224191
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/dingdong')
-rw-r--r-- | board/dingdong/usb_pd_policy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/board/dingdong/usb_pd_policy.c b/board/dingdong/usb_pd_policy.c index 42b094fb1c..61a3bd8f33 100644 --- a/board/dingdong/usb_pd_policy.c +++ b/board/dingdong/usb_pd_policy.c @@ -16,6 +16,7 @@ #include "usb_pd.h" #include "version.h" +#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args) #define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args) /* Source PDOs */ @@ -54,7 +55,7 @@ int pd_choose_voltage(int cnt, uint32_t *src_caps, uint32_t *rdo) /* request all the power ... */ ma = 10 * (src_caps[i] & 0x3FF); *rdo = RDO_FIXED(i + 1, ma, ma, 0); - ccprintf("Request [%d] %dV %dmA\n", i, set_mv/1000, ma); + CPRINTF("Request [%d] %dV %dmA\n", i, set_mv/1000, ma); return ma; } @@ -179,7 +180,7 @@ static int pd_custom_vdm(int port, int cnt, uint32_t *payload, { int cmd = PD_VDO_CMD(payload[0]); int rsize = 1; - ccprintf("%T] VDM/%d [%d] %08x\n", cnt, cmd, payload[0]); + CPRINTF("VDM/%d [%d] %08x\n", cnt, cmd, payload[0]); *rpayload = payload; switch (cmd) { @@ -191,7 +192,7 @@ static int pd_custom_vdm(int port, int cnt, uint32_t *payload, rsize = 0; } - ccprintf("%T] DONE\n"); + CPRINTS("DONE"); /* respond (positively) to the request */ payload[0] |= VDO_SRC_RESPONDER; |