summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2023-02-15 12:26:24 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-15 20:33:26 +0000
commit0f0f0b289bc9f47c7a19db9693a77e754080af14 (patch)
treec217b95c3d77c14071d06dbc4d6e8b0cd3e2b620
parenta5ee4e01225eed03fc0141b1a7b9ca015b8a5b3c (diff)
downloadchrome-ec-0f0f0b289bc9f47c7a19db9693a77e754080af14.tar.gz
zephyr/ps8xxx: fix build with TCPC_INTERRUPT disabled
The irq_gpio field only exists if CONFIG_PLATFORM_EC_TCPC_INTERRUPT is enabled, otherwise the equivalent is alert_signal. BUG=b:269212593,b:254148652 TEST=zmake build yaviks with CONFIG_PLATFORM_EC_TCPC_INTERRUPT=n BRANCH=nissa Change-Id: Ib2219e39eb81dcdb9f780b46a263b85adfbb6b15 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252925 Reviewed-by: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/shim/include/usbc/tcpc_ps8xxx.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/zephyr/shim/include/usbc/tcpc_ps8xxx.h b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
index eb086931a8..621d4ab016 100644
--- a/zephyr/shim/include/usbc/tcpc_ps8xxx.h
+++ b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
@@ -19,7 +19,13 @@
}, \
.drv = &ps8xxx_tcpm_drv, \
.flags = DT_PROP(id, tcpc_flags), \
- .irq_gpio = GPIO_DT_SPEC_GET_OR(id, irq_gpios, {}), \
+ COND_CODE_1(CONFIG_PLATFORM_EC_TCPC_INTERRUPT, \
+ (.irq_gpio = GPIO_DT_SPEC_GET_OR(id, irq_gpios, {})), \
+ (.alert_signal = COND_CODE_1( \
+ DT_NODE_HAS_PROP(id, int_pin), \
+ (GPIO_SIGNAL(DT_PHANDLE(id, int_pin))), \
+ (GPIO_LIMIT))) \
+ ), \
},
DT_FOREACH_STATUS_OKAY(PS8XXX_COMPAT, TCPC_VERIFY_NO_FLAGS_ACTIVE_ALERT_HIGH)