| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563 | 
							- /* linux/arch/arm/plat-samsung/devs.c
 
-  *
 
-  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 
-  *		http://www.samsung.com
 
-  *
 
-  * Base SAMSUNG platform device definitions
 
-  *
 
-  * This program is free software; you can redistribute it and/or modify
 
-  * it under the terms of the GNU General Public License version 2 as
 
-  * published by the Free Software Foundation.
 
- */
 
- #include <linux/kernel.h>
 
- #include <linux/types.h>
 
- #include <linux/interrupt.h>
 
- #include <linux/list.h>
 
- #include <linux/timer.h>
 
- #include <linux/init.h>
 
- #include <linux/serial_core.h>
 
- #include <linux/platform_device.h>
 
- #include <linux/io.h>
 
- #include <linux/slab.h>
 
- #include <linux/string.h>
 
- #include <linux/dma-mapping.h>
 
- #include <linux/fb.h>
 
- #include <linux/gfp.h>
 
- #include <linux/mtd/mtd.h>
 
- #include <linux/mtd/onenand.h>
 
- #include <linux/mtd/partitions.h>
 
- #include <linux/mmc/host.h>
 
- #include <linux/ioport.h>
 
- #include <linux/platform_data/s3c-hsudc.h>
 
- #include <linux/platform_data/s3c-hsotg.h>
 
- #include <media/s5p_hdmi.h>
 
- #include <asm/irq.h>
 
- #include <asm/mach/arch.h>
 
- #include <asm/mach/map.h>
 
- #include <asm/mach/irq.h>
 
- #include <mach/hardware.h>
 
- #include <mach/dma.h>
 
- #include <mach/irqs.h>
 
- #include <mach/map.h>
 
- #include <plat/cpu.h>
 
- #include <plat/devs.h>
 
- #include <plat/adc.h>
 
- #include <linux/platform_data/ata-samsung_cf.h>
 
- #include <linux/platform_data/usb-ehci-s5p.h>
 
- #include <plat/fb.h>
 
- #include <plat/fb-s3c2410.h>
 
- #include <plat/hdmi.h>
 
- #include <linux/platform_data/hwmon-s3c.h>
 
- #include <linux/platform_data/i2c-s3c2410.h>
 
- #include <plat/keypad.h>
 
- #include <linux/platform_data/mmc-s3cmci.h>
 
- #include <linux/platform_data/mtd-nand-s3c2410.h>
 
- #include <plat/sdhci.h>
 
- #include <linux/platform_data/touchscreen-s3c2410.h>
 
- #include <linux/platform_data/usb-s3c2410_udc.h>
 
- #include <linux/platform_data/usb-ohci-s3c2410.h>
 
- #include <plat/usb-phy.h>
 
- #include <plat/regs-iic.h>
 
- #include <plat/regs-serial.h>
 
- #include <plat/regs-spi.h>
 
- #include <linux/platform_data/spi-s3c64xx.h>
 
- static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
 
- /* AC97 */
 
- #ifdef CONFIG_CPU_S3C2440
 
- static struct resource s3c_ac97_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97),
 
- 	[2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT, "PCM out"),
 
- 	[3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN, "PCM in"),
 
- 	[4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN, "Mic in"),
 
- };
 
- struct platform_device s3c_device_ac97 = {
 
- 	.name		= "samsung-ac97",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_ac97_resource),
 
- 	.resource	= s3c_ac97_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- #endif /* CONFIG_CPU_S3C2440 */
 
- /* ADC */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_adc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_TC),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_ADC),
 
- };
 
- struct platform_device s3c_device_adc = {
 
- 	.name		= "s3c24xx-adc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_adc_resource),
 
- 	.resource	= s3c_adc_resource,
 
- };
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- #if defined(CONFIG_SAMSUNG_DEV_ADC)
 
- static struct resource s3c_adc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_TC),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_ADC),
 
- };
 
- struct platform_device s3c_device_adc = {
 
- 	.name		= "samsung-adc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_adc_resource),
 
- 	.resource	= s3c_adc_resource,
 
- };
 
- #endif /* CONFIG_SAMSUNG_DEV_ADC */
 
- /* Camif Controller */
 
- #ifdef CONFIG_CPU_S3C2440
 
- static struct resource s3c_camif_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF, S3C2440_SZ_CAMIF),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_C),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_P),
 
- };
 
- struct platform_device s3c_device_camif = {
 
- 	.name		= "s3c2440-camif",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_camif_resource),
 
- 	.resource	= s3c_camif_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- #endif /* CONFIG_CPU_S3C2440 */
 
- /* ASOC DMA */
 
- struct platform_device samsung_asoc_idma = {
 
- 	.name		= "samsung-idma",
 
- 	.id		= -1,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- /* FB */
 
- #ifdef CONFIG_S3C_DEV_FB
 
- static struct resource s3c_fb_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_FB, SZ_16K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO),
 
- 	[3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM),
 
- };
 
- struct platform_device s3c_device_fb = {
 
- 	.name		= "s3c-fb",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_fb_resource),
 
- 	.resource	= s3c_fb_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
 
- {
 
- 	s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
 
- 			 &s3c_device_fb);
 
- }
 
- #endif /* CONFIG_S3C_DEV_FB */
 
- /* FIMC */
 
- #ifdef CONFIG_S5P_DEV_FIMC0
 
- static struct resource s5p_fimc0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_FIMC0, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_FIMC0),
 
- };
 
- struct platform_device s5p_device_fimc0 = {
 
- 	.name		= "s5p-fimc",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s5p_fimc0_resource),
 
- 	.resource	= s5p_fimc0_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- struct platform_device s5p_device_fimc_md = {
 
- 	.name	= "s5p-fimc-md",
 
- 	.id	= -1,
 
- };
 
- #endif /* CONFIG_S5P_DEV_FIMC0 */
 
- #ifdef CONFIG_S5P_DEV_FIMC1
 
- static struct resource s5p_fimc1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_FIMC1, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_FIMC1),
 
- };
 
- struct platform_device s5p_device_fimc1 = {
 
- 	.name		= "s5p-fimc",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_fimc1_resource),
 
- 	.resource	= s5p_fimc1_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /* CONFIG_S5P_DEV_FIMC1 */
 
- #ifdef CONFIG_S5P_DEV_FIMC2
 
- static struct resource s5p_fimc2_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_FIMC2, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_FIMC2),
 
- };
 
- struct platform_device s5p_device_fimc2 = {
 
- 	.name		= "s5p-fimc",
 
- 	.id		= 2,
 
- 	.num_resources	= ARRAY_SIZE(s5p_fimc2_resource),
 
- 	.resource	= s5p_fimc2_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /* CONFIG_S5P_DEV_FIMC2 */
 
- #ifdef CONFIG_S5P_DEV_FIMC3
 
- static struct resource s5p_fimc3_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_FIMC3, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_FIMC3),
 
- };
 
- struct platform_device s5p_device_fimc3 = {
 
- 	.name		= "s5p-fimc",
 
- 	.id		= 3,
 
- 	.num_resources	= ARRAY_SIZE(s5p_fimc3_resource),
 
- 	.resource	= s5p_fimc3_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /* CONFIG_S5P_DEV_FIMC3 */
 
- /* G2D */
 
- #ifdef CONFIG_S5P_DEV_G2D
 
- static struct resource s5p_g2d_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_G2D, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_2D),
 
- };
 
- struct platform_device s5p_device_g2d = {
 
- 	.name		= "s5p-g2d",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s5p_g2d_resource),
 
- 	.resource	= s5p_g2d_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /* CONFIG_S5P_DEV_G2D */
 
- #ifdef CONFIG_S5P_DEV_JPEG
 
- static struct resource s5p_jpeg_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_JPEG, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_JPEG),
 
- };
 
- struct platform_device s5p_device_jpeg = {
 
- 	.name		= "s5p-jpeg",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s5p_jpeg_resource),
 
- 	.resource	= s5p_jpeg_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /*  CONFIG_S5P_DEV_JPEG */
 
- /* FIMD0 */
 
- #ifdef CONFIG_S5P_DEV_FIMD0
 
- static struct resource s5p_fimd0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_FIMD0, SZ_32K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_FIMD0_VSYNC),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_FIMD0_FIFO),
 
- 	[3] = DEFINE_RES_IRQ(IRQ_FIMD0_SYSTEM),
 
- };
 
- struct platform_device s5p_device_fimd0 = {
 
- 	.name		= "s5p-fb",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s5p_fimd0_resource),
 
- 	.resource	= s5p_fimd0_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
 
- {
 
- 	s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
 
- 			 &s5p_device_fimd0);
 
- }
 
- #endif /* CONFIG_S5P_DEV_FIMD0 */
 
- /* HWMON */
 
- #ifdef CONFIG_S3C_DEV_HWMON
 
- struct platform_device s3c_device_hwmon = {
 
- 	.name		= "s3c-hwmon",
 
- 	.id		= -1,
 
- 	.dev.parent	= &s3c_device_adc.dev,
 
- };
 
- void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
 
- {
 
- 	s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
 
- 			 &s3c_device_hwmon);
 
- }
 
- #endif /* CONFIG_S3C_DEV_HWMON */
 
- /* HSMMC */
 
- #ifdef CONFIG_S3C_DEV_HSMMC
 
- static struct resource s3c_hsmmc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_HSMMC0, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_HSMMC0),
 
- };
 
- struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
 
- 	.max_width	= 4,
 
- 	.host_caps	= (MMC_CAP_4_BIT_DATA |
 
- 			   MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
 
- };
 
- struct platform_device s3c_device_hsmmc0 = {
 
- 	.name		= "s3c-sdhci",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c_hsmmc_resource),
 
- 	.resource	= s3c_hsmmc_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 		.platform_data		= &s3c_hsmmc0_def_platdata,
 
- 	},
 
- };
 
- void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
 
- {
 
- 	s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
 
- }
 
- #endif /* CONFIG_S3C_DEV_HSMMC */
 
- #ifdef CONFIG_S3C_DEV_HSMMC1
 
- static struct resource s3c_hsmmc1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_HSMMC1, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_HSMMC1),
 
- };
 
- struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
 
- 	.max_width	= 4,
 
- 	.host_caps	= (MMC_CAP_4_BIT_DATA |
 
- 			   MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
 
- };
 
- struct platform_device s3c_device_hsmmc1 = {
 
- 	.name		= "s3c-sdhci",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_hsmmc1_resource),
 
- 	.resource	= s3c_hsmmc1_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 		.platform_data		= &s3c_hsmmc1_def_platdata,
 
- 	},
 
- };
 
- void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
 
- {
 
- 	s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
 
- }
 
- #endif /* CONFIG_S3C_DEV_HSMMC1 */
 
- /* HSMMC2 */
 
- #ifdef CONFIG_S3C_DEV_HSMMC2
 
- static struct resource s3c_hsmmc2_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_HSMMC2, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_HSMMC2),
 
- };
 
- struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
 
- 	.max_width	= 4,
 
- 	.host_caps	= (MMC_CAP_4_BIT_DATA |
 
- 			   MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
 
- };
 
- struct platform_device s3c_device_hsmmc2 = {
 
- 	.name		= "s3c-sdhci",
 
- 	.id		= 2,
 
- 	.num_resources	= ARRAY_SIZE(s3c_hsmmc2_resource),
 
- 	.resource	= s3c_hsmmc2_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 		.platform_data		= &s3c_hsmmc2_def_platdata,
 
- 	},
 
- };
 
- void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
 
- {
 
- 	s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
 
- }
 
- #endif /* CONFIG_S3C_DEV_HSMMC2 */
 
- #ifdef CONFIG_S3C_DEV_HSMMC3
 
- static struct resource s3c_hsmmc3_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_HSMMC3, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_HSMMC3),
 
- };
 
- struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
 
- 	.max_width	= 4,
 
- 	.host_caps	= (MMC_CAP_4_BIT_DATA |
 
- 			   MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
 
- };
 
- struct platform_device s3c_device_hsmmc3 = {
 
- 	.name		= "s3c-sdhci",
 
- 	.id		= 3,
 
- 	.num_resources	= ARRAY_SIZE(s3c_hsmmc3_resource),
 
- 	.resource	= s3c_hsmmc3_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 		.platform_data		= &s3c_hsmmc3_def_platdata,
 
- 	},
 
- };
 
- void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
 
- {
 
- 	s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
 
- }
 
- #endif /* CONFIG_S3C_DEV_HSMMC3 */
 
- /* I2C */
 
- static struct resource s3c_i2c0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC),
 
- };
 
- struct platform_device s3c_device_i2c0 = {
 
- 	.name		= "s3c2410-i2c",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c0_resource),
 
- 	.resource	= s3c_i2c0_resource,
 
- };
 
- struct s3c2410_platform_i2c default_i2c_data __initdata = {
 
- 	.flags		= 0,
 
- 	.slave_addr	= 0x10,
 
- 	.frequency	= 100*1000,
 
- 	.sda_delay	= 100,
 
- };
 
- void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 0;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c0);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c0_cfg_gpio;
 
- }
 
- #ifdef CONFIG_S3C_DEV_I2C1
 
- static struct resource s3c_i2c1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC1, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC1),
 
- };
 
- struct platform_device s3c_device_i2c1 = {
 
- 	.name		= "s3c2410-i2c",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c1_resource),
 
- 	.resource	= s3c_i2c1_resource,
 
- };
 
- void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 1;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c1);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c1_cfg_gpio;
 
- }
 
- #endif /* CONFIG_S3C_DEV_I2C1 */
 
- #ifdef CONFIG_S3C_DEV_I2C2
 
- static struct resource s3c_i2c2_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC2, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC2),
 
- };
 
- struct platform_device s3c_device_i2c2 = {
 
- 	.name		= "s3c2410-i2c",
 
- 	.id		= 2,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c2_resource),
 
- 	.resource	= s3c_i2c2_resource,
 
- };
 
- void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 2;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c2);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c2_cfg_gpio;
 
- }
 
- #endif /* CONFIG_S3C_DEV_I2C2 */
 
- #ifdef CONFIG_S3C_DEV_I2C3
 
- static struct resource s3c_i2c3_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC3, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC3),
 
- };
 
- struct platform_device s3c_device_i2c3 = {
 
- 	.name		= "s3c2440-i2c",
 
- 	.id		= 3,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c3_resource),
 
- 	.resource	= s3c_i2c3_resource,
 
- };
 
- void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 3;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c3);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c3_cfg_gpio;
 
- }
 
- #endif /*CONFIG_S3C_DEV_I2C3 */
 
- #ifdef CONFIG_S3C_DEV_I2C4
 
- static struct resource s3c_i2c4_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC4, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC4),
 
- };
 
- struct platform_device s3c_device_i2c4 = {
 
- 	.name		= "s3c2440-i2c",
 
- 	.id		= 4,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c4_resource),
 
- 	.resource	= s3c_i2c4_resource,
 
- };
 
- void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 4;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c4);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c4_cfg_gpio;
 
- }
 
- #endif /*CONFIG_S3C_DEV_I2C4 */
 
- #ifdef CONFIG_S3C_DEV_I2C5
 
- static struct resource s3c_i2c5_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC5, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC5),
 
- };
 
- struct platform_device s3c_device_i2c5 = {
 
- 	.name		= "s3c2440-i2c",
 
- 	.id		= 5,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c5_resource),
 
- 	.resource	= s3c_i2c5_resource,
 
- };
 
- void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 5;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c5);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c5_cfg_gpio;
 
- }
 
- #endif /*CONFIG_S3C_DEV_I2C5 */
 
- #ifdef CONFIG_S3C_DEV_I2C6
 
- static struct resource s3c_i2c6_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC6, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC6),
 
- };
 
- struct platform_device s3c_device_i2c6 = {
 
- 	.name		= "s3c2440-i2c",
 
- 	.id		= 6,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c6_resource),
 
- 	.resource	= s3c_i2c6_resource,
 
- };
 
- void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 6;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c6);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c6_cfg_gpio;
 
- }
 
- #endif /* CONFIG_S3C_DEV_I2C6 */
 
- #ifdef CONFIG_S3C_DEV_I2C7
 
- static struct resource s3c_i2c7_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_IIC7, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC7),
 
- };
 
- struct platform_device s3c_device_i2c7 = {
 
- 	.name		= "s3c2440-i2c",
 
- 	.id		= 7,
 
- 	.num_resources	= ARRAY_SIZE(s3c_i2c7_resource),
 
- 	.resource	= s3c_i2c7_resource,
 
- };
 
- void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		pd->bus_num = 7;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s3c_device_i2c7);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = s3c_i2c7_cfg_gpio;
 
- }
 
- #endif /* CONFIG_S3C_DEV_I2C7 */
 
- /* I2C HDMIPHY */
 
- #ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
 
- static struct resource s5p_i2c_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_IIC_HDMIPHY, SZ_4K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_IIC_HDMIPHY),
 
- };
 
- struct platform_device s5p_device_i2c_hdmiphy = {
 
- 	.name		= "s3c2440-hdmiphy-i2c",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_i2c_resource),
 
- 	.resource	= s5p_i2c_resource,
 
- };
 
- void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
 
- {
 
- 	struct s3c2410_platform_i2c *npd;
 
- 	if (!pd) {
 
- 		pd = &default_i2c_data;
 
- 		if (soc_is_exynos4210() ||
 
- 		    soc_is_exynos4212() || soc_is_exynos4412())
 
- 			pd->bus_num = 8;
 
- 		else if (soc_is_s5pv210())
 
- 			pd->bus_num = 3;
 
- 		else
 
- 			pd->bus_num = 0;
 
- 	}
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
 
- 			       &s5p_device_i2c_hdmiphy);
 
- }
 
- static struct s5p_hdmi_platform_data s5p_hdmi_def_platdata;
 
- void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info,
 
- 				  struct i2c_board_info *mhl_info, int mhl_bus)
 
- {
 
- 	struct s5p_hdmi_platform_data *pd = &s5p_hdmi_def_platdata;
 
- 	if (soc_is_exynos4210() ||
 
- 	    soc_is_exynos4212() || soc_is_exynos4412())
 
- 		pd->hdmiphy_bus = 8;
 
- 	else if (soc_is_s5pv210())
 
- 		pd->hdmiphy_bus = 3;
 
- 	else
 
- 		pd->hdmiphy_bus = 0;
 
- 	pd->hdmiphy_info = hdmiphy_info;
 
- 	pd->mhl_info = mhl_info;
 
- 	pd->mhl_bus = mhl_bus;
 
- 	s3c_set_platdata(pd, sizeof(struct s5p_hdmi_platform_data),
 
- 			 &s5p_device_hdmi);
 
- }
 
- #endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
 
- /* I2S */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_iis_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
 
- };
 
- struct platform_device s3c_device_iis = {
 
- 	.name		= "s3c24xx-iis",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_iis_resource),
 
- 	.resource	= s3c_iis_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* IDE CFCON */
 
- #ifdef CONFIG_SAMSUNG_DEV_IDE
 
- static struct resource s3c_cfcon_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON, SZ_16K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_CFCON),
 
- };
 
- struct platform_device s3c_device_cfcon = {
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c_cfcon_resource),
 
- 	.resource	= s3c_cfcon_resource,
 
- };
 
- void __init s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
 
- {
 
- 	s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
 
- 			 &s3c_device_cfcon);
 
- }
 
- #endif /* CONFIG_SAMSUNG_DEV_IDE */
 
- /* KEYPAD */
 
- #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
 
- static struct resource samsung_keypad_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD, SZ_32),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_KEYPAD),
 
- };
 
- struct platform_device samsung_device_keypad = {
 
- 	.name		= "samsung-keypad",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(samsung_keypad_resources),
 
- 	.resource	= samsung_keypad_resources,
 
- };
 
- void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
 
- {
 
- 	struct samsung_keypad_platdata *npd;
 
- 	npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
 
- 			&samsung_device_keypad);
 
- 	if (!npd->cfg_gpio)
 
- 		npd->cfg_gpio = samsung_keypad_cfg_gpio;
 
- }
 
- #endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
 
- /* LCD Controller */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_lcd_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_LCD, S3C24XX_SZ_LCD),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_LCD),
 
- };
 
- struct platform_device s3c_device_lcd = {
 
- 	.name		= "s3c2410-lcd",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_lcd_resource),
 
- 	.resource	= s3c_lcd_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
 
- {
 
- 	struct s3c2410fb_mach_info *npd;
 
- 	npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
 
- 	if (npd) {
 
- 		npd->displays = kmemdup(pd->displays,
 
- 			sizeof(struct s3c2410fb_display) * npd->num_displays,
 
- 			GFP_KERNEL);
 
- 		if (!npd->displays)
 
- 			printk(KERN_ERR "no memory for LCD display data\n");
 
- 	} else {
 
- 		printk(KERN_ERR "no memory for LCD platform data\n");
 
- 	}
 
- }
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* MFC */
 
- #ifdef CONFIG_S5P_DEV_MFC
 
- static struct resource s5p_mfc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_MFC),
 
- };
 
- struct platform_device s5p_device_mfc = {
 
- 	.name		= "s5p-mfc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_mfc_resource),
 
- 	.resource	= s5p_mfc_resource,
 
- };
 
- /*
 
-  * MFC hardware has 2 memory interfaces which are modelled as two separate
 
-  * platform devices to let dma-mapping distinguish between them.
 
-  *
 
-  * MFC parent device (s5p_device_mfc) must be registered before memory
 
-  * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
 
-  */
 
- struct platform_device s5p_device_mfc_l = {
 
- 	.name		= "s5p-mfc-l",
 
- 	.id		= -1,
 
- 	.dev		= {
 
- 		.parent			= &s5p_device_mfc.dev,
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- struct platform_device s5p_device_mfc_r = {
 
- 	.name		= "s5p-mfc-r",
 
- 	.id		= -1,
 
- 	.dev		= {
 
- 		.parent			= &s5p_device_mfc.dev,
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- #endif /* CONFIG_S5P_DEV_MFC */
 
- /* MIPI CSIS */
 
- #ifdef CONFIG_S5P_DEV_CSIS0
 
- static struct resource s5p_mipi_csis0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS0, SZ_16K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS0),
 
- };
 
- struct platform_device s5p_device_mipi_csis0 = {
 
- 	.name		= "s5p-mipi-csis",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s5p_mipi_csis0_resource),
 
- 	.resource	= s5p_mipi_csis0_resource,
 
- };
 
- #endif /* CONFIG_S5P_DEV_CSIS0 */
 
- #ifdef CONFIG_S5P_DEV_CSIS1
 
- static struct resource s5p_mipi_csis1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS1, SZ_16K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS1),
 
- };
 
- struct platform_device s5p_device_mipi_csis1 = {
 
- 	.name		= "s5p-mipi-csis",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_mipi_csis1_resource),
 
- 	.resource	= s5p_mipi_csis1_resource,
 
- };
 
- #endif
 
- /* NAND */
 
- #ifdef CONFIG_S3C_DEV_NAND
 
- static struct resource s3c_nand_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_NAND, SZ_1M),
 
- };
 
- struct platform_device s3c_device_nand = {
 
- 	.name		= "s3c2410-nand",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_nand_resource),
 
- 	.resource	= s3c_nand_resource,
 
- };
 
- /*
 
-  * s3c_nand_copy_set() - copy nand set data
 
-  * @set: The new structure, directly copied from the old.
 
-  *
 
-  * Copy all the fields from the NAND set field from what is probably __initdata
 
-  * to new kernel memory. The code returns 0 if the copy happened correctly or
 
-  * an error code for the calling function to display.
 
-  *
 
-  * Note, we currently do not try and look to see if we've already copied the
 
-  * data in a previous set.
 
-  */
 
- static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
 
- {
 
- 	void *ptr;
 
- 	int size;
 
- 	size = sizeof(struct mtd_partition) * set->nr_partitions;
 
- 	if (size) {
 
- 		ptr = kmemdup(set->partitions, size, GFP_KERNEL);
 
- 		set->partitions = ptr;
 
- 		if (!ptr)
 
- 			return -ENOMEM;
 
- 	}
 
- 	if (set->nr_map && set->nr_chips) {
 
- 		size = sizeof(int) * set->nr_chips;
 
- 		ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
 
- 		set->nr_map = ptr;
 
- 		if (!ptr)
 
- 			return -ENOMEM;
 
- 	}
 
- 	if (set->ecc_layout) {
 
- 		ptr = kmemdup(set->ecc_layout,
 
- 			      sizeof(struct nand_ecclayout), GFP_KERNEL);
 
- 		set->ecc_layout = ptr;
 
- 		if (!ptr)
 
- 			return -ENOMEM;
 
- 	}
 
- 	return 0;
 
- }
 
- void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
 
- {
 
- 	struct s3c2410_platform_nand *npd;
 
- 	int size;
 
- 	int ret;
 
- 	/* note, if we get a failure in allocation, we simply drop out of the
 
- 	 * function. If there is so little memory available at initialisation
 
- 	 * time then there is little chance the system is going to run.
 
- 	 */
 
- 	npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
 
- 				&s3c_device_nand);
 
- 	if (!npd)
 
- 		return;
 
- 	/* now see if we need to copy any of the nand set data */
 
- 	size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
 
- 	if (size) {
 
- 		struct s3c2410_nand_set *from = npd->sets;
 
- 		struct s3c2410_nand_set *to;
 
- 		int i;
 
- 		to = kmemdup(from, size, GFP_KERNEL);
 
- 		npd->sets = to;	/* set, even if we failed */
 
- 		if (!to) {
 
- 			printk(KERN_ERR "%s: no memory for sets\n", __func__);
 
- 			return;
 
- 		}
 
- 		for (i = 0; i < npd->nr_sets; i++) {
 
- 			ret = s3c_nand_copy_set(to);
 
- 			if (ret) {
 
- 				printk(KERN_ERR "%s: failed to copy set %d\n",
 
- 				__func__, i);
 
- 				return;
 
- 			}
 
- 			to++;
 
- 		}
 
- 	}
 
- }
 
- #endif /* CONFIG_S3C_DEV_NAND */
 
- /* ONENAND */
 
- #ifdef CONFIG_S3C_DEV_ONENAND
 
- static struct resource s3c_onenand_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_ONENAND, SZ_1K),
 
- 	[1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF, S3C_SZ_ONENAND_BUF),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_ONENAND),
 
- };
 
- struct platform_device s3c_device_onenand = {
 
- 	.name		= "samsung-onenand",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c_onenand_resources),
 
- 	.resource	= s3c_onenand_resources,
 
- };
 
- #endif /* CONFIG_S3C_DEV_ONENAND */
 
- #ifdef CONFIG_S3C64XX_DEV_ONENAND1
 
- static struct resource s3c64xx_onenand1_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1, SZ_1K),
 
- 	[1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF, S3C64XX_SZ_ONENAND1_BUF),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_ONENAND1),
 
- };
 
- struct platform_device s3c64xx_device_onenand1 = {
 
- 	.name		= "samsung-onenand",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s3c64xx_onenand1_resources),
 
- 	.resource	= s3c64xx_onenand1_resources,
 
- };
 
- void __init s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
 
- {
 
- 	s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
 
- 			 &s3c64xx_device_onenand1);
 
- }
 
- #endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
 
- #ifdef CONFIG_S5P_DEV_ONENAND
 
- static struct resource s5p_onenand_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_ONENAND, SZ_128K),
 
- 	[1] = DEFINE_RES_MEM(S5P_PA_ONENAND_DMA, SZ_8K),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_ONENAND_AUDI),
 
- };
 
- struct platform_device s5p_device_onenand = {
 
- 	.name		= "s5pc110-onenand",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_onenand_resources),
 
- 	.resource	= s5p_onenand_resources,
 
- };
 
- #endif /* CONFIG_S5P_DEV_ONENAND */
 
- /* PMU */
 
- #ifdef CONFIG_PLAT_S5P
 
- static struct resource s5p_pmu_resource[] = {
 
- 	DEFINE_RES_IRQ(IRQ_PMU)
 
- };
 
- static struct platform_device s5p_device_pmu = {
 
- 	.name		= "arm-pmu",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_pmu_resource),
 
- 	.resource	= s5p_pmu_resource,
 
- };
 
- static int __init s5p_pmu_init(void)
 
- {
 
- 	platform_device_register(&s5p_device_pmu);
 
- 	return 0;
 
- }
 
- arch_initcall(s5p_pmu_init);
 
- #endif /* CONFIG_PLAT_S5P */
 
- /* PWM Timer */
 
- #ifdef CONFIG_SAMSUNG_DEV_PWM
 
- #define TIMER_RESOURCE_SIZE (1)
 
- #define TIMER_RESOURCE(_tmr, _irq)			\
 
- 	(struct resource [TIMER_RESOURCE_SIZE]) {	\
 
- 		[0] = {					\
 
- 			.start	= _irq,			\
 
- 			.end	= _irq,			\
 
- 			.flags	= IORESOURCE_IRQ	\
 
- 		}					\
 
- 	}
 
- #define DEFINE_S3C_TIMER(_tmr_no, _irq)			\
 
- 	.name		= "s3c24xx-pwm",		\
 
- 	.id		= _tmr_no,			\
 
- 	.num_resources	= TIMER_RESOURCE_SIZE,		\
 
- 	.resource	= TIMER_RESOURCE(_tmr_no, _irq),	\
 
- /*
 
-  * since we already have an static mapping for the timer,
 
-  * we do not bother setting any IO resource for the base.
 
-  */
 
- struct platform_device s3c_device_timer[] = {
 
- 	[0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
 
- 	[1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
 
- 	[2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
 
- 	[3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
 
- 	[4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
 
- };
 
- #endif /* CONFIG_SAMSUNG_DEV_PWM */
 
- /* RTC */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_rtc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_RTC, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_RTC),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_TICK),
 
- };
 
- struct platform_device s3c_device_rtc = {
 
- 	.name		= "s3c2410-rtc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_rtc_resource),
 
- 	.resource	= s3c_rtc_resource,
 
- };
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- #ifdef CONFIG_S3C_DEV_RTC
 
- static struct resource s3c_rtc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_RTC, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM),
 
- 	[2] = DEFINE_RES_IRQ(IRQ_RTC_TIC),
 
- };
 
- struct platform_device s3c_device_rtc = {
 
- 	.name		= "s3c64xx-rtc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_rtc_resource),
 
- 	.resource	= s3c_rtc_resource,
 
- };
 
- #endif /* CONFIG_S3C_DEV_RTC */
 
- /* SDI */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_sdi_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_SDI, S3C24XX_SZ_SDI),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_SDI),
 
- };
 
- struct platform_device s3c_device_sdi = {
 
- 	.name		= "s3c2410-sdi",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_sdi_resource),
 
- 	.resource	= s3c_sdi_resource,
 
- };
 
- void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 
- {
 
- 	s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
 
- 			 &s3c_device_sdi);
 
- }
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* SPI */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_spi0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_SPI, SZ_32),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_SPI0),
 
- };
 
- struct platform_device s3c_device_spi0 = {
 
- 	.name		= "s3c2410-spi",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c_spi0_resource),
 
- 	.resource	= s3c_spi0_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- static struct resource s3c_spi1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1, SZ_32),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_SPI1),
 
- };
 
- struct platform_device s3c_device_spi1 = {
 
- 	.name		= "s3c2410-spi",
 
- 	.id		= 1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_spi1_resource),
 
- 	.resource	= s3c_spi1_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* Touchscreen */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_ts_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_TC),
 
- };
 
- struct platform_device s3c_device_ts = {
 
- 	.name		= "s3c2410-ts",
 
- 	.id		= -1,
 
- 	.dev.parent	= &s3c_device_adc.dev,
 
- 	.num_resources	= ARRAY_SIZE(s3c_ts_resource),
 
- 	.resource	= s3c_ts_resource,
 
- };
 
- void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
 
- {
 
- 	s3c_set_platdata(hard_s3c2410ts_info,
 
- 			 sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);
 
- }
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- #ifdef CONFIG_SAMSUNG_DEV_TS
 
- static struct resource s3c_ts_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_TC),
 
- };
 
- static struct s3c2410_ts_mach_info default_ts_data __initdata = {
 
- 	.delay			= 10000,
 
- 	.presc			= 49,
 
- 	.oversampling_shift	= 2,
 
- };
 
- struct platform_device s3c_device_ts = {
 
- 	.name		= "s3c64xx-ts",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_ts_resource),
 
- 	.resource	= s3c_ts_resource,
 
- };
 
- void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
 
- {
 
- 	if (!pd)
 
- 		pd = &default_ts_data;
 
- 	s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
 
- 			 &s3c_device_ts);
 
- }
 
- #endif /* CONFIG_SAMSUNG_DEV_TS */
 
- /* TV */
 
- #ifdef CONFIG_S5P_DEV_TV
 
- static struct resource s5p_hdmi_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_HDMI, SZ_1M),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_HDMI),
 
- };
 
- struct platform_device s5p_device_hdmi = {
 
- 	.name		= "s5p-hdmi",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_hdmi_resources),
 
- 	.resource	= s5p_hdmi_resources,
 
- };
 
- static struct resource s5p_sdo_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_SDO, SZ_64K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_SDO),
 
- };
 
- struct platform_device s5p_device_sdo = {
 
- 	.name		= "s5p-sdo",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_sdo_resources),
 
- 	.resource	= s5p_sdo_resources,
 
- };
 
- static struct resource s5p_mixer_resources[] = {
 
- 	[0] = DEFINE_RES_MEM_NAMED(S5P_PA_MIXER, SZ_64K, "mxr"),
 
- 	[1] = DEFINE_RES_MEM_NAMED(S5P_PA_VP, SZ_64K, "vp"),
 
- 	[2] = DEFINE_RES_IRQ_NAMED(IRQ_MIXER, "irq"),
 
- };
 
- struct platform_device s5p_device_mixer = {
 
- 	.name		= "s5p-mixer",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_mixer_resources),
 
- 	.resource	= s5p_mixer_resources,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- #endif /* CONFIG_S5P_DEV_TV */
 
- /* USB */
 
- #ifdef CONFIG_S3C_DEV_USB_HOST
 
- static struct resource s3c_usb_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_USBHOST, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_USBH),
 
- };
 
- struct platform_device s3c_device_ohci = {
 
- 	.name		= "s3c2410-ohci",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_usb_resource),
 
- 	.resource	= s3c_usb_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- /*
 
-  * s3c_ohci_set_platdata - initialise OHCI device platform data
 
-  * @info: The platform data.
 
-  *
 
-  * This call copies the @info passed in and sets the device .platform_data
 
-  * field to that copy. The @info is copied so that the original can be marked
 
-  * __initdata.
 
-  */
 
- void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
 
- {
 
- 	s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
 
- 			 &s3c_device_ohci);
 
- }
 
- #endif /* CONFIG_S3C_DEV_USB_HOST */
 
- /* USB Device (Gadget) */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_usbgadget_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV, S3C24XX_SZ_USBDEV),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_USBD),
 
- };
 
- struct platform_device s3c_device_usbgadget = {
 
- 	.name		= "s3c2410-usbgadget",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_usbgadget_resource),
 
- 	.resource	= s3c_usbgadget_resource,
 
- };
 
- void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
 
- {
 
- 	s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
 
- }
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* USB EHCI Host Controller */
 
- #ifdef CONFIG_S5P_DEV_USB_EHCI
 
- static struct resource s5p_ehci_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S5P_PA_EHCI, SZ_256),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_USB_HOST),
 
- };
 
- struct platform_device s5p_device_ehci = {
 
- 	.name		= "s5p-ehci",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s5p_ehci_resource),
 
- 	.resource	= s5p_ehci_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	}
 
- };
 
- void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
 
- {
 
- 	struct s5p_ehci_platdata *npd;
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
 
- 			&s5p_device_ehci);
 
- 	if (!npd->phy_init)
 
- 		npd->phy_init = s5p_usb_phy_init;
 
- 	if (!npd->phy_exit)
 
- 		npd->phy_exit = s5p_usb_phy_exit;
 
- }
 
- #endif /* CONFIG_S5P_DEV_USB_EHCI */
 
- /* USB HSOTG */
 
- #ifdef CONFIG_S3C_DEV_USB_HSOTG
 
- static struct resource s3c_usb_hsotg_resources[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG, SZ_128K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_OTG),
 
- };
 
- struct platform_device s3c_device_usb_hsotg = {
 
- 	.name		= "s3c-hsotg",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_usb_hsotg_resources),
 
- 	.resource	= s3c_usb_hsotg_resources,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- void __init s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd)
 
- {
 
- 	struct s3c_hsotg_plat *npd;
 
- 	npd = s3c_set_platdata(pd, sizeof(struct s3c_hsotg_plat),
 
- 			&s3c_device_usb_hsotg);
 
- 	if (!npd->phy_init)
 
- 		npd->phy_init = s5p_usb_phy_init;
 
- 	if (!npd->phy_exit)
 
- 		npd->phy_exit = s5p_usb_phy_exit;
 
- }
 
- #endif /* CONFIG_S3C_DEV_USB_HSOTG */
 
- /* USB High Spped 2.0 Device (Gadget) */
 
- #ifdef CONFIG_PLAT_S3C24XX
 
- static struct resource s3c_hsudc_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC, S3C2416_SZ_HSUDC),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_USBD),
 
- };
 
- struct platform_device s3c_device_usb_hsudc = {
 
- 	.name		= "s3c-hsudc",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_hsudc_resource),
 
- 	.resource	= s3c_hsudc_resource,
 
- 	.dev		= {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
 
- {
 
- 	s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
 
- }
 
- #endif /* CONFIG_PLAT_S3C24XX */
 
- /* WDT */
 
- #ifdef CONFIG_S3C_DEV_WDT
 
- static struct resource s3c_wdt_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
 
- 	[1] = DEFINE_RES_IRQ(IRQ_WDT),
 
- };
 
- struct platform_device s3c_device_wdt = {
 
- 	.name		= "s3c2410-wdt",
 
- 	.id		= -1,
 
- 	.num_resources	= ARRAY_SIZE(s3c_wdt_resource),
 
- 	.resource	= s3c_wdt_resource,
 
- };
 
- #endif /* CONFIG_S3C_DEV_WDT */
 
- #ifdef CONFIG_S3C64XX_DEV_SPI0
 
- static struct resource s3c64xx_spi0_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_SPI0, SZ_256),
 
- 	[1] = DEFINE_RES_DMA(DMACH_SPI0_TX),
 
- 	[2] = DEFINE_RES_DMA(DMACH_SPI0_RX),
 
- 	[3] = DEFINE_RES_IRQ(IRQ_SPI0),
 
- };
 
- struct platform_device s3c64xx_device_spi0 = {
 
- 	.name		= "s3c6410-spi",
 
- 	.id		= 0,
 
- 	.num_resources	= ARRAY_SIZE(s3c64xx_spi0_resource),
 
- 	.resource	= s3c64xx_spi0_resource,
 
- 	.dev = {
 
- 		.dma_mask		= &samsung_device_dma_mask,
 
- 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 
- 	},
 
- };
 
- void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
 
- 						int num_cs)
 
- {
 
- 	struct s3c64xx_spi_info pd;
 
- 	/* Reject invalid configuration */
 
- 	if (!num_cs || src_clk_nr < 0) {
 
- 		pr_err("%s: Invalid SPI configuration\n", __func__);
 
- 		return;
 
- 	}
 
- 	pd.num_cs = num_cs;
 
- 	pd.src_clk_nr = src_clk_nr;
 
- 	pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
 
- 	s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
 
- }
 
- #endif /* CONFIG_S3C64XX_DEV_SPI0 */
 
- #ifdef CONFIG_S3C64XX_DEV_SPI1
 
- static struct resource s3c64xx_spi1_resource[] = {
 
- 	[0] = DEFINE_RES_MEM(S3C_PA_SPI1, SZ_256),
 
- 	[1] = DEFINE_RES_DMA(DMACH_SPI1_TX),
 
 
  |