Commit acc0fb43 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Sekhar Nori

ARM: davinci: mityomapl138: use aemif platform driver

We now support board files in the aemif driver. Register a platform
device instead of using the handcrafted API in mityomapl138.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 59a21802
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <mach/da8xx.h> #include <mach/da8xx.h>
#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci.h>
#include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/mtd-davinci-aemif.h>
#include <linux/platform_data/ti-aemif.h>
#include <mach/mux.h> #include <mach/mux.h>
#include <linux/platform_data/spi-davinci.h> #include <linux/platform_data/spi-davinci.h>
...@@ -422,7 +423,8 @@ static struct resource mityomapl138_nandflash_resource[] = { ...@@ -422,7 +423,8 @@ static struct resource mityomapl138_nandflash_resource[] = {
}, },
}; };
static struct platform_device mityomapl138_nandflash_device = { static struct platform_device mityomapl138_aemif_devices[] = {
{
.name = "davinci_nand", .name = "davinci_nand",
.id = 1, .id = 1,
.dev = { .dev = {
...@@ -430,19 +432,44 @@ static struct platform_device mityomapl138_nandflash_device = { ...@@ -430,19 +432,44 @@ static struct platform_device mityomapl138_nandflash_device = {
}, },
.num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource), .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource),
.resource = mityomapl138_nandflash_resource, .resource = mityomapl138_nandflash_resource,
},
};
static struct resource mityomapl138_aemif_resources[] = {
{
.start = DA8XX_AEMIF_CTL_BASE,
.end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
.flags = IORESOURCE_MEM,
},
}; };
static struct platform_device *mityomapl138_devices[] __initdata = { static struct aemif_abus_data mityomapl138_aemif_abus_data[] = {
&mityomapl138_nandflash_device, {
.cs = 1,
},
};
static struct aemif_platform_data mityomapl138_aemif_pdata = {
.abus_data = mityomapl138_aemif_abus_data,
.num_abus_data = ARRAY_SIZE(mityomapl138_aemif_abus_data),
.sub_devices = mityomapl138_aemif_devices,
.num_sub_devices = ARRAY_SIZE(mityomapl138_aemif_devices),
};
static struct platform_device mityomapl138_aemif_device = {
.name = "ti-aemif",
.id = -1,
.dev = {
.platform_data = &mityomapl138_aemif_pdata,
},
.resource = mityomapl138_aemif_resources,
.num_resources = ARRAY_SIZE(mityomapl138_aemif_resources),
}; };
static void __init mityomapl138_setup_nand(void) static void __init mityomapl138_setup_nand(void)
{ {
platform_add_devices(mityomapl138_devices, if (platform_device_register(&mityomapl138_aemif_device))
ARRAY_SIZE(mityomapl138_devices)); pr_warn("%s: Cannot register AEMIF device\n", __func__);
if (davinci_aemif_setup(&mityomapl138_nandflash_device))
pr_warn("%s: Cannot configure AEMIF\n", __func__);
} }
static const short mityomap_mii_pins[] = { static const short mityomap_mii_pins[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment