summaryrefslogtreecommitdiff
path: root/zephyr/shim
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-03-14 10:52:52 +0000
committerCommit Bot <commit-bot@chromium.org>2022-03-15 00:19:46 +0000
commita6583b9ed2b9fb4aa84fc4205a00b54948d54561 (patch)
tree39896ffc93bf988bcb48f82e2c115e16d658a6db /zephyr/shim
parentd9f152de5ef8a2af1f667493c5213160c8493630 (diff)
downloadchrome-ec-a6583b9ed2b9fb4aa84fc4205a00b54948d54561.tar.gz
zephyr: shim: drop empty pwm.dts overlays
Make the PWM shim compile with no named-pwms node defined and drop all empty pwm.dts files. This also drops the one adlrvp_npcx, that currently defines an fan PWM but no matching named-fan. BRANCH=none BUG=b:217741090 TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib2d4e3a12ed688ba38fb6bbba9afb11f9d900ee6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521941 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/shim')
-rw-r--r--zephyr/shim/src/pwm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zephyr/shim/src/pwm.c b/zephyr/shim/src/pwm.c
index 5cb4507851..5f76878b12 100644
--- a/zephyr/shim/src/pwm.c
+++ b/zephyr/shim/src/pwm.c
@@ -25,6 +25,11 @@ LOG_MODULE_REGISTER(pwm_shim, LOG_LEVEL_ERR);
DIV_ROUND_NEAREST((uint32_t)(v) * 100, UINT16_MAX)
#define PWM_PERCENT_TO_RAW(v) ((uint32_t)(v) * UINT16_MAX / 100)
+/* TODO(b/217741090): drop the PWM shim code once all callers have been
+ * converted.
+ */
+#if DT_HAS_COMPAT_STATUS_OKAY(named_pwms)
+
/*
* Initialize the device bindings in pwm_channels.
* This macro is called from within DT_FOREACH_CHILD
@@ -194,6 +199,7 @@ int pwm_get_duty(enum pwm_channel ch)
return DIV_ROUND_NEAREST(pwm->pulse_us * 100, pwm->period_us);
}
+#endif /* DT_HAS_COMPAT_STATUS_OKAY(named_pwm) */
#define HAS_PWM_GENERIC_CHANNEL(compat) \
DT_NODE_HAS_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(compat), \