aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorCharulatha V <charu@ti.com>2011-08-30 14:32:21 -0400
committerTarun Kanti DebBarma <tarun.kanti@ti.com>2012-02-06 03:43:43 -0500
commitd0d665a896c5b9a0aa60e8bac15c270cb59aa9e7 (patch)
treede66912f404bbf0987427e4b0bfc772ebb963e3e /arch/arm
parentd3901eaf1fc289e8175faa8c7c460d542b6eb7dd (diff)
gpio/omap: remove bank->method & METHOD_* macros
The only bank->type (method) used in the OMAP GPIO driver is MPUIO type as they need to be handled separately. Identify the same using a flag and remove all METHOD_* macros. mpuio_init() function is defined under #ifdefs. It is required only in case of MPUIO bank type and only when PM operations are supported by it. This is applicable only in case of OMAP16xx SoC's MPUIO GPIO bank type. For all the other cases it is a dummy function. Hence clean up the same and remove all the OMAP SoC specific #ifdefs. Signed-off-by: Charulatha V <charu@ti.com> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c3
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c6
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c8
-rw-r--r--arch/arm/mach-omap2/gpio.c2
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h8
5 files changed, 4 insertions, 23 deletions
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 950e467361d0..634903ef8292 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -47,7 +47,7 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {
47 47
48static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = { 48static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
49 .virtual_irq_start = IH_MPUIO_BASE, 49 .virtual_irq_start = IH_MPUIO_BASE,
50 .bank_type = METHOD_MPUIO, 50 .is_mpuio = true,
51 .bank_width = 16, 51 .bank_width = 16,
52 .bank_stride = 1, 52 .bank_stride = 1,
53 .regs = &omap15xx_mpuio_regs, 53 .regs = &omap15xx_mpuio_regs,
@@ -90,7 +90,6 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
90 90
91static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = { 91static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
92 .virtual_irq_start = IH_GPIO_BASE, 92 .virtual_irq_start = IH_GPIO_BASE,
93 .bank_type = METHOD_GPIO_1510,
94 .bank_width = 16, 93 .bank_width = 16,
95 .regs = &omap15xx_gpio_regs, 94 .regs = &omap15xx_gpio_regs,
96}; 95};
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 86ac41544a21..1c5f90e17427 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -53,7 +53,7 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
53 53
54static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = { 54static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
55 .virtual_irq_start = IH_MPUIO_BASE, 55 .virtual_irq_start = IH_MPUIO_BASE,
56 .bank_type = METHOD_MPUIO, 56 .is_mpuio = true,
57 .bank_width = 16, 57 .bank_width = 16,
58 .bank_stride = 1, 58 .bank_stride = 1,
59 .regs = &omap16xx_mpuio_regs, 59 .regs = &omap16xx_mpuio_regs,
@@ -100,7 +100,6 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {
100 100
101static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = { 101static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
102 .virtual_irq_start = IH_GPIO_BASE, 102 .virtual_irq_start = IH_GPIO_BASE,
103 .bank_type = METHOD_GPIO_1610,
104 .bank_width = 16, 103 .bank_width = 16,
105 .regs = &omap16xx_gpio_regs, 104 .regs = &omap16xx_gpio_regs,
106}; 105};
@@ -130,7 +129,6 @@ static struct __initdata resource omap16xx_gpio2_resources[] = {
130 129
131static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = { 130static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
132 .virtual_irq_start = IH_GPIO_BASE + 16, 131 .virtual_irq_start = IH_GPIO_BASE + 16,
133 .bank_type = METHOD_GPIO_1610,
134 .bank_width = 16, 132 .bank_width = 16,
135 .regs = &omap16xx_gpio_regs, 133 .regs = &omap16xx_gpio_regs,
136}; 134};
@@ -160,7 +158,6 @@ static struct __initdata resource omap16xx_gpio3_resources[] = {
160 158
161static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = { 159static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
162 .virtual_irq_start = IH_GPIO_BASE + 32, 160 .virtual_irq_start = IH_GPIO_BASE + 32,
163 .bank_type = METHOD_GPIO_1610,
164 .bank_width = 16, 161 .bank_width = 16,
165 .regs = &omap16xx_gpio_regs, 162 .regs = &omap16xx_gpio_regs,
166}; 163};
@@ -190,7 +187,6 @@ static struct __initdata resource omap16xx_gpio4_resources[] = {
190 187
191static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = { 188static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
192 .virtual_irq_start = IH_GPIO_BASE + 48, 189 .virtual_irq_start = IH_GPIO_BASE + 48,
193 .bank_type = METHOD_GPIO_1610,
194 .bank_width = 16, 190 .bank_width = 16,
195 .regs = &omap16xx_gpio_regs, 191 .regs = &omap16xx_gpio_regs,
196}; 192};
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index 207a23cfa1a0..433491cb73fa 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -52,8 +52,8 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {
52 52
53static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = { 53static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
54 .virtual_irq_start = IH_MPUIO_BASE, 54 .virtual_irq_start = IH_MPUIO_BASE,
55 .bank_type = METHOD_MPUIO,
56 .bank_width = 32, 55 .bank_width = 32,
56 .is_mpuio = true,
57 .bank_stride = 2, 57 .bank_stride = 2,
58 .regs = &omap7xx_mpuio_regs, 58 .regs = &omap7xx_mpuio_regs,
59}; 59};
@@ -94,7 +94,6 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {
94 94
95static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = { 95static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
96 .virtual_irq_start = IH_GPIO_BASE, 96 .virtual_irq_start = IH_GPIO_BASE,
97 .bank_type = METHOD_GPIO_7XX,
98 .bank_width = 32, 97 .bank_width = 32,
99 .regs = &omap7xx_gpio_regs, 98 .regs = &omap7xx_gpio_regs,
100}; 99};
@@ -124,7 +123,6 @@ static struct __initdata resource omap7xx_gpio2_resources[] = {
124 123
125static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = { 124static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
126 .virtual_irq_start = IH_GPIO_BASE + 32, 125 .virtual_irq_start = IH_GPIO_BASE + 32,
127 .bank_type = METHOD_GPIO_7XX,
128 .bank_width = 32, 126 .bank_width = 32,
129 .regs = &omap7xx_gpio_regs, 127 .regs = &omap7xx_gpio_regs,
130}; 128};
@@ -154,7 +152,6 @@ static struct __initdata resource omap7xx_gpio3_resources[] = {
154 152
155static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = { 153static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
156 .virtual_irq_start = IH_GPIO_BASE + 64, 154 .virtual_irq_start = IH_GPIO_BASE + 64,
157 .bank_type = METHOD_GPIO_7XX,
158 .bank_width = 32, 155 .bank_width = 32,
159 .regs = &omap7xx_gpio_regs, 156 .regs = &omap7xx_gpio_regs,
160}; 157};
@@ -184,7 +181,6 @@ static struct __initdata resource omap7xx_gpio4_resources[] = {
184 181
185static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = { 182static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
186 .virtual_irq_start = IH_GPIO_BASE + 96, 183 .virtual_irq_start = IH_GPIO_BASE + 96,
187 .bank_type = METHOD_GPIO_7XX,
188 .bank_width = 32, 184 .bank_width = 32,
189 .regs = &omap7xx_gpio_regs, 185 .regs = &omap7xx_gpio_regs,
190}; 186};
@@ -214,7 +210,6 @@ static struct __initdata resource omap7xx_gpio5_resources[] = {
214 210
215static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = { 211static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
216 .virtual_irq_start = IH_GPIO_BASE + 128, 212 .virtual_irq_start = IH_GPIO_BASE + 128,
217 .bank_type = METHOD_GPIO_7XX,
218 .bank_width = 32, 213 .bank_width = 32,
219 .regs = &omap7xx_gpio_regs, 214 .regs = &omap7xx_gpio_regs,
220}; 215};
@@ -244,7 +239,6 @@ static struct __initdata resource omap7xx_gpio6_resources[] = {
244 239
245static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = { 240static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
246 .virtual_irq_start = IH_GPIO_BASE + 160, 241 .virtual_irq_start = IH_GPIO_BASE + 160,
247 .bank_type = METHOD_GPIO_7XX,
248 .bank_width = 32, 242 .bank_width = 32,
249 .regs = &omap7xx_gpio_regs, 243 .regs = &omap7xx_gpio_regs,
250}; 244};
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index f4c45ca2cc59..dfda6b3478b2 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -74,7 +74,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
74 /* fall through */ 74 /* fall through */
75 75
76 case 1: 76 case 1:
77 pdata->bank_type = METHOD_GPIO_24XX;
78 pdata->regs->revision = OMAP24XX_GPIO_REVISION; 77 pdata->regs->revision = OMAP24XX_GPIO_REVISION;
79 pdata->regs->direction = OMAP24XX_GPIO_OE; 78 pdata->regs->direction = OMAP24XX_GPIO_OE;
80 pdata->regs->datain = OMAP24XX_GPIO_DATAIN; 79 pdata->regs->datain = OMAP24XX_GPIO_DATAIN;
@@ -97,7 +96,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
97 pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT; 96 pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT;
98 break; 97 break;
99 case 2: 98 case 2:
100 pdata->bank_type = METHOD_GPIO_44XX;
101 pdata->regs->revision = OMAP4_GPIO_REVISION; 99 pdata->regs->revision = OMAP4_GPIO_REVISION;
102 pdata->regs->direction = OMAP4_GPIO_OE; 100 pdata->regs->direction = OMAP4_GPIO_OE;
103 pdata->regs->datain = OMAP4_GPIO_DATAIN; 101 pdata->regs->datain = OMAP4_GPIO_DATAIN;
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 8be165108aad..cb75b657b04b 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -162,13 +162,6 @@
162 IH_MPUIO_BASE + ((nr) & 0x0f) : \ 162 IH_MPUIO_BASE + ((nr) & 0x0f) : \
163 IH_GPIO_BASE + (nr)) 163 IH_GPIO_BASE + (nr))
164 164
165#define METHOD_MPUIO 0
166#define METHOD_GPIO_1510 1
167#define METHOD_GPIO_1610 2
168#define METHOD_GPIO_7XX 3
169#define METHOD_GPIO_24XX 5
170#define METHOD_GPIO_44XX 6
171
172struct omap_gpio_dev_attr { 165struct omap_gpio_dev_attr {
173 int bank_width; /* GPIO bank width */ 166 int bank_width; /* GPIO bank width */
174 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ 167 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
@@ -210,6 +203,7 @@ struct omap_gpio_platform_data {
210 int bank_stride; /* Only needed for omap1 MPUIO */ 203 int bank_stride; /* Only needed for omap1 MPUIO */
211 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ 204 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
212 bool loses_context; /* whether the bank would ever lose context */ 205 bool loses_context; /* whether the bank would ever lose context */
206 bool is_mpuio; /* whether the bank is of type MPUIO */
213 u32 non_wakeup_gpios; 207 u32 non_wakeup_gpios;
214 208
215 struct omap_gpio_reg_offs *regs; 209 struct omap_gpio_reg_offs *regs;