summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/build.mk2
-rw-r--r--common/gpio_common.c (renamed from common/gpio_commands.c)14
2 files changed, 12 insertions, 4 deletions
diff --git a/common/build.mk b/common/build.mk
index dbf863eeb4..6eb685a1b9 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -8,7 +8,7 @@
common-y=main.o util.o console_output.o uart_buffering.o
common-y+=memory_commands.o shared_mem.o system_common.o hooks.o
-common-y+=gpio_commands.o version.o printf.o queue.o
+common-y+=gpio_common.o version.o printf.o queue.o
common-$(CONFIG_BATTERY_BQ20Z453)+=battery_bq20z453.o
common-$(CONFIG_BATTERY_LINK)+=battery_link.o charge_state.o battery_precharge.o
common-$(CONFIG_CHARGER_BQ24725)+=charger_bq24725.o
diff --git a/common/gpio_commands.c b/common/gpio_common.c
index e429bc09a9..11ab9fa4e7 100644
--- a/common/gpio_commands.c
+++ b/common/gpio_common.c
@@ -1,11 +1,11 @@
-/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+/* 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.
*/
-/* GPIO console commands for Chrome EC */
+/* GPIO common functionality for Chrome EC */
-#include "board.h"
+#include "common.h"
#include "console.h"
#include "gpio.h"
#include "host_command.h"
@@ -59,6 +59,14 @@ static int last_val_changed(int i, int v)
}
/*****************************************************************************/
+/* GPIO API */
+
+const char *gpio_get_name(enum gpio_signal signal)
+{
+ return gpio_list[signal].name;
+}
+
+/*****************************************************************************/
/* Console commands */
static int command_gpio_get(int argc, char **argv)