summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-18 10:38:07 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-21 21:10:36 +0000
commitd9530449fd75650a53d2ee8d9cfdc8ef063781b5 (patch)
treee04f409f01e555c6a05b228a965726ab055c35a6
parent15e2fa02fdae240411df7a4e3298b988736a4499 (diff)
downloadchrome-ec-d9530449fd75650a53d2ee8d9cfdc8ef063781b5.tar.gz
cleanup: Consolidate power interrupts
Every chipset had its own header file just to declare a GPIO interrupt handler. Since this seems to be a common feature of the power interface, make a standard power_interrupt() API provided by chipset.h. This lets us get rid of 4 include files, and makes it easier to add more chipsets in the future. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I1fc5612d42625ea46e0a8e16a83085b66d476664 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/173745
-rw-r--r--board/bolt/board.c4
-rw-r--r--board/bolt/board.h2
-rw-r--r--board/bolt/power_sequence.c2
-rw-r--r--board/daisy/board.c10
-rw-r--r--board/falco/board.c1
-rw-r--r--board/kirby/board.c7
-rw-r--r--board/link/board.c4
-rw-r--r--board/nyan/board.c8
-rw-r--r--board/peppy/board.c4
-rw-r--r--board/pit/board.c10
-rw-r--r--board/puppy/board.c10
-rw-r--r--board/rambi/board.c1
-rw-r--r--board/samus/board.c1
-rw-r--r--board/slippy/board.c4
-rw-r--r--board/snow/board.c9
-rw-r--r--board/spring/board.c9
-rw-r--r--common/chipset_gaia.c17
-rw-r--r--common/chipset_haswell.c2
-rw-r--r--common/chipset_ivybridge.c2
-rw-r--r--common/chipset_tegra.c17
-rw-r--r--include/chipset.h7
-rw-r--r--include/chipset_haswell.h20
-rw-r--r--include/chipset_ivybridge.h20
-rw-r--r--include/gaia_power.h28
-rw-r--r--include/tegra_power.h28
25 files changed, 64 insertions, 163 deletions
diff --git a/board/bolt/board.c b/board/bolt/board.c
index 2b770e4db5..714918ebd0 100644
--- a/board/bolt/board.c
+++ b/board/bolt/board.c
@@ -8,7 +8,7 @@
#include "board.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
+#include "chipset.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
@@ -61,7 +61,7 @@ const struct gpio_info gpio_list[] = {
{"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH,
x86_interrupt},
{"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH,
- bolt_interrupt},
+ power_interrupt},
{"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH,
switch_interrupt},
{"WP", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH,
diff --git a/board/bolt/board.h b/board/bolt/board.h
index a1e4fe661a..ca4862f912 100644
--- a/board/bolt/board.h
+++ b/board/bolt/board.h
@@ -216,8 +216,6 @@ enum board_version {
#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
-void bolt_interrupt(enum gpio_signal signal);
-
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/board/bolt/power_sequence.c b/board/bolt/power_sequence.c
index a778f26700..78468211df 100644
--- a/board/bolt/power_sequence.c
+++ b/board/bolt/power_sequence.c
@@ -383,7 +383,7 @@ enum x86_state x86_handle_state(enum x86_state state)
return state;
}
-void bolt_interrupt(enum gpio_signal signal)
+void power_interrupt(enum gpio_signal signal)
{
/* Pass through eDP VDD enable from PCH */
gpio_set_level(GPIO_EC_EDP_VDD_EN, gpio_get_level(GPIO_PCH_EDP_VDD_EN));
diff --git a/board/daisy/board.c b/board/daisy/board.c
index be42ffcbd8..f6803950df 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -5,8 +5,8 @@
/* Daisy board-specific configuration */
#include "battery.h"
+#include "chipset.h"
#include "common.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "i2c.h"
#include "keyboard_raw.h"
@@ -37,12 +37,12 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, gaia_power_event},
- {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_RISING, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_RISING, power_interrupt},
{"CHARGER_INT_L", GPIO_C, (1<<4), GPIO_INT_FALLING, NULL},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_A, (1<<7), GPIO_INT_BOTH, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_A, (1<<7), GPIO_INT_BOTH, power_interrupt},
{"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT,
keyboard_raw_gpio_interrupt},
{"KB_IN01", GPIO_C, (1<<9), GPIO_KB_INPUT,
diff --git a/board/falco/board.c b/board/falco/board.c
index 1200060db0..41de41d920 100644
--- a/board/falco/board.c
+++ b/board/falco/board.c
@@ -9,7 +9,6 @@
#include "board.h"
#include "charger_bq24738.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
diff --git a/board/kirby/board.c b/board/kirby/board.c
index ca88e1416f..3b3464e3f8 100644
--- a/board/kirby/board.c
+++ b/board/kirby/board.c
@@ -8,7 +8,6 @@
#include "common.h"
#include "chipset.h"
#include "extpower.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
@@ -28,8 +27,8 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_A, (1<<0), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_E, (1<<5), GPIO_INT_RISING, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_A, (1<<0), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_E, (1<<5), GPIO_INT_RISING, power_interrupt},
{"CHARGER_INT_L", GPIO_E, (1<<2), GPIO_INT_FALLING,
NULL /*pmu_irq_handler*/},
{"USB_CHG_INT", GPIO_E, (1<<15), GPIO_INT_FALLING,
@@ -37,7 +36,7 @@ const struct gpio_info gpio_list[] = {
{"USBPD_INT_L", GPIO_E, (1<<1), GPIO_INT_FALLING,
NULL /*extpower_interrupt*/},
{"LID_OPEN", GPIO_E, (1<<6), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_E, (1<<3), GPIO_INT_BOTH, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_E, (1<<3), GPIO_INT_BOTH, power_interrupt},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP,
spi_event},
{"AC_PRESENT_L", GPIO_A, (1<<1), GPIO_INT_BOTH, extpower_interrupt},
diff --git a/board/link/board.c b/board/link/board.c
index 4d6edbb2ed..5d05392c5f 100644
--- a/board/link/board.c
+++ b/board/link/board.c
@@ -7,7 +7,7 @@
#include "adc.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_ivybridge.h"
+#include "chipset.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
@@ -59,7 +59,7 @@ const struct gpio_info gpio_list[] = {
{"PCH_SLP_SUS_L", LM4_GPIO_G, (1<<3), GPIO_INT_BOTH,
x86_interrupt},
{"PCH_SUSWARN_L", LM4_GPIO_G, (1<<2), GPIO_INT_BOTH,
- ivybridge_interrupt},
+ power_interrupt},
{"PGOOD_1_5V_DDR", LM4_GPIO_K, (1<<0), GPIO_INT_BOTH,
x86_interrupt},
{"PGOOD_1_5V_PCH", LM4_GPIO_K, (1<<1), GPIO_INT_BOTH,
diff --git a/board/nyan/board.c b/board/nyan/board.c
index ff052d5644..caa8ca188b 100644
--- a/board/nyan/board.c
+++ b/board/nyan/board.c
@@ -5,9 +5,9 @@
/* Nyan board-specific configuration */
#include "battery.h"
+#include "chipset.h"
#include "common.h"
#include "extpower.h"
-#include "tegra_power.h"
#include "gpio.h"
#include "i2c.h"
#include "keyboard_raw.h"
@@ -27,11 +27,11 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, tegra_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, tegra_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, power_interrupt},
{"CHARGER_INT", GPIO_C, (1<<6), GPIO_INT_RISING, NULL},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_C, (1<<7), GPIO_KB_INPUT, tegra_suspend_event},
+ {"SUSPEND_L", GPIO_C, (1<<7), GPIO_KB_INPUT, power_interrupt},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP,
spi_event},
{"AC_PRESENT", GPIO_A, (1<<0), GPIO_INT_BOTH, extpower_interrupt},
diff --git a/board/peppy/board.c b/board/peppy/board.c
index a60316552b..0c53cb74e4 100644
--- a/board/peppy/board.c
+++ b/board/peppy/board.c
@@ -7,7 +7,7 @@
#include "adc.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
+#include "chipset.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
@@ -58,7 +58,7 @@ const struct gpio_info gpio_list[] = {
{"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH,
x86_interrupt},
{"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH,
- haswell_interrupt},
+ power_interrupt},
{"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH,
switch_interrupt},
{"WP_L", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH,
diff --git a/board/pit/board.c b/board/pit/board.c
index ba9fb7252d..b4c5cc0d6e 100644
--- a/board/pit/board.c
+++ b/board/pit/board.c
@@ -5,9 +5,9 @@
/* Pit board-specific configuration */
#include "battery.h"
+#include "chipset.h"
#include "common.h"
#include "extpower.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "i2c.h"
#include "keyboard_scan.h"
@@ -28,12 +28,12 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, gaia_power_event},
- {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_RISING, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_RISING, power_interrupt},
{"CHARGER_INT_L", GPIO_C, (1<<6), GPIO_INT_FALLING, pmu_irq_handler},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_C, (1<<7), GPIO_INT_BOTH, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_C, (1<<7), GPIO_INT_BOTH, power_interrupt},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP,
spi_event},
{"AC_PRESENT", GPIO_A, (1<<0), GPIO_INT_BOTH, extpower_interrupt},
diff --git a/board/puppy/board.c b/board/puppy/board.c
index db275818ab..970ecc6b8a 100644
--- a/board/puppy/board.c
+++ b/board/puppy/board.c
@@ -5,9 +5,9 @@
/* Puppy board-specific configuration */
#include "battery.h"
+#include "chipset.h"
#include "common.h"
#include "extpower.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "i2c.h"
#include "keyboard_raw.h"
@@ -26,12 +26,12 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, gaia_power_event},
- {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, power_interrupt},
{"CHARGER_INT_L", GPIO_C, (1<<6), GPIO_INT_FALLING, pmu_irq_handler},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_C, (1<<7), GPIO_KB_INPUT, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_C, (1<<7), GPIO_KB_INPUT, power_interrupt},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP,
spi_event},
{"AC_PRESENT", GPIO_A, (1<<0), GPIO_INT_BOTH, extpower_interrupt},
diff --git a/board/rambi/board.c b/board/rambi/board.c
index f99f4874c1..fbe32dd924 100644
--- a/board/rambi/board.c
+++ b/board/rambi/board.c
@@ -7,7 +7,6 @@
#include "adc.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
diff --git a/board/samus/board.c b/board/samus/board.c
index 183e7bbe62..5961a937c9 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -8,7 +8,6 @@
#include "board.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
diff --git a/board/slippy/board.c b/board/slippy/board.c
index 680b021a84..ff1a71e06f 100644
--- a/board/slippy/board.c
+++ b/board/slippy/board.c
@@ -7,7 +7,7 @@
#include "adc.h"
#include "backlight.h"
#include "chip_temp_sensor.h"
-#include "chipset_haswell.h"
+#include "chipset.h"
#include "chipset_x86_common.h"
#include "common.h"
#include "ec_commands.h"
@@ -58,7 +58,7 @@ const struct gpio_info gpio_list[] = {
{"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH,
x86_interrupt},
{"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH,
- haswell_interrupt},
+ power_interrupt},
{"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH,
switch_interrupt},
{"WP_L", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH,
diff --git a/board/snow/board.c b/board/snow/board.c
index cf09e189e9..8db32d31c1 100644
--- a/board/snow/board.c
+++ b/board/snow/board.c
@@ -9,7 +9,6 @@
#include "chipset.h"
#include "common.h"
#include "console.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
@@ -34,12 +33,12 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, gaia_power_event},
- {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, power_interrupt},
{"CHARGER_INT_L", GPIO_C, (1<<4), GPIO_INT_FALLING, pmu_irq_handler},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_A, (1<<7), INT_BOTH_FLOATING, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_A, (1<<7), INT_BOTH_FLOATING, power_interrupt},
{"WP_L", GPIO_B, (1<<4), GPIO_INPUT, NULL},
{"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT,
keyboard_raw_gpio_interrupt},
diff --git a/board/spring/board.c b/board/spring/board.c
index 09e943d8f7..30269b27d8 100644
--- a/board/spring/board.c
+++ b/board/spring/board.c
@@ -10,7 +10,6 @@
#include "common.h"
#include "console.h"
#include "extpower.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
@@ -34,12 +33,12 @@
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, gaia_power_event},
- {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event},
- {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, gaia_power_event},
+ {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt},
+ {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt},
+ {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, power_interrupt},
{"CHARGER_INT_L", GPIO_C, (1<<4), GPIO_INT_FALLING, pmu_irq_handler},
{"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt},
- {"SUSPEND_L", GPIO_A, (1<<7), INT_BOTH_FLOATING, gaia_suspend_event},
+ {"SUSPEND_L", GPIO_A, (1<<7), INT_BOTH_FLOATING, power_interrupt},
{"WP_L", GPIO_A, (1<<13), GPIO_INPUT, NULL},
{"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT,
keyboard_raw_gpio_interrupt},
diff --git a/common/chipset_gaia.c b/common/chipset_gaia.c
index 19619d601b..fd5d5fb7a6 100644
--- a/common/chipset_gaia.c
+++ b/common/chipset_gaia.c
@@ -27,7 +27,6 @@
#include "chipset.h" /* This module implements chipset functions too */
#include "common.h"
#include "console.h"
-#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "lid_switch.h"
@@ -289,15 +288,15 @@ static void gaia_suspend_deferred(void)
}
DECLARE_DEFERRED(gaia_suspend_deferred);
-void gaia_suspend_event(enum gpio_signal signal)
+void power_interrupt(enum gpio_signal signal)
{
- hook_call_deferred(gaia_suspend_deferred, 0);
-}
-
-void gaia_power_event(enum gpio_signal signal)
-{
- /* Wake up the task */
- task_wake(TASK_ID_CHIPSET);
+ if (signal == GPIO_SUSPEND_L) {
+ /* Handle suspend events in the hook task */
+ hook_call_deferred(gaia_suspend_deferred, 0);
+ } else {
+ /* All other events are handled in the chipset task */
+ task_wake(TASK_ID_CHIPSET);
+ }
}
static void gaia_lid_event(void)
diff --git a/common/chipset_haswell.c b/common/chipset_haswell.c
index b656cb8797..95823ae418 100644
--- a/common/chipset_haswell.c
+++ b/common/chipset_haswell.c
@@ -367,7 +367,7 @@ enum x86_state x86_handle_state(enum x86_state state)
return state;
}
-void haswell_interrupt(enum gpio_signal signal)
+void power_interrupt(enum gpio_signal signal)
{
/* Pass through eDP VDD enable from PCH */
gpio_set_level(GPIO_EC_EDP_VDD_EN, gpio_get_level(GPIO_PCH_EDP_VDD_EN));
diff --git a/common/chipset_ivybridge.c b/common/chipset_ivybridge.c
index 048d6a5d5b..7a8dfd12aa 100644
--- a/common/chipset_ivybridge.c
+++ b/common/chipset_ivybridge.c
@@ -337,7 +337,7 @@ enum x86_state x86_handle_state(enum x86_state state)
return state;
}
-void ivybridge_interrupt(enum gpio_signal signal)
+void power_interrupt(enum gpio_signal signal)
{
/* Route SUSWARN# back to SUSACK# */
gpio_set_level(GPIO_PCH_SUSACK_L, gpio_get_level(GPIO_PCH_SUSWARN_L));
diff --git a/common/chipset_tegra.c b/common/chipset_tegra.c
index 7032f969cb..3484a266ae 100644
--- a/common/chipset_tegra.c
+++ b/common/chipset_tegra.c
@@ -27,7 +27,6 @@
#include "chipset.h" /* This module implements chipset functions too */
#include "common.h"
#include "console.h"
-#include "tegra_power.h"
#include "gpio.h"
#include "hooks.h"
#include "lid_switch.h"
@@ -248,15 +247,15 @@ static void tegra_suspend_deferred(void)
}
DECLARE_DEFERRED(tegra_suspend_deferred);
-void tegra_suspend_event(enum gpio_signal signal)
+void power_interrupt(enum gpio_signal signal)
{
- hook_call_deferred(tegra_suspend_deferred, 0);
-}
-
-void tegra_power_event(enum gpio_signal signal)
-{
- /* Wake up the task */
- task_wake(TASK_ID_CHIPSET);
+ if (signal == GPIO_SUSPEND_L) {
+ /* Handle suspend events in the hook task */
+ hook_call_deferred(tegra_suspend_deferred, 0);
+ } else {
+ /* All other events are handled in the chipset task */
+ task_wake(TASK_ID_CHIPSET);
+ }
}
static void tegra_lid_event(void)
diff --git a/include/chipset.h b/include/chipset.h
index ddf4eb3db0..728a6be4a4 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -75,6 +75,11 @@ void chipset_force_shutdown(void);
*/
void chipset_reset(int cold_reset);
+/**
+ * Interrupt handler for power GPIO inputs.
+ */
+void power_interrupt(enum gpio_signal signal);
+
#else /* !HAS_TASK_CHIPSET */
/*
* Allow other modules to compile if the chipset module is disabled. This is
@@ -91,6 +96,8 @@ static inline void chipset_throttle_cpu(int throttle) { }
static inline void chipset_force_shutdown(void) { }
static inline void chipset_reset(int cold_reset) { }
+#define power_interrupt NULL
+
#endif /* !HAS_TASK_CHIPSET */
#endif /* __CROS_EC_CHIPSET_H */
diff --git a/include/chipset_haswell.h b/include/chipset_haswell.h
deleted file mode 100644
index 5a4eaf9dc6..0000000000
--- a/include/chipset_haswell.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Haswell chipset interface */
-
-#ifndef __CROS_EC_CHIPSET_HASWELL_H
-#define __CROS_EC_CHIPSET_HASWELL_H
-
-/**
- * Interrupt handler for Haswell-specific GPIOs.
- */
-#ifdef CONFIG_CHIPSET_HASWELL
-void haswell_interrupt(enum gpio_signal signal);
-#else
-#define haswell_interrupt NULL
-#endif
-
-#endif
diff --git a/include/chipset_ivybridge.h b/include/chipset_ivybridge.h
deleted file mode 100644
index af752a9f97..0000000000
--- a/include/chipset_ivybridge.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Ivy bridge chipset interface */
-
-#ifndef __CROS_EC_CHIPSET_IVYBRIDGE_H
-#define __CROS_EC_CHIPSET_IVYBRIDGE_H
-
-/**
- * Interrupt handler for Ivy Bridge-specific GPIOs.
- */
-#ifdef CONFIG_CHIPSET_IVYBRIDGE
-void ivybridge_interrupt(enum gpio_signal signal);
-#else
-#define ivybridge_interrupt NULL
-#endif
-
-#endif
diff --git a/include/gaia_power.h b/include/gaia_power.h
deleted file mode 100644
index 4e44e66f2f..0000000000
--- a/include/gaia_power.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Gaia power module for Chrome EC */
-
-#ifndef __CROS_EC_GAIA_POWER_H
-#define __CROS_EC_GAIA_POWER_H
-
-#include "gpio.h"
-
-#ifdef CONFIG_CHIPSET_GAIA
-
-/**
- * Interrupt handlers for Gaia chipset GPIOs.
- */
-void gaia_power_event(enum gpio_signal signal);
-void gaia_suspend_event(enum gpio_signal signal);
-
-#else
-
-#define gaia_power_event NULL
-#define gaia_suspend_event NULL
-
-#endif
-
-#endif /* __CROS_EC_GAIA_POWER_H */
diff --git a/include/tegra_power.h b/include/tegra_power.h
deleted file mode 100644
index 9b02a9feaf..0000000000
--- a/include/tegra_power.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Tegra power module for Chrome EC */
-
-#ifndef __CROS_EC_TEGRA_POWER_H
-#define __CROS_EC_TEGRA_POWER_H
-
-#include "gpio.h"
-
-#ifdef CONFIG_CHIPSET_TEGRA
-
-/**
- * Interrupt handlers for Tegra chipset GPIOs.
- */
-void tegra_power_event(enum gpio_signal signal);
-void tegra_suspend_event(enum gpio_signal signal);
-
-#else
-
-#define tegra_power_event NULL
-#define tegra_suspend_event NULL
-
-#endif
-
-#endif /* __CROS_EC_TEGRA_POWER_H */