From fd38ba353cf473c2b833d6812c07f087927bb56b Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 26 Apr 2013 11:14:55 -0700 Subject: 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 Reviewed-on: https://gerrit.chromium.org/gerrit/49334 Reviewed-by: Bill Richardson Reviewed-by: Simon Glass --- common/pmu_tps65090.c | 9 --------- common/pmu_tps65090_charger.c | 10 ++++++++++ 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 -- cgit v1.2.1