diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2011-06-08 17:35:33 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-08 18:11:57 -0400 |
commit | 1e4c88420e0da3c855c17770a807cabd5b16dd7a (patch) | |
tree | 3dcfcb15d07801b12cc89ccd131ed4cda337f703 /arch/arm/mach-ep93xx | |
parent | 6dd599f8af0166805951f4421a78ba716d78321a (diff) |
gpio/ep93xx: convert to platform_driver and use basic_mmio_gpio library
This converts the gpio-ep93xx driver into a platform_driver and uses
the basic_mmio_gpio library.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 82079545adc4..a6b3fb208775 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -174,14 +174,10 @@ struct sys_timer ep93xx_timer = { | |||
174 | /************************************************************************* | 174 | /************************************************************************* |
175 | * EP93xx IRQ handling | 175 | * EP93xx IRQ handling |
176 | *************************************************************************/ | 176 | *************************************************************************/ |
177 | extern void ep93xx_gpio_init_irq(void); | ||
178 | |||
179 | void __init ep93xx_init_irq(void) | 177 | void __init ep93xx_init_irq(void) |
180 | { | 178 | { |
181 | vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); | 179 | vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); |
182 | vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); | 180 | vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); |
183 | |||
184 | ep93xx_gpio_init_irq(); | ||
185 | } | 181 | } |
186 | 182 | ||
187 | 183 | ||
@@ -241,6 +237,24 @@ unsigned int ep93xx_chip_revision(void) | |||
241 | } | 237 | } |
242 | 238 | ||
243 | /************************************************************************* | 239 | /************************************************************************* |
240 | * EP93xx GPIO | ||
241 | *************************************************************************/ | ||
242 | static struct resource ep93xx_gpio_resource[] = { | ||
243 | { | ||
244 | .start = EP93XX_GPIO_PHYS_BASE, | ||
245 | .end = EP93XX_GPIO_PHYS_BASE + 0xcc - 1, | ||
246 | .flags = IORESOURCE_MEM, | ||
247 | }, | ||
248 | }; | ||
249 | |||
250 | static struct platform_device ep93xx_gpio_device = { | ||
251 | .name = "gpio-ep93xx", | ||
252 | .id = -1, | ||
253 | .num_resources = ARRAY_SIZE(ep93xx_gpio_resource), | ||
254 | .resource = ep93xx_gpio_resource, | ||
255 | }; | ||
256 | |||
257 | /************************************************************************* | ||
244 | * EP93xx peripheral handling | 258 | * EP93xx peripheral handling |
245 | *************************************************************************/ | 259 | *************************************************************************/ |
246 | #define EP93XX_UART_MCR_OFFSET (0x0100) | 260 | #define EP93XX_UART_MCR_OFFSET (0x0100) |
@@ -866,14 +880,13 @@ void __init ep93xx_register_ac97(void) | |||
866 | platform_device_register(&ep93xx_pcm_device); | 880 | platform_device_register(&ep93xx_pcm_device); |
867 | } | 881 | } |
868 | 882 | ||
869 | extern void ep93xx_gpio_init(void); | ||
870 | |||
871 | void __init ep93xx_init_devices(void) | 883 | void __init ep93xx_init_devices(void) |
872 | { | 884 | { |
873 | /* Disallow access to MaverickCrunch initially */ | 885 | /* Disallow access to MaverickCrunch initially */ |
874 | ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_CPENA); | 886 | ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_CPENA); |
875 | 887 | ||
876 | ep93xx_gpio_init(); | 888 | /* Get the GPIO working early, other devices need it */ |
889 | platform_device_register(&ep93xx_gpio_device); | ||
877 | 890 | ||
878 | amba_device_register(&uart1_device, &iomem_resource); | 891 | amba_device_register(&uart1_device, &iomem_resource); |
879 | amba_device_register(&uart2_device, &iomem_resource); | 892 | amba_device_register(&uart2_device, &iomem_resource); |