summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2021-01-12 15:02:40 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-13 17:29:06 +0000
commitb821b466fbd16f2f484be1491f96a5d7f48ae8d3 (patch)
tree9c3ddfe06afa43132d2c43cc590583b51d800e7f
parente2761c8be4571adcfc425a9187290872ffa9d02d (diff)
downloadchrome-ec-b821b466fbd16f2f484be1491f96a5d7f48ae8d3.tar.gz
magolor: Ignore 5V GPIO remap
Early versions of waddledoo had to have their 5V GPIO remapped between versions. As variants of waddledoo are created, they end up copying the same code which is not applicable to their board. This commit restricts the remap to the waddledoo board only. BUG=None BRANCH=dedede TEST=`make -j BOARD=magolor` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ie9e88f89fc1ea1ef8869c8ff8788fd7d9f85ca84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2625795 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
-rw-r--r--board/magolor/board.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/board/magolor/board.c b/board/magolor/board.c
index 6aea86804a..82a0690db7 100644
--- a/board/magolor/board.c
+++ b/board/magolor/board.c
@@ -260,13 +260,14 @@ void board_reset_pd_mcu(void)
*/
}
+#ifdef BOARD_WADDLEDOO
static void reconfigure_5v_gpio(void)
{
/*
- * b/147257497: On early boards, GPIO_EN_PP5000 was swapped with
- * GPIO_VOLUP_BTN_ODL. Therefore, we'll actually need to set that GPIO
- * instead for those boards. Note that this breaks the volume up button
- * functionality.
+ * b/147257497: On early waddledoo boards, GPIO_EN_PP5000 was swapped
+ * with GPIO_VOLUP_BTN_ODL. Therefore, we'll actually need to set that
+ * GPIO instead for those boards. Note that this breaks the volume up
+ * button functionality.
*/
if (system_get_board_version() < 0) {
CPRINTS("old board - remapping 5V en");
@@ -274,24 +275,28 @@ static void reconfigure_5v_gpio(void)
}
}
DECLARE_HOOK(HOOK_INIT, reconfigure_5v_gpio, HOOK_PRIO_INIT_I2C+1);
+#endif /* BOARD_WADDLEDOO */
static void set_5v_gpio(int level)
{
int version;
- enum gpio_signal gpio;
+ enum gpio_signal gpio = GPIO_EN_PP5000;
/*
- * b/147257497: On early boards, GPIO_EN_PP5000 was swapped with
- * GPIO_VOLUP_BTN_ODL. Therefore, we'll actually need to set that GPIO
- * instead for those boards. Note that this breaks the volume up button
- * functionality.
+ * b/147257497: On early waddledoo boards, GPIO_EN_PP5000 was swapped
+ * with GPIO_VOLUP_BTN_ODL. Therefore, we'll actually need to set that
+ * GPIO instead for those boards. Note that this breaks the volume up
+ * button functionality.
*/
- version = system_get_board_version();
+ if (IS_ENABLED(BOARD_WADDLEDOO)) {
+ version = system_get_board_version();
- /*
- * If the CBI EEPROM wasn't formatted, assume it's a very early board.
- */
- gpio = version < 0 ? GPIO_VOLUP_BTN_ODL : GPIO_EN_PP5000;
+ /*
+ * If the CBI EEPROM wasn't formatted, assume it's a very early
+ * board.
+ */
+ gpio = version < 0 ? GPIO_VOLUP_BTN_ODL : GPIO_EN_PP5000;
+ }
gpio_set_level(gpio, level);
}