From 3e215d0a19c2a0c389bd9117573b6dd8e46f96a8 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Sat, 18 Feb 2012 01:04:55 -0700 Subject: gpio: tegra: Hide tegra_gpio_enable/disable() Recent pinctrl discussions concluded that gpiolib APIs should in fact do whatever is required to mux a GPIO onto pins, by calling pinctrl APIs if required. This change implements this for the Tegra GPIO driver, and removes calls to the Tegra-specific APIs from drivers and board files. Cc: Chris Ball Cc: linux-mmc@vger.kernel.org Signed-off-by: Stephen Warren Acked-by: Chris Ball # for sdhci-tegra.c Acked-by: Linus Walleij Acked-by: Olof Johansson --- arch/arm/mach-tegra/board-pinmux.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'arch/arm/mach-tegra/board-pinmux.c') diff --git a/arch/arm/mach-tegra/board-pinmux.c b/arch/arm/mach-tegra/board-pinmux.c index adc3efe979b3..3015b5a38936 100644 --- a/arch/arm/mach-tegra/board-pinmux.c +++ b/arch/arm/mach-tegra/board-pinmux.c @@ -18,7 +18,6 @@ #include #include -#include #include #include "board-pinmux.h" @@ -26,18 +25,6 @@ struct tegra_board_pinmux_conf *confs[2]; -static void tegra_board_pinmux_setup_gpios(void) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(confs); i++) { - if (!confs[i]) - continue; - - tegra_gpio_config(confs[i]->gpios, confs[i]->gpio_count); - } -} - static void tegra_board_pinmux_setup_pinmux(void) { int i; @@ -57,29 +44,17 @@ static void tegra_board_pinmux_setup_pinmux(void) static int tegra_board_pinmux_bus_notify(struct notifier_block *nb, unsigned long event, void *vdev) { - static bool had_gpio; - static bool had_pinmux; - struct device *dev = vdev; - const char *devname; if (event != BUS_NOTIFY_BOUND_DRIVER) return NOTIFY_DONE; - devname = dev_name(dev); + if (strcmp(dev_name(dev), PINMUX_DEV)) + return NOTIFY_DONE; - if (!had_gpio && !strcmp(devname, GPIO_DEV)) { - tegra_board_pinmux_setup_gpios(); - had_gpio = true; - } else if (!had_pinmux && !strcmp(devname, PINMUX_DEV)) { - tegra_board_pinmux_setup_pinmux(); - had_pinmux = true; - } + tegra_board_pinmux_setup_pinmux(); - if (had_gpio && had_pinmux) - return NOTIFY_STOP_MASK; - else - return NOTIFY_DONE; + return NOTIFY_STOP_MASK; } static struct notifier_block nb = { -- cgit v1.2.3