summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-04-11 12:24:03 -0700
committerChromeBot <chrome-bot@google.com>2013-04-11 15:38:08 -0700
commitb9d0d9c60b2b826f37192f6ffb96b23f1c18d6de (patch)
treecd9fb5251d1b81ad6b155a1f1f017aeb9cd384d6 /common
parent08f8c6857f28a71ca549a9d490717a6d44517c75 (diff)
downloadchrome-ec-b9d0d9c60b2b826f37192f6ffb96b23f1c18d6de.tar.gz
Move gpio_get_name() to gpio_common.c
Its implementation is the same on all platforms. No functional changes, just renaming/moving. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms Change-Id: I78741c6587ea61e7ac8edae5a509502b7ab5078b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47898 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
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)