aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:08:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:08:06 -0400
commit411f5c7a502769ccc0377c5ba36cb0b283847ba8 (patch)
tree2c3a29671e3f923de48c55f94194849264a7bf53 /arch/arm/mach-mxs/gpio.c
parent6d7ed21d17e640b120b902a314143e5ef4917a70 (diff)
parent9ced9f03d12d7539e86b0bff5bc750153c976c34 (diff)
Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm: (289 commits) davinci: DM644x EVM: register MUSB device earlier davinci: add spi devices on tnetv107x evm davinci: add ssp config for tnetv107x evm board davinci: add tnetv107x ssp platform device spi: add ti-ssp spi master driver mfd: add driver for sequencer serial port ARM: EXYNOS4: Implement Clock gating for System MMU ARM: EXYNOS4: Enhancement of System MMU driver ARM: EXYNOS4: Add support for gpio interrupts ARM: S5P: Add function to register gpio interrupt bank data ARM: S5P: Cleanup S5P gpio interrupt code ARM: EXYNOS4: Add missing GPYx banks ARM: S3C64XX: Fix section mismatch from cpufreq init ARM: EXYNOS4: Add keypad device to the SMDKV310 ARM: EXYNOS4: Update clocks for keypad ARM: EXYNOS4: Update keypad base address ARM: EXYNOS4: Add keypad device helpers ARM: EXYNOS4: Add support for SATA on ARMLEX4210 plat-nomadik: make GPIO interrupts work with cpuidle ApSleep mach-u300: define a dummy filter function for coh901318 ... Fix up various conflicts in - arch/arm/mach-exynos4/cpufreq.c - arch/arm/mach-mxs/gpio.c - drivers/net/Kconfig - drivers/tty/serial/Kconfig - drivers/tty/serial/Makefile - drivers/usb/gadget/fsl_mxc_udc.c - drivers/video/Kconfig
Diffstat (limited to 'arch/arm/mach-mxs/gpio.c')
-rw-r--r--arch/arm/mach-mxs/gpio.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c
index 61991e4dde44..56fa2ed15222 100644
--- a/arch/arm/mach-mxs/gpio.c
+++ b/arch/arm/mach-mxs/gpio.c
@@ -182,6 +182,7 @@ static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
182} 182}
183 183
184static struct irq_chip gpio_irq_chip = { 184static struct irq_chip gpio_irq_chip = {
185 .name = "mxs gpio",
185 .irq_ack = mxs_gpio_ack_irq, 186 .irq_ack = mxs_gpio_ack_irq,
186 .irq_mask = mxs_gpio_mask_irq, 187 .irq_mask = mxs_gpio_mask_irq,
187 .irq_unmask = mxs_gpio_unmask_irq, 188 .irq_unmask = mxs_gpio_unmask_irq,
@@ -289,39 +290,42 @@ int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt)
289 return 0; 290 return 0;
290} 291}
291 292
292#define DEFINE_MXS_GPIO_PORT(soc, _id) \ 293#define MX23_GPIO_BASE MX23_IO_ADDRESS(MX23_PINCTRL_BASE_ADDR)
294#define MX28_GPIO_BASE MX28_IO_ADDRESS(MX28_PINCTRL_BASE_ADDR)
295
296#define DEFINE_MXS_GPIO_PORT(_base, _irq, _id) \
293 { \ 297 { \
294 .chip.label = "gpio-" #_id, \ 298 .chip.label = "gpio-" #_id, \
295 .id = _id, \ 299 .id = _id, \
296 .irq = soc ## _INT_GPIO ## _id, \ 300 .irq = _irq, \
297 .base = soc ## _IO_ADDRESS( \ 301 .base = _base, \
298 soc ## _PINCTRL ## _BASE_ADDR), \
299 .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ 302 .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \
300 } 303 }
301 304
302#define DEFINE_REGISTER_FUNCTION(prefix) \
303int __init prefix ## _register_gpios(void) \
304{ \
305 return mxs_gpio_init(prefix ## _gpio_ports, \
306 ARRAY_SIZE(prefix ## _gpio_ports)); \
307}
308
309#ifdef CONFIG_SOC_IMX23 305#ifdef CONFIG_SOC_IMX23
310static struct mxs_gpio_port mx23_gpio_ports[] = { 306static struct mxs_gpio_port mx23_gpio_ports[] = {
311 DEFINE_MXS_GPIO_PORT(MX23, 0), 307 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO0, 0),
312 DEFINE_MXS_GPIO_PORT(MX23, 1), 308 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO1, 1),
313 DEFINE_MXS_GPIO_PORT(MX23, 2), 309 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO2, 2),
314}; 310};
315DEFINE_REGISTER_FUNCTION(mx23) 311
312int __init mx23_register_gpios(void)
313{
314 return mxs_gpio_init(mx23_gpio_ports, ARRAY_SIZE(mx23_gpio_ports));
315}
316#endif 316#endif
317 317
318#ifdef CONFIG_SOC_IMX28 318#ifdef CONFIG_SOC_IMX28
319static struct mxs_gpio_port mx28_gpio_ports[] = { 319static struct mxs_gpio_port mx28_gpio_ports[] = {
320 DEFINE_MXS_GPIO_PORT(MX28, 0), 320 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO0, 0),
321 DEFINE_MXS_GPIO_PORT(MX28, 1), 321 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO1, 1),
322 DEFINE_MXS_GPIO_PORT(MX28, 2), 322 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO2, 2),
323 DEFINE_MXS_GPIO_PORT(MX28, 3), 323 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO3, 3),
324 DEFINE_MXS_GPIO_PORT(MX28, 4), 324 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO4, 4),
325}; 325};
326DEFINE_REGISTER_FUNCTION(mx28) 326
327int __init mx28_register_gpios(void)
328{
329 return mxs_gpio_init(mx28_gpio_ports, ARRAY_SIZE(mx28_gpio_ports));
330}
327#endif 331#endif