summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/util.c
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-03-12 09:54:28 -0700
committerCommit Bot <commit-bot@chromium.org>2021-03-12 19:36:48 +0000
commita1258ba9944c16dd60080fa69a94bf1b28f8db61 (patch)
tree210d5b9117187238361d8b39f2e38795c0b04164 /zephyr/shim/src/util.c
parentd3494eb152ae9992de6067e8b00a3f2595302b68 (diff)
downloadchrome-ec-a1258ba9944c16dd60080fa69a94bf1b28f8db61.tar.gz
zephyr: add DPTF support
Add a Kconfig option to enable DPTF support. Adds support for the following ACPI entries: EC_ACPI_MEM_FAN_DUTY (0x04) EC_ACPI_MEM_TEMP_ID (0x05) EC_ACPI_MEM_TEMP_THRESHOLD (0x06) EC_ACPI_MEM_TEMP_COMMIT (0x07) BUG=b:179886912 BRANCH=none TEST=zmake testall TEST=Boot zephyr-ec on Volteer, observe that ACPI warnings for ignored read/writes for DPTF commands are fixed. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I40cbe79e57c3d4687d828ec46fe0d51034e96bfc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757028 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/shim/src/util.c')
-rw-r--r--zephyr/shim/src/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/shim/src/util.c b/zephyr/shim/src/util.c
index 38a254bf47..ca45025cd7 100644
--- a/zephyr/shim/src/util.c
+++ b/zephyr/shim/src/util.c
@@ -234,6 +234,14 @@ enum cond_internal_bits {
COND_FALL_MASK = BIT(2), /* set if 1->0 */
};
+void cond_init(cond_t *c, int val)
+{
+ if (val)
+ *c = COND_CURR_MASK;
+ else
+ *c = 0;
+}
+
void cond_set(cond_t *c, int val)
{
if (val && cond_is(c, 0))