aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2010-05-01 18:37:54 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-05-06 18:02:08 -0400
commit686b634a07451fc4fe3b712fe211bfa861a53241 (patch)
tree109557ee13bc43e3e574fd54fe2354a2da7d6dc9 /arch/arm
parentc12f415a9144a76dc99df34f56ce3022207ad1d0 (diff)
Davinci: gpio - controller type support
This patch allows for gpio controllers that deviate from those found on traditional davinci socs. davinci_soc_info has an added field to indicate the soc-specific gpio controller type. The gpio initialization code then bails out if necessary. More elements (tnetv107x) to be added later into enum davinci_gpio_type. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Tested-by: Sandeep Paulraj <s-paulraj@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/da830.c2
-rw-r--r--arch/arm/mach-davinci/da850.c2
-rw-r--r--arch/arm/mach-davinci/dm355.c1
-rw-r--r--arch/arm/mach-davinci/dm365.c1
-rw-r--r--arch/arm/mach-davinci/dm644x.c1
-rw-r--r--arch/arm/mach-davinci/dm646x.c1
-rw-r--r--arch/arm/mach-davinci/gpio.c3
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/gpio.h4
9 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 122e61a9f505..68e52337a1d9 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -19,6 +19,7 @@
19#include <mach/common.h> 19#include <mach/common.h>
20#include <mach/time.h> 20#include <mach/time.h>
21#include <mach/da8xx.h> 21#include <mach/da8xx.h>
22#include <mach/gpio.h>
22 23
23#include "clock.h" 24#include "clock.h"
24#include "mux.h" 25#include "mux.h"
@@ -1199,6 +1200,7 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
1199 .intc_irq_prios = da830_default_priorities, 1200 .intc_irq_prios = da830_default_priorities,
1200 .intc_irq_num = DA830_N_CP_INTC_IRQ, 1201 .intc_irq_num = DA830_N_CP_INTC_IRQ,
1201 .timer_info = &da830_timer_info, 1202 .timer_info = &da830_timer_info,
1203 .gpio_type = GPIO_TYPE_DAVINCI,
1202 .gpio_base = IO_ADDRESS(DA8XX_GPIO_BASE), 1204 .gpio_base = IO_ADDRESS(DA8XX_GPIO_BASE),
1203 .gpio_num = 128, 1205 .gpio_num = 128,
1204 .gpio_irq = IRQ_DA8XX_GPIO0, 1206 .gpio_irq = IRQ_DA8XX_GPIO0,
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index d0fd7566712a..8aefcffa5ae2 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -27,6 +27,7 @@
27#include <mach/da8xx.h> 27#include <mach/da8xx.h>
28#include <mach/cpufreq.h> 28#include <mach/cpufreq.h>
29#include <mach/pm.h> 29#include <mach/pm.h>
30#include <mach/gpio.h>
30 31
31#include "clock.h" 32#include "clock.h"
32#include "mux.h" 33#include "mux.h"
@@ -1084,6 +1085,7 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
1084 .intc_irq_prios = da850_default_priorities, 1085 .intc_irq_prios = da850_default_priorities,
1085 .intc_irq_num = DA850_N_CP_INTC_IRQ, 1086 .intc_irq_num = DA850_N_CP_INTC_IRQ,
1086 .timer_info = &da850_timer_info, 1087 .timer_info = &da850_timer_info,
1088 .gpio_type = GPIO_TYPE_DAVINCI,
1087 .gpio_base = IO_ADDRESS(DA8XX_GPIO_BASE), 1089 .gpio_base = IO_ADDRESS(DA8XX_GPIO_BASE),
1088 .gpio_num = 144, 1090 .gpio_num = 144,
1089 .gpio_irq = IRQ_DA8XX_GPIO0, 1091 .gpio_irq = IRQ_DA8XX_GPIO0,
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 5efce70ccdd0..f9a54ff2d249 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -859,6 +859,7 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
859 .intc_irq_prios = dm355_default_priorities, 859 .intc_irq_prios = dm355_default_priorities,
860 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 860 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
861 .timer_info = &dm355_timer_info, 861 .timer_info = &dm355_timer_info,
862 .gpio_type = GPIO_TYPE_DAVINCI,
862 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 863 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
863 .gpio_num = 104, 864 .gpio_num = 104,
864 .gpio_irq = IRQ_DM355_GPIOBNK0, 865 .gpio_irq = IRQ_DM355_GPIOBNK0,
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 1ee3fc818174..05666754aebe 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1064,6 +1064,7 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
1064 .intc_irq_prios = dm365_default_priorities, 1064 .intc_irq_prios = dm365_default_priorities,
1065 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 1065 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
1066 .timer_info = &dm365_timer_info, 1066 .timer_info = &dm365_timer_info,
1067 .gpio_type = GPIO_TYPE_DAVINCI,
1067 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 1068 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
1068 .gpio_num = 104, 1069 .gpio_num = 104,
1069 .gpio_irq = IRQ_DM365_GPIO0, 1070 .gpio_irq = IRQ_DM365_GPIO0,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 23cbe9d04bc5..4af349efbd54 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -748,6 +748,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
748 .intc_irq_prios = dm644x_default_priorities, 748 .intc_irq_prios = dm644x_default_priorities,
749 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 749 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
750 .timer_info = &dm644x_timer_info, 750 .timer_info = &dm644x_timer_info,
751 .gpio_type = GPIO_TYPE_DAVINCI,
751 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 752 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
752 .gpio_num = 71, 753 .gpio_num = 71,
753 .gpio_irq = IRQ_GPIOBNK0, 754 .gpio_irq = IRQ_GPIOBNK0,
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index a0b373957838..bdb1acebe203 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -832,6 +832,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
832 .intc_irq_prios = dm646x_default_priorities, 832 .intc_irq_prios = dm646x_default_priorities,
833 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 833 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
834 .timer_info = &dm646x_timer_info, 834 .timer_info = &dm646x_timer_info,
835 .gpio_type = GPIO_TYPE_DAVINCI,
835 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 836 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
836 .gpio_num = 43, /* Only 33 usable */ 837 .gpio_num = 43, /* Only 33 usable */
837 .gpio_irq = IRQ_DM646X_GPIOBNK0, 838 .gpio_irq = IRQ_DM646X_GPIOBNK0,
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c
index d241b4f2abe2..e422cd300d4c 100644
--- a/arch/arm/mach-davinci/gpio.c
+++ b/arch/arm/mach-davinci/gpio.c
@@ -145,6 +145,9 @@ static int __init davinci_gpio_setup(void)
145 struct davinci_soc_info *soc_info = &davinci_soc_info; 145 struct davinci_soc_info *soc_info = &davinci_soc_info;
146 struct davinci_gpio_regs *regs; 146 struct davinci_gpio_regs *regs;
147 147
148 if (soc_info->gpio_type != GPIO_TYPE_DAVINCI)
149 return 0;
150
148 /* 151 /*
149 * The gpio banks conceptually expose a segmented bitmap, 152 * The gpio banks conceptually expose a segmented bitmap,
150 * and "ngpio" is one more than the largest zero-based 153 * and "ngpio" is one more than the largest zero-based
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 1d72883f593e..8ffef5bbd9cf 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -59,6 +59,7 @@ struct davinci_soc_info {
59 u8 *intc_irq_prios; 59 u8 *intc_irq_prios;
60 unsigned long intc_irq_num; 60 unsigned long intc_irq_num;
61 struct davinci_timer_info *timer_info; 61 struct davinci_timer_info *timer_info;
62 int gpio_type;
62 void __iomem *gpio_base; 63 void __iomem *gpio_base;
63 unsigned gpio_num; 64 unsigned gpio_num;
64 unsigned gpio_irq; 65 unsigned gpio_irq;
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 82591d0d48fb..9a71a26eb77f 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -21,6 +21,10 @@
21 21
22#define DAVINCI_GPIO_BASE 0x01C67000 22#define DAVINCI_GPIO_BASE 0x01C67000
23 23
24enum davinci_gpio_type {
25 GPIO_TYPE_DAVINCI = 0,
26};
27
24/* 28/*
25 * basic gpio routines 29 * basic gpio routines
26 * 30 *