1/* 2 * Copyright (C) 2009-2010 Pengutronix 3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 * 5 * This program is free software; you can redistribute it and/or modify it under 6 * the terms of the GNU General Public License version 2 as published by the 7 * Free Software Foundation. 8 */ 9#include <asm/sizes.h> 10#include <mach/devices-common.h> 11 12static struct platform_device *__init imx_add_mxc_nand(resource_size_t iobase, 13 int irq, const struct mxc_nand_platform_data *pdata, 14 resource_size_t iosize) 15{ 16 static int id = 0; 17 18 struct resource res[] = { 19 { 20 .start = iobase, 21 .end = iobase + iosize - 1, 22 .flags = IORESOURCE_MEM, 23 }, { 24 .start = irq, 25 .end = irq, 26 .flags = IORESOURCE_IRQ, 27 }, 28 }; 29 30 return imx_add_platform_device("mxc_nand", id++, res, ARRAY_SIZE(res), 31 pdata, sizeof(*pdata)); 32} 33 34struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase, 35 int irq, const struct mxc_nand_platform_data *pdata) 36{ 37 return imx_add_mxc_nand(iobase, irq, pdata, SZ_4K); 38} 39 40struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase, 41 int irq, const struct mxc_nand_platform_data *pdata) 42{ 43 return imx_add_mxc_nand(iobase, irq, pdata, SZ_8K); 44} 45