ARM: tegra: add tegra_gpio_table and tegra_gpio_config
To give one place to setup the pins that are used as GPIOs instead of as their pinmuxed functions. Specifying enabled as false explicitly disables the gpio mode of that pin (if left on by firmware). This should remove the need for calling these from specific drivers and thus reduce tegra-specific code from them. Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Erik Gilling <konkers@android.com>
This commit is contained in:
@@ -381,6 +381,20 @@ static int __init tegra_gpio_init(void)
|
||||
|
||||
postcore_initcall(tegra_gpio_init);
|
||||
|
||||
void __init tegra_gpio_config(struct tegra_gpio_table *table, int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
int gpio = table[i].gpio;
|
||||
|
||||
if (table[i].enable)
|
||||
tegra_gpio_enable(gpio);
|
||||
else
|
||||
tegra_gpio_disable(gpio);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
Reference in New Issue
Block a user