diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-01 12:43:32 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-02 14:12:56 -0700 |
commit | 50c53c0d542d6fc3184db09a35196b4c702536c5 (patch) | |
tree | 920488af21630d4dbf78fef9dbeb13b8ceeb1bfb | |
parent | 5966f22a8a1928583943b57fc22e72f85d69d079 (diff) | |
download | chrome-ec-50c53c0d542d6fc3184db09a35196b4c702536c5.tar.gz |
Move enabling AC_PRESENT interrupt to extpower_gpio.c
The interrupt handler moved a while ago, but the code to enable the
interrupt at init-time didn't. Fix that.
BUG=chrome-os-partner:18256
BRANCH=none
TEST=boot system. unplug AC. replug AC. UI charging indicator should update.
Change-Id: Ie16aa7f6eb9e871a6e3e8ecf6733ecbdc883be0b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47041
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | chip/lm4/switch.c | 1 | ||||
-rw-r--r-- | common/extpower_gpio.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/chip/lm4/switch.c b/chip/lm4/switch.c index 0e5c1542af..135e722783 100644 --- a/chip/lm4/switch.c +++ b/chip/lm4/switch.c @@ -582,7 +582,6 @@ static void switch_init(void) *host_get_memmap(EC_MEMMAP_SWITCHES_VERSION) = 1; /* Enable interrupts, now that we've initialized */ - gpio_enable_interrupt(GPIO_AC_PRESENT); gpio_enable_interrupt(GPIO_LID_SWITCHn); gpio_enable_interrupt(GPIO_POWER_BUTTONn); gpio_enable_interrupt(GPIO_RECOVERYn); diff --git a/common/extpower_gpio.c b/common/extpower_gpio.c index 4643b245de..dccaed4958 100644 --- a/common/extpower_gpio.c +++ b/common/extpower_gpio.c @@ -36,3 +36,10 @@ void extpower_interrupt(enum gpio_signal signal) /* Trigger deferred notification of external power change */ hook_call_deferred(extpower_deferred, 0); } + +static void extpower_init(void) +{ + /* Enable interrupts, now that we've initialized */ + gpio_enable_interrupt(GPIO_AC_PRESENT); +} +DECLARE_HOOK(HOOK_INIT, extpower_init, HOOK_PRIO_DEFAULT); |