diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-29 16:15:45 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-29 17:50:27 -0700 |
commit | deb05123f8dce49ff610366f5b63cbadd741bc32 (patch) | |
tree | db199927928a8ddf34214e3d7feb6bcdf49e37ca /common | |
parent | d9bddaa0722d2b95c9b72c9c3a24c33053381311 (diff) | |
download | chrome-ec-deb05123f8dce49ff610366f5b63cbadd741bc32.tar.gz |
Don't enable charger interrupt if charger task is disabled
This fixes pmu_init() failing on pit, where the charger task isn't
enabled yet (and thus the charger interrupt is NULL - which can't be
enabled).
BUG=chrome-os-partner:18657
BRANCH=none
TEST=build all platforms; on pit, check that pmu_init() no longer fails
Change-Id: I191bbaeb4df10241e3508ccf7ef5ea83f42c5697
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49550
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/pmu_tps65090.c | 9 | ||||
-rw-r--r-- | common/pmu_tps65090_charger.c | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c index b1d0b2fbe0..c7a34426a0 100644 --- a/common/pmu_tps65090.c +++ b/common/pmu_tps65090.c @@ -600,15 +600,6 @@ void pmu_init(void) if (!failure) failure = pmu_clear_irq(); - /* Enable charger interrupt. */ - if (!failure) - failure = gpio_enable_interrupt(GPIO_CHARGER_INT); - -#ifdef CONFIG_AC_POWER_STATUS - if (!failure) - failure = gpio_set_flags(GPIO_AC_STATUS, GPIO_OUT_HIGH); -#endif - /* Exit the retry loop if there was no failure */ if (!failure) break; diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c index 1b2a9aa37a..0377e5fc9f 100644 --- a/common/pmu_tps65090_charger.c +++ b/common/pmu_tps65090_charger.c @@ -393,6 +393,14 @@ void charger_task(void) timestamp_t pre_chg_start = get_time(); pmu_init(); + + /* Enable charger interrupt */ + gpio_enable_interrupt(GPIO_CHARGER_INT); + +#ifdef CONFIG_AC_POWER_STATUS + gpio_set_flags(GPIO_AC_STATUS, GPIO_OUT_HIGH); +#endif + /* * EC STOP mode support * The charging loop can be stopped in idle state with AC unplugged. |