diff options
author | Chaitanya Bandi <bandik@nvidia.com> | 2011-09-19 16:45:28 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:43 -0800 |
commit | 276911c2ce3d7612c787786608a26ce9842aa2d8 (patch) | |
tree | c98540390e2d2010a89649fc9ac8a6c43eefaf0e /arch/arm/mach-tegra/pinmux.c | |
parent | 4add2bff97dc1be9137dd43e95fd295997aa7213 (diff) |
ARM: tegra: gpio: Set a gpio to tristate or normal
Create mapping from gpio to pingroup and set gpio to
normal or tristate
Bug 866633
Reviewed-on: http://git-master/r/56557
(cherry picked from commit 321ded98d41170b9e32d60177c6808492ccdf115)
Change-Id: I3d1b979717f1c6b208af3df0a7dfe603e5272d21
Reviewed-on: http://git-master/r/61120
Tested-by: Bandi Krishna Chaitanya <bandik@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Rebase-Id: R5991c2cbc11aa35345fde7f08c0bfeb306e85e1e
Diffstat (limited to 'arch/arm/mach-tegra/pinmux.c')
-rw-r--r-- | arch/arm/mach-tegra/pinmux.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/pinmux.c b/arch/arm/mach-tegra/pinmux.c index c18d2053d8aa..a9f698b3590f 100644 --- a/arch/arm/mach-tegra/pinmux.c +++ b/arch/arm/mach-tegra/pinmux.c @@ -35,6 +35,8 @@ static const struct tegra_pingroup_desc *const pingroups = tegra_soc_pingroups; static const struct tegra_drive_pingroup_desc *const drive_pingroups = tegra_soc_drive_pingroups; +static const int *gpio_to_pingroups_map = gpio_to_pingroup; + static char *tegra_mux_names[TEGRA_MAX_MUX] = { [TEGRA_MUX_AHB_CLK] = "AHB_CLK", @@ -221,7 +223,7 @@ static const char *pupd_name(unsigned long val) #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) static const char *lock_name(unsigned long val) { - switch(val) { + switch (val) { case TEGRA_PIN_LOCK_DEFAULT: return "LOCK_DEFUALT"; @@ -237,7 +239,7 @@ static const char *lock_name(unsigned long val) static const char *od_name(unsigned long val) { - switch(val) { + switch (val) { case TEGRA_PIN_OD_DEFAULT: return "OD_DEFAULT"; @@ -253,7 +255,7 @@ static const char *od_name(unsigned long val) static const char *ioreset_name(unsigned long val) { - switch(val) { + switch (val) { case TEGRA_PIN_IO_RESET_DEFAULT: return "IO_RESET_DEFAULT"; @@ -294,6 +296,11 @@ static inline void pg_writel(unsigned long value, unsigned long offset) writel(value, IO_TO_VIRT(TEGRA_APB_MISC_BASE) + offset); } +int tegra_pinmux_get_pingroup(int gpio_nr) +{ + return gpio_to_pingroups_map[gpio_nr]; +} + static int tegra_pinmux_set_func(const struct tegra_pingroup_config *config) { int mux = -1; |