diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-26 11:14:55 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-26 13:46:47 -0700 |
commit | fd38ba353cf473c2b833d6812c07f087927bb56b (patch) | |
tree | 15191be62d92fe0d6af086e26e3d85ef2d4f4141 | |
parent | 088cd2c277c3828919cb86b05fd5ac3aad9c911a (diff) | |
download | chrome-ec-fd38ba353cf473c2b833d6812c07f087927bb56b.tar.gz |
Move PMU charger irq handler to charger module
No code changes; this is just moving the irq to the module which
actually handles it. This makes it simpler to disable the charger
task separately from the PMU module.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build pit, spring
Change-Id: Ife44a17f69bf21aa000d162318a459cea6fdf661
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49334
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/pmu_tps65090.c | 9 | ||||
-rw-r--r-- | common/pmu_tps65090_charger.c | 10 | ||||
-rw-r--r-- | include/pmu_tpschrome.h | 6 |
3 files changed, 15 insertions, 10 deletions
diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c index eb8c5ed3a5..b1d0b2fbe0 100644 --- a/common/pmu_tps65090.c +++ b/common/pmu_tps65090.c @@ -475,15 +475,6 @@ int pmu_adc_read(int adc_idx, int flags) return (val2 << 8) | val1; } -void pmu_irq_handler(enum gpio_signal signal) -{ -#ifdef CONFIG_AC_POWER_STATUS - gpio_set_level(GPIO_AC_STATUS, extpower_is_present()); -#endif - pmu_task_throttled_wake(); - CPRINTF("Charger IRQ received.\n"); -} - /** * Attempt shutdown. */ diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c index 15bcbbd760..0d73fcc619 100644 --- a/common/pmu_tps65090_charger.c +++ b/common/pmu_tps65090_charger.c @@ -535,3 +535,13 @@ DECLARE_HOOK(HOOK_CHIPSET_STARTUP, pmu_chipset_events, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, pmu_chipset_events, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, pmu_chipset_events, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_RESUME, pmu_chipset_events, HOOK_PRIO_DEFAULT); + +void pmu_irq_handler(enum gpio_signal signal) +{ +#ifdef CONFIG_AC_POWER_STATUS + gpio_set_level(GPIO_AC_STATUS, extpower_is_present()); +#endif + pmu_task_throttled_wake(); + CPRINTF("Charger IRQ received.\n"); +} + diff --git a/include/pmu_tpschrome.h b/include/pmu_tpschrome.h index bc348c7042..deb23f79c2 100644 --- a/include/pmu_tpschrome.h +++ b/include/pmu_tpschrome.h @@ -197,12 +197,16 @@ int pmu_low_current_charging(int enable); */ int pmu_adc_read(int adc_idx, int flags); +#ifdef HAS_TASK_CHARGER /** - * Handles interrupts from tpschrome + * Handles charger interrupts from tpschrome * * @param signal Indicates signal type. */ void pmu_irq_handler(enum gpio_signal signal); +#else +#define pmu_irq_handler NULL +#endif /** * Set temperature threshold |