diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-30 16:14:27 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:21 -0800 |
commit | 959a044d36a3d3201f36e187d57b66abdda77b3e (patch) | |
tree | 1fa69405f314685c0393e11b24bd64cd66d92ea8 /drivers/gpio/gpio-tegra.c | |
parent | 8644fc08c6f1a6557e549f98513af2364691d40c (diff) |
arm: tegra: gpio: API to configure pins as gpio with init value
Adding api to configure pins in gpio mode with init value before
gpio library is up. This will provide to configure the pins in
initial state and avoid any glitch in pins.
bug 876305
Reviewed-on: http://git-master/r/56630
(cherry picked from commit 9e357b69d25f96c13acb660860bcdf8e0ab0a1ef)
Change-Id: Ia14721c0bf96e1a45561139fdbbf2d995b9a4963
Reviewed-on: http://git-master/r/57265
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Rc775d23898a6275d633e4474e6cf9b10395697e2
Diffstat (limited to 'drivers/gpio/gpio-tegra.c')
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 40a813c29968..17e05d6e0e62 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -131,6 +131,17 @@ void tegra_gpio_disable(int gpio) tegra_gpio_mask_write(GPIO_MSK_CNF(gpio), gpio, 0); } +void tegra_gpio_init_configure(unsigned gpio, bool is_input, int value) +{ + if (is_input) { + tegra_gpio_mask_write(GPIO_MSK_OE(gpio), gpio, 0); + } else { + tegra_gpio_mask_write(GPIO_MSK_OUT(gpio), gpio, value); + tegra_gpio_mask_write(GPIO_MSK_OE(gpio), gpio, 1); + } + tegra_gpio_mask_write(GPIO_MSK_CNF(gpio), gpio, 1); +} + static void tegra_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { tegra_gpio_mask_write(GPIO_MSK_OUT(offset), offset, value); |