summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-05-23 14:33:14 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-27 15:42:54 -0700
commita07de2f2e0037c15a321dbb93ae4d139d7ad72c8 (patch)
tree5c8ab52c4e3e0e6f3dad0e746166de300b4ed7d2 /arch
parent9b2aa51a8b4913948e3061706498c7f91d5aa827 (diff)
arm: tegra: gpio: Implementation for gpio_to_irq
Adding the support in function gpio_to_irq() such that the external gpio peripheral driver can provide the gpio to irq number through their gpio implementation. Change-Id: Ibab369df435af79ce09d71e491a8ee851f2228ba Reviewed-on: http://git-master/r/32563 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/include/mach/gpio.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index 1462b258d374..aec47722938a 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -36,16 +36,23 @@
static inline int gpio_to_irq(unsigned int gpio)
{
+ /* SOC gpio */
if (gpio < TEGRA_NR_GPIOS)
return INT_GPIO_BASE + gpio;
- return -EINVAL;
+
+ /* For non soc gpio, the external peripheral driver need to
+ * provide the implementation */
+ return __gpio_to_irq(gpio);
}
static inline int irq_to_gpio(unsigned int irq)
{
+ /* SOC gpio */
if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR))
return irq - INT_GPIO_BASE;
- return -EINVAL;
+
+ /* we don't supply reverse mappings for non-SOC gpios */
+ return -EIO;
}
void tegra_gpio_enable(int gpio);