diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-08-15 20:28:06 +0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 14:55:19 +0100 |
commit | ce55754c4f3ea6985d19e24aa8972918bd07c88d (patch) | |
tree | fae3ea5859b30a26fa3d080e361227664207f28f /arch/arm/mach-clps711x/autcpu12.c | |
parent | d1f55c680e5d021e7066f4461dd678d42af18898 (diff) | |
download | op-kernel-dev-ce55754c4f3ea6985d19e24aa8972918bd07c88d.zip op-kernel-dev-ce55754c4f3ea6985d19e24aa8972918bd07c88d.tar.gz |
mtd: autcpu12-nvram: Convert driver to platform_device
Because we can have a single kernel to support multiple machines, we
need to make loading specific drivers for the target platform only.
For this, driver is converted to the platform driver.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'arch/arm/mach-clps711x/autcpu12.c')
-rw-r--r-- | arch/arm/mach-clps711x/autcpu12.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index 3fb79a1..3287191 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c @@ -23,6 +23,8 @@ #include <linux/string.h> #include <linux/mm.h> #include <linux/io.h> +#include <linux/ioport.h> +#include <linux/platform_device.h> #include <mach/hardware.h> #include <asm/sizes.h> @@ -62,9 +64,26 @@ void __init autcpu12_map_io(void) iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc)); } +static struct resource autcpu12_nvram_resource[] __initdata = { + DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"), +}; + +static struct platform_device autcpu12_nvram_pdev __initdata = { + .name = "autcpu12_nvram", + .id = -1, + .resource = autcpu12_nvram_resource, + .num_resources = ARRAY_SIZE(autcpu12_nvram_resource), +}; + +static void __init autcpu12_init(void) +{ + platform_device_register(&autcpu12_nvram_pdev); +} + MACHINE_START(AUTCPU12, "autronix autcpu12") /* Maintainer: Thomas Gleixner */ .atag_offset = 0x20000, + .init_machine = autcpu12_init, .map_io = autcpu12_map_io, .init_irq = clps711x_init_irq, .timer = &clps711x_timer, |