[U-Boot] [PATCH 53/60] tegra: keyboard: move pinmux setup to board files

Stephen Warren swarren at wwwdotorg.org
Tue Apr 19 22:59:33 CEST 2016


From: Stephen Warren <swarren at nvidia.com>

Remove funcmux calls from the Tegra keyboard driver. Knowledge of pinmux
setup must come from either board files or DT; it should not be embedded
into board-agnostic driver code. The DT pinmux bindings do not allow
drivers to derive funcmux-style information, since the DT bindings are
pin-based whereas funcmux is controller-based, so there's no good way to
call the existing funcmux APIs from drivers. Converting drivers to use a
new (as yet non-existent in U-Boot) API that pulls pinmux information from
DT isn't useful for Tegra, since Tegra's DT files don't contain any
per-device pinmux tables, so this would simply be extra code that has no
effect; doesn't actually set up the pinmux. We are left with moving the
pinmux setup functionality into board files. In theory the board files
could be converted later to use DT, but that would be a separate change.

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 board/nvidia/seaboard/seaboard.c | 1 +
 drivers/input/tegra-kbc.c        | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 2208e3711f19..5bd00278e203 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -40,4 +40,5 @@ void tegra_board_early_init_f(void)
 	pinmux_tristate_disable(PMUX_PINGRP_ATA);
 	/* For CD GPIO PI5 */
 	pinmux_tristate_disable(PMUX_PINGRP_ATC);
+	funcmux_select(PERIPH_ID_KBC, FUNCMUX_DEFAULT);
 }
diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c
index 349d95804201..df0f52c2c6f8 100644
--- a/drivers/input/tegra-kbc.c
+++ b/drivers/input/tegra-kbc.c
@@ -15,7 +15,6 @@
 #include <tegra-kbc.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/funcmux.h>
 #include <linux/input.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -260,8 +259,6 @@ static int tegra_kbd_start(struct udevice *dev)
 {
 	struct tegra_kbd_priv *priv = dev_get_priv(dev);
 
-	/* Set up pin mux and enable the clock */
-	funcmux_select(PERIPH_ID_KBC, FUNCMUX_DEFAULT);
 	clock_enable(PERIPH_ID_KBC);
 	config_kbc_gpio(priv, priv->kbc);
 
-- 
2.8.1



More information about the U-Boot mailing list