diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-09-23 01:13:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-03 14:26:09 -0700 |
commit | 4f5f2dd1b7e6ec2dcd3a89229368df8bd5d31235 (patch) | |
tree | bb1b0f281b0c8a8637648eb30922848d82070dcc | |
parent | 53532a2e67fa301bea588a198d7afd8d55b4d4b2 (diff) | |
download | chrome-ec-4f5f2dd1b7e6ec2dcd3a89229368df8bd5d31235.tar.gz |
power: Add flag to disable power signal at boot
Add a new flag to allow boards to indicate if a power signal has to be
enabled/disabled at boot.
BUG=b:65421825
BRANCH=None
TEST=make -j buildall
Change-Id: Ibe7ab74e8191c58433087d8024b344d7e845f17e
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/679981
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r-- | include/power.h | 7 | ||||
-rw-r--r-- | power/common.c | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/power.h b/include/power.h index b5c2771d70..52316628fd 100644 --- a/include/power.h +++ b/include/power.h @@ -44,7 +44,9 @@ enum power_state { * +------------------------------------------------------+ * | 0 | Active level (low/high) | * +------------------------------------------------------+ - * | 1 : 32 | Reserved | + * | 1 | Signal interrupt state at boot | + * +------------------------------------------------------+ + * | 2 : 32 | Reserved | * +-----------------+------------------------------------+ */ @@ -52,6 +54,9 @@ enum power_state { #define POWER_SIGNAL_ACTIVE_LOW (0 << 0) #define POWER_SIGNAL_ACTIVE_HIGH (1 << 0) +#define POWER_SIGNAL_INTR_STATE (1 << 1) +#define POWER_SIGNAL_DISABLE_AT_BOOT (1 << 1) + /* Information on an power signal */ struct power_signal_info { enum gpio_signal gpio; /* GPIO for signal */ diff --git a/power/common.c b/power/common.c index 50a8096e0b..c489ab90cc 100644 --- a/power/common.c +++ b/power/common.c @@ -435,7 +435,10 @@ static void power_common_init(void) /* Enable interrupts for input signals */ for (i = 0; i < POWER_SIGNAL_COUNT; i++, s++) - power_signal_enable_interrupt(s->gpio); + if (s->flags & POWER_SIGNAL_DISABLE_AT_BOOT) + power_signal_disable_interrupt(s->gpio); + else + power_signal_enable_interrupt(s->gpio); /* * Update input state again since there is a small window |