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:11 +0000
commita2653c4f49ddd84301c9691c0da82bd31ac655ff (patch)
tree2df1232e071085fb04974c7cca6c3bbf0f4df273
parentb821b466fbd16f2f484be1491f96a5d7f48ae8d3 (diff)
downloadchrome-ec-a2653c4f49ddd84301c9691c0da82bd31ac655ff.tar.gz
metaknight: 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=metaknight` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Id4903ea492753666725fbc03cc24eab2b9017150 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2625796 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/metaknight/board.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/board/metaknight/board.c b/board/metaknight/board.c
index aff7cd9f7d..998e93162d 100644
--- a/board/metaknight/board.c
+++ b/board/metaknight/board.c
@@ -287,13 +287,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");
@@ -301,24 +302,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);
}