summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-19 15:11:21 -0700
committerChromeBot <chrome-bot@google.com>2013-03-20 17:42:03 -0700
commitf8393fab2c63e4c85646a56bfcd44d42db89e13c (patch)
tree1994f81af93d0063d0cf831d4ca22c2dc5e974a4
parent78b0e9863d7d05e9ee50e75d6cd845f1b54a5915 (diff)
downloadchrome-ec-f8393fab2c63e4c85646a56bfcd44d42db89e13c.tar.gz
Move gaia event handler declarations to gaia_power.h
This removes duplicated code in 3 different board.c files. No functional changes, just moving declarations. BUG=chrome-os-partner:18343 BRANCH=none TEST=build daisy,spring,snow Change-Id: Ie6266dca7d7d160e154fce1a09452e5cc9a1095c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45898
-rw-r--r--board/daisy/board.c12
-rw-r--r--board/snow/board.c12
-rw-r--r--board/spring/board.c12
-rw-r--r--common/gaia_power.c1
-rw-r--r--include/gaia_power.h30
5 files changed, 34 insertions, 33 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c
index 5bf79de277..89652bfb58 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -7,6 +7,7 @@
#include "common.h"
#include "dma.h"
#include "extpower.h"
+#include "gaia_power.h"
#include "gpio.h"
#include "i2c.h"
#include "keyboard_scan.h"
@@ -33,17 +34,6 @@
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH)
#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
-/* GPIO interrupt handlers prototypes */
-#ifdef CONFIG_CHIPSET_GAIA
-void gaia_power_event(enum gpio_signal signal);
-void gaia_suspend_event(enum gpio_signal signal);
-void gaia_lid_event(enum gpio_signal signal);
-#else
-#define gaia_power_event NULL
-#define gaia_suspend_event NULL
-#define gaia_lid_event NULL
-#endif
-
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
/* Inputs with interrupt handlers are first for efficiency */
diff --git a/board/snow/board.c b/board/snow/board.c
index 2f5900340b..bb76860826 100644
--- a/board/snow/board.c
+++ b/board/snow/board.c
@@ -9,6 +9,7 @@
#include "console.h"
#include "dma.h"
#include "extpower.h"
+#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
@@ -29,17 +30,6 @@
#define HARD_RESET_TIMEOUT_MS 5
-/* GPIO interrupt handlers prototypes */
-#ifdef CONFIG_CHIPSET_GAIA
-void gaia_power_event(enum gpio_signal signal);
-void gaia_suspend_event(enum gpio_signal signal);
-void gaia_lid_event(enum gpio_signal signal);
-#else
-#define gaia_power_event NULL
-#define gaia_suspend_event NULL
-#define gaia_lid_event NULL
-#endif
-
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
/* Inputs with interrupt handlers are first for efficiency */
diff --git a/board/spring/board.c b/board/spring/board.c
index 9be90d45ba..82be07121f 100644
--- a/board/spring/board.c
+++ b/board/spring/board.c
@@ -10,6 +10,7 @@
#include "console.h"
#include "dma.h"
#include "extpower.h"
+#include "gaia_power.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
@@ -46,17 +47,6 @@ uint8_t breathing_prog[] = {0x41, 0xff, /* 0x80 -> 0x0 */
0x7f, 0x00,
0x00, 0x00}; /* Repeat */
-/* GPIO interrupt handlers prototypes */
-#ifdef CONFIG_CHIPSET_GAIA
-void gaia_power_event(enum gpio_signal signal);
-void gaia_suspend_event(enum gpio_signal signal);
-void gaia_lid_event(enum gpio_signal signal);
-#else
-#define gaia_power_event NULL
-#define gaia_suspend_event NULL
-#define gaia_lid_event NULL
-#endif
-
void usb_charge_interrupt(enum gpio_signal signal);
/* GPIO signal list. Must match order from enum gpio_signal. */
diff --git a/common/gaia_power.c b/common/gaia_power.c
index da73b1d105..f197890f88 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -27,6 +27,7 @@
#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 "keyboard_scan.h"
diff --git a/include/gaia_power.h b/include/gaia_power.h
new file mode 100644
index 0000000000..b37ce08b8d
--- /dev/null
+++ b/include/gaia_power.h
@@ -0,0 +1,30 @@
+/* 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_lid_event(enum gpio_signal signal);
+void gaia_suspend_event(enum gpio_signal signal);
+
+#else
+
+#define gaia_power_event NULL
+#define gaia_suspend_event NULL
+#define gaia_lid_event NULL
+
+#endif
+
+#endif /* __CROS_EC_GAIA_POWER_H */