summaryrefslogtreecommitdiff
path: root/common/switch.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-03-25 15:48:04 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-25 23:51:46 +0000
commit85e4baf0c1b69d3a849c807ad18717e29b440b0a (patch)
tree97e28b8d1828391656b61782062df06ffd06fdec /common/switch.c
parentfa15bbf2a57daeb7593700d7d7e0ed161fa884a4 (diff)
downloadchrome-ec-85e4baf0c1b69d3a849c807ad18717e29b440b0a.tar.gz
switch: cleanup lid_is_open logic
Cleanup an ifdef here for systems without a lid switch, so that "lid looks open" is just a consequence of !IS_ENABLED(CONFIG_LID_SWITCH). BUG=none BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1bbc145a0ffb49a127cb5a4e3986ed0955381353 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2787588 Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'common/switch.c')
-rw-r--r--common/switch.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/common/switch.c b/common/switch.c
index ea07efbca0..5dc0fc6a35 100644
--- a/common/switch.c
+++ b/common/switch.c
@@ -43,15 +43,10 @@ static void switch_update(void)
else
*memmap_switches &= ~EC_SWITCH_POWER_BUTTON_PRESSED;
-#ifdef CONFIG_LID_SWITCH
- if (lid_is_open())
+ if (!IS_ENABLED(CONFIG_LID_SWITCH) || lid_is_open())
*memmap_switches |= EC_SWITCH_LID_OPEN;
else
*memmap_switches &= ~EC_SWITCH_LID_OPEN;
-#else
- /* For lid-less systems, lid looks always open */
- *memmap_switches |= EC_SWITCH_LID_OPEN;
-#endif
if ((flash_get_protect() & EC_FLASH_PROTECT_GPIO_ASSERTED) == 0)
*memmap_switches |= EC_SWITCH_WRITE_PROTECT_DISABLED;