summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik/cpu-8815.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-01-09 12:40:02 +0100
committerLinus Walleij <linus.walleij@linaro.org>2012-06-10 18:41:26 +0200
commit7c77852d2f22cebd5ca7c4ded4c47284e67ed9b5 (patch)
tree63cd85f73b96ab2c412eace9b98450c0bd44da53 /arch/arm/mach-nomadik/cpu-8815.c
parent056c78d3a28ab7c8438b42f4d0915030ca8f51b9 (diff)
downloadblackbird-op-linux-7c77852d2f22cebd5ca7c4ded4c47284e67ed9b5.tar.gz
blackbird-op-linux-7c77852d2f22cebd5ca7c4ded4c47284e67ed9b5.zip
ARM: nomadik: register AMBA devices dynamically
This makes AMBA devices on the Nomadik main CPU die register dynamically, and refactor the registration of the RNG to use this. Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-nomadik/cpu-8815.c')
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index b79b3846935a..c0f28a6d0d06 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -22,6 +22,9 @@
#include <linux/amba/bus.h>
#include <linux/platform_device.h>
#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/irq.h>
+#include <linux/dma-mapping.h>
#include <plat/gpio-nomadik.h>
#include <mach/hardware.h>
@@ -35,12 +38,6 @@
#include "clock.h"
#include "cpu-8815.h"
-static AMBA_APB_DEVICE(cpu8815_amba_rng, "rng", 0, NOMADIK_RNG_BASE, { }, NULL);
-
-static struct amba_device *amba_devs[] __initdata = {
- &cpu8815_amba_rng_device
-};
-
/* The 8815 has 4 GPIO blocks, let's register them immediately */
static resource_size_t __initdata cpu8815_gpio_base[] = {
NOMADIK_GPIO0_BASE,
@@ -88,15 +85,13 @@ void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
static int __init cpu8815_init(void)
{
- int i;
struct nmk_gpio_platform_data pdata = {
/* No custom data yet */
};
cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
IRQ_GPIO0, &pdata);
- for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
- amba_device_register(amba_devs[i], &iomem_resource);
+ amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
return 0;
}
arch_initcall(cpu8815_init);
OpenPOWER on IntegriCloud