summaryrefslogtreecommitdiff
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
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>
-rw-r--r--chip/lm4/gpio.c5
-rw-r--r--chip/stm32/build.mk2
-rw-r--r--chip/stm32/gpio.c15
-rw-r--r--common/build.mk2
-rw-r--r--common/gpio_common.c (renamed from common/gpio_commands.c)14
5 files changed, 13 insertions, 25 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index 9c276634c1..bce2138ca2 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -77,11 +77,6 @@ void gpio_set_alternate_function(int port, int mask, int func)
LM4_GPIO_DEN(port) |= mask;
}
-const char *gpio_get_name(enum gpio_signal signal)
-{
- return gpio_list[signal].name;
-}
-
int gpio_get_level(enum gpio_signal signal)
{
return LM4_GPIO_DATA(gpio_list[signal].port,
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk
index 87e3a88d44..949fffe470 100644
--- a/chip/stm32/build.mk
+++ b/chip/stm32/build.mk
@@ -9,7 +9,7 @@
# STM32 SoC family has a Cortex-M3 ARM core
CORE:=cortex-m
-chip-y=dma.o gpio.o hwtimer.o system.o uart.o
+chip-y=dma.o hwtimer.o system.o uart.o
chip-y+=jtag-$(CHIP_VARIANT).o clock-$(CHIP_VARIANT).o gpio-$(CHIP_VARIANT).o
chip-$(CONFIG_SPI)+=spi.o
chip-$(CONFIG_I2C)+=i2c.o
diff --git a/chip/stm32/gpio.c b/chip/stm32/gpio.c
deleted file mode 100644
index b7423900e2..0000000000
--- a/chip/stm32/gpio.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2012 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.
- */
-
-/* Common GPIO module for Chrome EC */
-
-#include "common.h"
-#include "gpio.h"
-
-const char *gpio_get_name(enum gpio_signal signal)
-{
- return gpio_list[signal].name;
-}
-
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)