From deb05123f8dce49ff610366f5b63cbadd741bc32 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 29 Apr 2013 16:15:45 -0700 Subject: [PATCH] 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 Reviewed-on: https://gerrit.chromium.org/gerrit/49550 Reviewed-by: Simon Glass --- common/pmu_tps65090.c | 9 --------- 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.