diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-06-14 09:35:34 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-17 03:21:12 +0000 |
commit | 470a9586fd8d897a847e52a65debc00001c1d565 (patch) | |
tree | baf15ed7dc48d0cb993b60946e5f758c00aa01e3 /chip/ish/ipc_heci.c | |
parent | 70e9e80590d05bad7dbd44fc4d2613633e7b98eb (diff) | |
download | chrome-ec-470a9586fd8d897a847e52a65debc00001c1d565.tar.gz |
ish: remove conditional compilation where possible
Removed many of the #if conditions and replaced them with IS_ENABLED
BUG=b:132178013
BRANCH=none
TEST=make buildall -j
TEST=verify basic ish ec functionality
Change-Id: I39c1d2dfdb39baa06e53746789d0b6a648275ed9
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660021
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip/ish/ipc_heci.c')
-rw-r--r-- | chip/ish/ipc_heci.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chip/ish/ipc_heci.c b/chip/ish/ipc_heci.c index 394c768e28..1eb3e7da4d 100644 --- a/chip/ish/ipc_heci.c +++ b/chip/ish/ipc_heci.c @@ -323,10 +323,11 @@ static int ipc_get_protocol_data(const struct ipc_if_ctx *ctx, CPRINTS("buffer is smaller than payload\n"); return -IPC_ERR_TOO_SMALL_BUFFER; } -#ifdef IPC_HECI_DEBUG - CPRINTF("ipc p=%d, db=0x%0x, payload_size=%d\n", protocol, drbl_val, - IPC_DB_MSG_LENGTH(drbl_val)); -#endif + + if (IS_ENABLED(IPC_HECI_DEBUG)) + CPRINTF("ipc p=%d, db=0x%0x, payload_size=%d\n", + protocol, drbl_val, + IPC_DB_MSG_LENGTH(drbl_val)); switch (protocol) { case IPC_PROTOCOL_HECI: @@ -446,7 +447,6 @@ static void ipc_host2ish_isr(void) uint32_t pisr = IPC_PISR; uint32_t pimr = IPC_PIMR; -#ifdef CHIP_FAMILY_ISH5 /* * TODO(b/122364080): Remove this code once proper power management is * in place for ISH. @@ -456,9 +456,8 @@ static void ipc_host2ish_isr(void) * host ipc communication). Resume is where we would like to restore all * power settings, but that is too late for this power request. */ - - PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; -#endif + if (IS_ENABLED(CHIP_FAMILY_ISH5)) + PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; if ((pisr & IPC_PISR_HOST2ISH_BIT) && (pimr & IPC_PIMR_HOST2ISH_BIT)) handle_msg_recv_interrupt(IPC_PEER_ID_HOST); @@ -687,17 +686,18 @@ void ipc_mng_task(void) struct ipc_msg msg; ipc_handle_t handle; -#ifdef CHIP_FAMILY_ISH5 /* * TODO(b/122364080): Remove this code once proper power management is * in place for ISH. * * Ensure that power for host IPCs is requested and ack'ed */ - PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; - while (!(PMU_VNN_REQ_ACK & PMU_VNN_REQ_ACK_STATUS)) - continue; -#endif + if (IS_ENABLED(CHIP_FAMILY_ISH5)) { + PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; + while (!(PMU_VNN_REQ_ACK & PMU_VNN_REQ_ACK_STATUS)) + continue; + } + handle = ipc_open(IPC_PEER_ID_HOST, IPC_PROTOCOL_MNG, EVENT_FLAG_BIT_MNG_MSG); |