aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-05 21:18:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-05 21:18:05 -0400
commit7abec10c623d9e0416dab6919a0ea22e6283516b (patch)
tree83aa79c369e99c4fc60eea91ebd399b7689b312e /arch/arm
parent0de9adf284ec20454ecf37ffd98e7e98ba7292d6 (diff)
parentcfaf8fc5b59527281e9ddc2e0e04e1127936e17f (diff)
Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc
* 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc: (79 commits) ARM: SAMSUNG: Move fimc plat. device from board files to plat-samsung ARM: SAMSUNG: Cleanup resources by using macro ARM: SAMSUNG: Cleanup plat-samsung/devs.c and devs.h ARM: S5P: To merge devs.c files to one devs.c ARM: S3C64XX: To merge devs.c files to one devs.c ARM: S3C24XX: To merge s3c24xx devs.c files to one devs.c ARM: S5P64X0: Add Power Management support ARM: S5P: Make the sleep code common for S5P series SoCs ARM: S5P: Make the common S5P PM code conditionally compile ARM: SAMSUNG: Move S5P header files to plat-samsung ARM: SAMSUNG: Move S3C24XX header files to plat-samsung ARM: SAMSUNG: Moving each SoC support header files ARM: SAMSUNG: Consolidate plat/pll.h ARM: SAMSUNG: Consolidate plat/pwm-clock.h ARM: SAMSUNG: Cleanup mach/clkdev.h ARM: SAMSUNG: remove sdhci default configuration setup platform helper ARM: EXYNOS4: Add FIMC device on SMDKV310 board ARM: EXYNOS4: Add header file protection macros ARM: EXYNOS4: Add usb ehci device to the SMDKV310 ARM: S3C2443: Add hsspi-clock from pclk and rename S3C2443 hsspi sclk ... Fix up conflicts in - arch/arm/mach-exynos4/{Kconfig,clock.c} ARM_CPU_SUSPEND, various random device tables (gah!) - drivers/gpio/Makefile sa1100 gpio added, samsung gpio drivers merged
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig5
-rw-r--r--arch/arm/mach-exynos4/Kconfig38
-rw-r--r--arch/arm/mach-exynos4/Makefile2
-rw-r--r--arch/arm/mach-exynos4/clock.c204
-rw-r--r--arch/arm/mach-exynos4/cpu.c2
-rw-r--r--arch/arm/mach-exynos4/dma.c1
-rw-r--r--arch/arm/mach-exynos4/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-exynos4/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-exynos4/include/mach/map.h12
-rw-r--r--arch/arm/mach-exynos4/include/mach/pm-core.h8
-rw-r--r--arch/arm/mach-exynos4/include/mach/pmu.h7
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-pmu.h74
-rw-r--r--arch/arm/mach-exynos4/mach-nuri.c34
-rw-r--r--arch/arm/mach-exynos4/mach-origen.c577
-rw-r--r--arch/arm/mach-exynos4/mach-smdkv310.c49
-rw-r--r--arch/arm/mach-exynos4/mach-universal_c210.c307
-rw-r--r--arch/arm/mach-exynos4/pm.c7
-rw-r--r--arch/arm/mach-exynos4/pmu.c353
-rw-r--r--arch/arm/mach-exynos4/setup-sdhci.c47
-rw-r--r--arch/arm/mach-s3c2410/Kconfig1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/fb.h75
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-fns.h99
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-track.h6
-rw-r--r--arch/arm/mach-s3c2410/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/map.h1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/pm-core.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h1
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c1
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c4
-rw-r--r--arch/arm/mach-s3c2412/gpio.c62
-rw-r--r--arch/arm/mach-s3c2416/Kconfig1
-rw-r--r--arch/arm/mach-s3c2416/clock.c29
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c4
-rw-r--r--arch/arm/mach-s3c2416/setup-sdhci.c37
-rw-r--r--arch/arm/mach-s3c2440/Kconfig2
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c1
-rw-r--r--arch/arm/mach-s3c2440/s3c2440.c4
-rw-r--r--arch/arm/mach-s3c2440/s3c2442.c4
-rw-r--r--arch/arm/mach-s3c2443/Kconfig1
-rw-r--r--arch/arm/mach-s3c2443/clock.c55
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c4
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c64xx/Makefile5
-rw-r--r--arch/arm/mach-s3c64xx/clock.c13
-rw-r--r--arch/arm/mach-s3c64xx/cpu.c4
-rw-r--r--arch/arm/mach-s3c64xx/dev-onenand1.c53
-rw-r--r--arch/arm/mach-s3c64xx/dma.c2
-rw-r--r--arch/arm/mach-s3c64xx/gpiolib.c290
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/crag6410.h23
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pll.h45
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pm-core.h2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pwm-clock.h56
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-sys.h3
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c182
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c108
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/pm.c4
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c2
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c4
-rw-r--r--arch/arm/mach-s3c64xx/setup-sdhci.c48
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig14
-rw-r--r--arch/arm/mach-s5p64x0/Makefile4
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6440.c1
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6450.c1
-rw-r--r--arch/arm/mach-s5p64x0/cpu.c3
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/map.h4
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/pm-core.h117
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/pwm-clock.h68
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/regs-clock.h33
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/regs-gpio.h21
-rw-r--r--arch/arm/mach-s5p64x0/irq-eint.c2
-rw-r--r--arch/arm/mach-s5p64x0/irq-pm.c92
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c74
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c75
-rw-r--r--arch/arm/mach-s5p64x0/pm.c204
-rw-r--r--arch/arm/mach-s5p64x0/setup-fb-24bpp.c29
-rw-r--r--arch/arm/mach-s5pc100/clock.c4
-rw-r--r--arch/arm/mach-s5pc100/dma.c1
-rw-r--r--arch/arm/mach-s5pc100/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-s5pc100/include/mach/pwm-clock.h56
-rw-r--r--arch/arm/mach-s5pc100/setup-sdhci.c42
-rw-r--r--arch/arm/mach-s5pv210/Kconfig4
-rw-r--r--arch/arm/mach-s5pv210/Makefile2
-rw-r--r--arch/arm/mach-s5pv210/clock.c141
-rw-r--r--arch/arm/mach-s5pv210/cpu.c4
-rw-r--r--arch/arm/mach-s5pv210/dma.c1
-rw-r--r--arch/arm/mach-s5pv210/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-s5pv210/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h13
-rw-r--r--arch/arm/mach-s5pv210/include/mach/pm-core.h2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/pwm-clock.h70
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-clock.h3
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c57
-rw-r--r--arch/arm/mach-s5pv210/setup-sdhci.c41
-rw-r--r--arch/arm/mach-s5pv210/sleep.S52
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig1
-rw-r--r--arch/arm/plat-s3c24xx/Makefile4
-rw-r--r--arch/arm/plat-s3c24xx/dev-uart.c100
-rw-r--r--arch/arm/plat-s3c24xx/devs.c528
-rw-r--r--arch/arm/plat-s3c24xx/gpio.c96
-rw-r--r--arch/arm/plat-s3c24xx/gpiolib.c229
-rw-r--r--arch/arm/plat-s3c24xx/include/mach/clkdev.h7
-rw-r--r--arch/arm/plat-s3c24xx/include/mach/pwm-clock.h55
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/pll.h62
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-iis.h68
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-spi.h81
-rw-r--r--arch/arm/plat-s3c24xx/s3c2443-clock.c57
-rw-r--r--arch/arm/plat-s5p/Kconfig25
-rw-r--r--arch/arm/plat-s5p/Makefile14
-rw-r--r--arch/arm/plat-s5p/dev-csis0.c34
-rw-r--r--arch/arm/plat-s5p/dev-csis1.c34
-rw-r--r--arch/arm/plat-s5p/dev-ehci.c57
-rw-r--r--arch/arm/plat-s5p/dev-fimc0.c43
-rw-r--r--arch/arm/plat-s5p/dev-fimc1.c43
-rw-r--r--arch/arm/plat-s5p/dev-fimc2.c43
-rw-r--r--arch/arm/plat-s5p/dev-fimc3.c43
-rw-r--r--arch/arm/plat-s5p/dev-fimd0.c67
-rw-r--r--arch/arm/plat-s5p/dev-mfc.c50
-rw-r--r--arch/arm/plat-s5p/dev-onenand.c45
-rw-r--r--arch/arm/plat-s5p/dev-pmu.c36
-rw-r--r--arch/arm/plat-s5p/irq-gpioint.c10
-rw-r--r--arch/arm/plat-s5p/sleep.S (renamed from arch/arm/mach-exynos4/sleep.S)13
-rw-r--r--arch/arm/plat-samsung/Kconfig27
-rw-r--r--arch/arm/plat-samsung/Makefile33
-rw-r--r--arch/arm/plat-samsung/dev-adc.c46
-rw-r--r--arch/arm/plat-samsung/dev-asocdma.c35
-rw-r--r--arch/arm/plat-samsung/dev-fb.c63
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c62
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c62
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c63
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc3.c66
-rw-r--r--arch/arm/plat-samsung/dev-hwmon.c32
-rw-r--r--arch/arm/plat-samsung/dev-i2c0.c70
-rw-r--r--arch/arm/plat-samsung/dev-i2c1.c61
-rw-r--r--arch/arm/plat-samsung/dev-i2c2.c62
-rw-r--r--arch/arm/plat-samsung/dev-i2c3.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c4.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c5.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c6.c60
-rw-r--r--arch/arm/plat-samsung/dev-i2c7.c60
-rw-r--r--arch/arm/plat-samsung/dev-ide.c44
-rw-r--r--arch/arm/plat-samsung/dev-keypad.c50
-rw-r--r--arch/arm/plat-samsung/dev-nand.c125
-rw-r--r--arch/arm/plat-samsung/dev-onenand.c43
-rw-r--r--arch/arm/plat-samsung/dev-pwm.c53
-rw-r--r--arch/arm/plat-samsung/dev-rtc.c43
-rw-r--r--arch/arm/plat-samsung/dev-ts.c59
-rw-r--r--arch/arm/plat-samsung/dev-usb-hsotg.c48
-rw-r--r--arch/arm/plat-samsung/dev-usb.c65
-rw-r--r--arch/arm/plat-samsung/dev-wdt.c40
-rw-r--r--arch/arm/plat-samsung/devs.c1463
-rw-r--r--arch/arm/plat-samsung/gpio-config.c431
-rw-r--r--arch/arm/plat-samsung/gpio.c167
-rw-r--r--arch/arm/plat-samsung/include/plat/audio-simtec.h (renamed from arch/arm/plat-s3c24xx/include/plat/audio-simtec.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/camport.h (renamed from arch/arm/plat-s5p/include/plat/camport.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/common-smdk.h (renamed from arch/arm/plat-s3c24xx/include/plat/common-smdk.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu-freq-core.h (renamed from arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h)5
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h151
-rw-r--r--arch/arm/plat-samsung/include/plat/ehci.h (renamed from arch/arm/plat-s5p/include/plat/ehci.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/exynos4.h (renamed from arch/arm/plat-s5p/include/plat/exynos4.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/fb-s3c2410.h72
-rw-r--r--arch/arm/plat-samsung/include/plat/fb.h7
-rw-r--r--arch/arm/plat-samsung/include/plat/fiq.h (renamed from arch/arm/plat-s3c24xx/include/plat/fiq.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h172
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg.h34
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h97
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-fns.h98
-rw-r--r--arch/arm/plat-samsung/include/plat/iic.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/irq.h (renamed from arch/arm/plat-s3c24xx/include/plat/irq.h)25
-rw-r--r--arch/arm/plat-samsung/include/plat/irqs.h (renamed from arch/arm/plat-s5p/include/plat/irqs.h)8
-rw-r--r--arch/arm/plat-samsung/include/plat/mci.h (renamed from arch/arm/plat-s3c24xx/include/plat/mci.h)10
-rw-r--r--arch/arm/plat-samsung/include/plat/mfc.h (renamed from arch/arm/plat-s5p/include/plat/mfc.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/mipi_csis.h (renamed from arch/arm/plat-s5p/include/plat/mipi_csis.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/pll.h (renamed from arch/arm/plat-s5p/include/plat/pll.h)134
-rw-r--r--arch/arm/plat-samsung/include/plat/pll6553x.h51
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h10
-rw-r--r--arch/arm/plat-samsung/include/plat/pwm-clock.h (renamed from arch/arm/mach-exynos4/include/mach/pwm-clock.h)39
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-dma.h (renamed from arch/arm/plat-s3c24xx/include/plat/regs-dma.h)112
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-iis.h70
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-spi.h48
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-srom.h (renamed from arch/arm/plat-s5p/include/plat/regs-srom.h)8
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-udc.h (renamed from arch/arm/plat-s3c24xx/include/plat/regs-udc.h)132
-rw-r--r--arch/arm/plat-samsung/include/plat/reset.h (renamed from arch/arm/plat-s5p/include/plat/reset.h)8
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2410.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c2410.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2412.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c2412.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2416.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c2416.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2443.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c2443.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c244x.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c244x.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c6400.h (renamed from arch/arm/mach-s3c64xx/include/mach/s3c6400.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c6410.h (renamed from arch/arm/mach-s3c64xx/include/mach/s3c6410.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p-clock.h (renamed from arch/arm/plat-s5p/include/plat/s5p-clock.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p-time.h (renamed from arch/arm/plat-s5p/include/plat/s5p-time.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p6440.h (renamed from arch/arm/plat-s5p/include/plat/s5p6440.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p6450.h (renamed from arch/arm/plat-s5p/include/plat/s5p6450.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5pc100.h (renamed from arch/arm/plat-s5p/include/plat/s5pc100.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5pv210.h (renamed from arch/arm/plat-s5p/include/plat/s5pv210.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h57
-rw-r--r--arch/arm/plat-samsung/include/plat/sysmmu.h (renamed from arch/arm/plat-s5p/include/plat/sysmmu.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/system-reset.h (renamed from arch/arm/plat-s5p/include/plat/system-reset.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/tv-core.h44
-rw-r--r--arch/arm/plat-samsung/include/plat/udc.h (renamed from arch/arm/plat-s3c24xx/include/plat/udc.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/usb-phy.h (renamed from arch/arm/plat-s5p/include/plat/usb-phy.h)6
-rw-r--r--arch/arm/plat-samsung/platformdata.c2
-rw-r--r--arch/arm/plat-samsung/pm-gpio.c72
-rw-r--r--arch/arm/plat-samsung/pm.c6
-rw-r--r--arch/arm/plat-samsung/pwm-clock.c13
218 files changed, 5335 insertions, 5961 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fe6b0526b3a6..e17fe2503bba 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -777,9 +777,6 @@ config ARCH_S3C64XX
777 select SAMSUNG_CLKSRC 777 select SAMSUNG_CLKSRC
778 select SAMSUNG_IRQ_VIC_TIMER 778 select SAMSUNG_IRQ_VIC_TIMER
779 select S3C_GPIO_TRACK 779 select S3C_GPIO_TRACK
780 select S3C_GPIO_PULL_UPDOWN
781 select S3C_GPIO_CFG_S3C24XX
782 select S3C_GPIO_CFG_S3C64XX
783 select S3C_DEV_NAND 780 select S3C_DEV_NAND
784 select USB_ARCH_HAS_OHCI 781 select USB_ARCH_HAS_OHCI
785 select SAMSUNG_GPIOLIB_4BIT 782 select SAMSUNG_GPIOLIB_4BIT
@@ -2212,7 +2209,7 @@ menu "Power management options"
2212source "kernel/power/Kconfig" 2209source "kernel/power/Kconfig"
2213 2210
2214config ARCH_SUSPEND_POSSIBLE 2211config ARCH_SUSPEND_POSSIBLE
2215 depends on !ARCH_S5P64X0 && !ARCH_S5PC100 2212 depends on !ARCH_S5PC100
2216 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2213 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
2217 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE 2214 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
2218 def_bool y 2215 def_bool y
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index 44013e0672fe..59299ea5b2ff 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -13,11 +13,16 @@ config CPU_EXYNOS4210
13 bool 13 bool
14 select SAMSUNG_DMADEV 14 select SAMSUNG_DMADEV
15 select ARM_CPU_SUSPEND if PM 15 select ARM_CPU_SUSPEND if PM
16 select S5P_PM if PM
17 select S5P_SLEEP if PM
16 help 18 help
17 Enable EXYNOS4210 CPU support 19 Enable EXYNOS4210 CPU support
18 20
19config SOC_EXYNOS4212 21config SOC_EXYNOS4212
20 bool 22 bool
23 select ARM_CPU_SUSPEND if PM
24 select S5P_PM if PM
25 select S5P_SLEEP if PM
21 help 26 help
22 Enable EXYNOS4212 SoC support 27 Enable EXYNOS4212 SoC support
23 28
@@ -137,6 +142,14 @@ config MACH_SMDKV310
137 select S3C_DEV_RTC 142 select S3C_DEV_RTC
138 select S3C_DEV_WDT 143 select S3C_DEV_WDT
139 select S3C_DEV_I2C1 144 select S3C_DEV_I2C1
145 select S5P_DEV_FIMC0
146 select S5P_DEV_FIMC1
147 select S5P_DEV_FIMC2
148 select S5P_DEV_FIMC3
149 select S5P_DEV_I2C_HDMIPHY
150 select S5P_DEV_MFC
151 select S5P_DEV_TV
152 select S5P_DEV_USB_EHCI
140 select S3C_DEV_HSMMC 153 select S3C_DEV_HSMMC
141 select S3C_DEV_HSMMC1 154 select S3C_DEV_HSMMC1
142 select S3C_DEV_HSMMC2 155 select S3C_DEV_HSMMC2
@@ -151,6 +164,7 @@ config MACH_SMDKV310
151 select EXYNOS4_SETUP_I2C1 164 select EXYNOS4_SETUP_I2C1
152 select EXYNOS4_SETUP_KEYPAD 165 select EXYNOS4_SETUP_KEYPAD
153 select EXYNOS4_SETUP_SDHCI 166 select EXYNOS4_SETUP_SDHCI
167 select EXYNOS4_SETUP_USB_PHY
154 help 168 help
155 Machine support for Samsung SMDKV310 169 Machine support for Samsung SMDKV310
156 170
@@ -176,19 +190,26 @@ config MACH_UNIVERSAL_C210
176 select S5P_DEV_FIMC1 190 select S5P_DEV_FIMC1
177 select S5P_DEV_FIMC2 191 select S5P_DEV_FIMC2
178 select S5P_DEV_FIMC3 192 select S5P_DEV_FIMC3
193 select S5P_DEV_CSIS0
194 select S5P_DEV_FIMD0
179 select S3C_DEV_HSMMC 195 select S3C_DEV_HSMMC
180 select S3C_DEV_HSMMC2 196 select S3C_DEV_HSMMC2
181 select S3C_DEV_HSMMC3 197 select S3C_DEV_HSMMC3
182 select S3C_DEV_I2C1 198 select S3C_DEV_I2C1
183 select S3C_DEV_I2C3 199 select S3C_DEV_I2C3
184 select S3C_DEV_I2C5 200 select S3C_DEV_I2C5
201 select S5P_DEV_I2C_HDMIPHY
185 select S5P_DEV_MFC 202 select S5P_DEV_MFC
186 select S5P_DEV_ONENAND 203 select S5P_DEV_ONENAND
204 select S5P_DEV_TV
187 select EXYNOS4_DEV_PD 205 select EXYNOS4_DEV_PD
206 select EXYNOS4_SETUP_FIMD0
188 select EXYNOS4_SETUP_I2C1 207 select EXYNOS4_SETUP_I2C1
189 select EXYNOS4_SETUP_I2C3 208 select EXYNOS4_SETUP_I2C3
190 select EXYNOS4_SETUP_I2C5 209 select EXYNOS4_SETUP_I2C5
191 select EXYNOS4_SETUP_SDHCI 210 select EXYNOS4_SETUP_SDHCI
211 select EXYNOS4_SETUP_FIMC
212 select S5P_SETUP_MIPIPHY
192 help 213 help
193 Machine support for Samsung Mobile Universal S5PC210 Reference 214 Machine support for Samsung Mobile Universal S5PC210 Reference
194 Board. 215 Board.
@@ -197,6 +218,8 @@ config MACH_NURI
197 bool "Mobile NURI Board" 218 bool "Mobile NURI Board"
198 select CPU_EXYNOS4210 219 select CPU_EXYNOS4210
199 select S3C_DEV_WDT 220 select S3C_DEV_WDT
221 select S3C_DEV_RTC
222 select S5P_DEV_FIMD0
200 select S3C_DEV_HSMMC 223 select S3C_DEV_HSMMC
201 select S3C_DEV_HSMMC2 224 select S3C_DEV_HSMMC2
202 select S3C_DEV_HSMMC3 225 select S3C_DEV_HSMMC3
@@ -206,6 +229,7 @@ config MACH_NURI
206 select S5P_DEV_MFC 229 select S5P_DEV_MFC
207 select S5P_DEV_USB_EHCI 230 select S5P_DEV_USB_EHCI
208 select EXYNOS4_DEV_PD 231 select EXYNOS4_DEV_PD
232 select EXYNOS4_SETUP_FIMD0
209 select EXYNOS4_SETUP_I2C1 233 select EXYNOS4_SETUP_I2C1
210 select EXYNOS4_SETUP_I2C3 234 select EXYNOS4_SETUP_I2C3
211 select EXYNOS4_SETUP_I2C5 235 select EXYNOS4_SETUP_I2C5
@@ -221,8 +245,22 @@ config MACH_ORIGEN
221 select CPU_EXYNOS4210 245 select CPU_EXYNOS4210
222 select S3C_DEV_RTC 246 select S3C_DEV_RTC
223 select S3C_DEV_WDT 247 select S3C_DEV_WDT
248 select S3C_DEV_HSMMC
224 select S3C_DEV_HSMMC2 249 select S3C_DEV_HSMMC2
250 select S5P_DEV_FIMC0
251 select S5P_DEV_FIMC1
252 select S5P_DEV_FIMC2
253 select S5P_DEV_FIMC3
254 select S5P_DEV_FIMD0
255 select S5P_DEV_I2C_HDMIPHY
256 select S5P_DEV_TV
257 select S5P_DEV_USB_EHCI
258 select EXYNOS4_DEV_PD
259 select SAMSUNG_DEV_BACKLIGHT
260 select SAMSUNG_DEV_PWM
261 select EXYNOS4_SETUP_FIMD0
225 select EXYNOS4_SETUP_SDHCI 262 select EXYNOS4_SETUP_SDHCI
263 select EXYNOS4_SETUP_USB_PHY
226 help 264 help
227 Machine support for ORIGEN based on Samsung EXYNOS4210 265 Machine support for ORIGEN based on Samsung EXYNOS4210
228 266
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index c9b2e1f97e44..2bb18f431db9 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_ARCH_EXYNOS4) += cpu.o init.o clock.o irq-combiner.o
16obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o irq-eint.o dma.o pmu.o 16obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o irq-eint.o dma.o pmu.o
17obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o 17obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o
18obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o 18obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o
19obj-$(CONFIG_PM) += pm.o sleep.o 19obj-$(CONFIG_PM) += pm.o
20obj-$(CONFIG_CPU_IDLE) += cpuidle.o 20obj-$(CONFIG_CPU_IDLE) += cpuidle.o
21 21
22obj-$(CONFIG_SMP) += platsmp.o headsmp.o 22obj-$(CONFIG_SMP) += platsmp.o headsmp.o
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index a52024e309b0..2894f0adef5c 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -151,6 +151,11 @@ static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable)
151 return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable); 151 return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable);
152} 152}
153 153
154static int exynos4_clksrc_mask_tv_ctrl(struct clk *clk, int enable)
155{
156 return s5p_gatectrl(S5P_CLKSRC_MASK_TV, clk, enable);
157}
158
154static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable) 159static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable)
155{ 160{
156 return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable); 161 return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable);
@@ -191,6 +196,16 @@ static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)
191 return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable); 196 return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable);
192} 197}
193 198
199static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
200{
201 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
202}
203
204static int exynos4_clk_dac_ctrl(struct clk *clk, int enable)
205{
206 return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
207}
208
194/* Core list of CMU_CPU side */ 209/* Core list of CMU_CPU side */
195 210
196static struct clksrc_clk clk_mout_apll = { 211static struct clksrc_clk clk_mout_apll = {
@@ -508,13 +523,43 @@ static struct clk init_clocks_off[] = {
508 .enable = exynos4_clk_ip_fsys_ctrl, 523 .enable = exynos4_clk_ip_fsys_ctrl,
509 .ctrlbit = (1 << 9), 524 .ctrlbit = (1 << 9),
510 }, { 525 }, {
526 .name = "dac",
527 .devname = "s5p-sdo",
528 .enable = exynos4_clk_ip_tv_ctrl,
529 .ctrlbit = (1 << 2),
530 }, {
531 .name = "mixer",
532 .devname = "s5p-mixer",
533 .enable = exynos4_clk_ip_tv_ctrl,
534 .ctrlbit = (1 << 1),
535 }, {
536 .name = "vp",
537 .devname = "s5p-mixer",
538 .enable = exynos4_clk_ip_tv_ctrl,
539 .ctrlbit = (1 << 0),
540 }, {
541 .name = "hdmi",
542 .devname = "exynos4-hdmi",
543 .enable = exynos4_clk_ip_tv_ctrl,
544 .ctrlbit = (1 << 3),
545 }, {
546 .name = "hdmiphy",
547 .devname = "exynos4-hdmi",
548 .enable = exynos4_clk_hdmiphy_ctrl,
549 .ctrlbit = (1 << 0),
550 }, {
551 .name = "dacphy",
552 .devname = "s5p-sdo",
553 .enable = exynos4_clk_dac_ctrl,
554 .ctrlbit = (1 << 0),
555 }, {
511 .name = "dma", 556 .name = "dma",
512 .devname = "s3c-pl330.0", 557 .devname = "dma-pl330.0",
513 .enable = exynos4_clk_ip_fsys_ctrl, 558 .enable = exynos4_clk_ip_fsys_ctrl,
514 .ctrlbit = (1 << 0), 559 .ctrlbit = (1 << 0),
515 }, { 560 }, {
516 .name = "dma", 561 .name = "dma",
517 .devname = "s3c-pl330.1", 562 .devname = "dma-pl330.1",
518 .enable = exynos4_clk_ip_fsys_ctrl, 563 .enable = exynos4_clk_ip_fsys_ctrl,
519 .ctrlbit = (1 << 1), 564 .ctrlbit = (1 << 1),
520 }, { 565 }, {
@@ -635,6 +680,12 @@ static struct clk init_clocks_off[] = {
635 .enable = exynos4_clk_ip_peril_ctrl, 680 .enable = exynos4_clk_ip_peril_ctrl,
636 .ctrlbit = (1 << 13), 681 .ctrlbit = (1 << 13),
637 }, { 682 }, {
683 .name = "i2c",
684 .devname = "s3c2440-hdmiphy-i2c",
685 .parent = &clk_aclk_100.clk,
686 .enable = exynos4_clk_ip_peril_ctrl,
687 .ctrlbit = (1 << 14),
688 }, {
638 .name = "SYSMMU_MDMA", 689 .name = "SYSMMU_MDMA",
639 .enable = exynos4_clk_ip_image_ctrl, 690 .enable = exynos4_clk_ip_image_ctrl,
640 .ctrlbit = (1 << 5), 691 .ctrlbit = (1 << 5),
@@ -836,6 +887,81 @@ static struct clksrc_sources clkset_mout_mfc = {
836 .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), 887 .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list),
837}; 888};
838 889
890static struct clk *clkset_sclk_dac_list[] = {
891 [0] = &clk_sclk_vpll.clk,
892 [1] = &clk_sclk_hdmiphy,
893};
894
895static struct clksrc_sources clkset_sclk_dac = {
896 .sources = clkset_sclk_dac_list,
897 .nr_sources = ARRAY_SIZE(clkset_sclk_dac_list),
898};
899
900static struct clksrc_clk clk_sclk_dac = {
901 .clk = {
902 .name = "sclk_dac",
903 .enable = exynos4_clksrc_mask_tv_ctrl,
904 .ctrlbit = (1 << 8),
905 },
906 .sources = &clkset_sclk_dac,
907 .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 8, .size = 1 },
908};
909
910static struct clksrc_clk clk_sclk_pixel = {
911 .clk = {
912 .name = "sclk_pixel",
913 .parent = &clk_sclk_vpll.clk,
914 },
915 .reg_div = { .reg = S5P_CLKDIV_TV, .shift = 0, .size = 4 },
916};
917
918static struct clk *clkset_sclk_hdmi_list[] = {
919 [0] = &clk_sclk_pixel.clk,
920 [1] = &clk_sclk_hdmiphy,
921};
922
923static struct clksrc_sources clkset_sclk_hdmi = {
924 .sources = clkset_sclk_hdmi_list,
925 .nr_sources = ARRAY_SIZE(clkset_sclk_hdmi_list),
926};
927
928static struct clksrc_clk clk_sclk_hdmi = {
929 .clk = {
930 .name = "sclk_hdmi",
931 .enable = exynos4_clksrc_mask_tv_ctrl,
932 .ctrlbit = (1 << 0),
933 },
934 .sources = &clkset_sclk_hdmi,
935 .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 0, .size = 1 },
936};
937
938static struct clk *clkset_sclk_mixer_list[] = {
939 [0] = &clk_sclk_dac.clk,
940 [1] = &clk_sclk_hdmi.clk,
941};
942
943static struct clksrc_sources clkset_sclk_mixer = {
944 .sources = clkset_sclk_mixer_list,
945 .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list),
946};
947
948static struct clksrc_clk clk_sclk_mixer = {
949 .clk = {
950 .name = "sclk_mixer",
951 .enable = exynos4_clksrc_mask_tv_ctrl,
952 .ctrlbit = (1 << 4),
953 },
954 .sources = &clkset_sclk_mixer,
955 .reg_src = { .reg = S5P_CLKSRC_TV, .shift = 4, .size = 1 },
956};
957
958static struct clksrc_clk *sclk_tv[] = {
959 &clk_sclk_dac,
960 &clk_sclk_pixel,
961 &clk_sclk_hdmi,
962 &clk_sclk_mixer,
963};
964
839static struct clksrc_clk clk_dout_mmc0 = { 965static struct clksrc_clk clk_dout_mmc0 = {
840 .clk = { 966 .clk = {
841 .name = "dout_mmc0", 967 .name = "dout_mmc0",
@@ -1162,6 +1288,71 @@ static struct clk_ops exynos4_fout_apll_ops = {
1162 .get_rate = exynos4_fout_apll_get_rate, 1288 .get_rate = exynos4_fout_apll_get_rate,
1163}; 1289};
1164 1290
1291static u32 vpll_div[][8] = {
1292 { 54000000, 3, 53, 3, 1024, 0, 17, 0 },
1293 { 108000000, 3, 53, 2, 1024, 0, 17, 0 },
1294};
1295
1296static unsigned long exynos4_vpll_get_rate(struct clk *clk)
1297{
1298 return clk->rate;
1299}
1300
1301static int exynos4_vpll_set_rate(struct clk *clk, unsigned long rate)
1302{
1303 unsigned int vpll_con0, vpll_con1 = 0;
1304 unsigned int i;
1305
1306 /* Return if nothing changed */
1307 if (clk->rate == rate)
1308 return 0;
1309
1310 vpll_con0 = __raw_readl(S5P_VPLL_CON0);
1311 vpll_con0 &= ~(0x1 << 27 | \
1312 PLL90XX_MDIV_MASK << PLL46XX_MDIV_SHIFT | \
1313 PLL90XX_PDIV_MASK << PLL46XX_PDIV_SHIFT | \
1314 PLL90XX_SDIV_MASK << PLL46XX_SDIV_SHIFT);
1315
1316 vpll_con1 = __raw_readl(S5P_VPLL_CON1);
1317 vpll_con1 &= ~(PLL46XX_MRR_MASK << PLL46XX_MRR_SHIFT | \
1318 PLL46XX_MFR_MASK << PLL46XX_MFR_SHIFT | \
1319 PLL4650C_KDIV_MASK << PLL46XX_KDIV_SHIFT);
1320
1321 for (i = 0; i < ARRAY_SIZE(vpll_div); i++) {
1322 if (vpll_div[i][0] == rate) {
1323 vpll_con0 |= vpll_div[i][1] << PLL46XX_PDIV_SHIFT;
1324 vpll_con0 |= vpll_div[i][2] << PLL46XX_MDIV_SHIFT;
1325 vpll_con0 |= vpll_div[i][3] << PLL46XX_SDIV_SHIFT;
1326 vpll_con1 |= vpll_div[i][4] << PLL46XX_KDIV_SHIFT;
1327 vpll_con1 |= vpll_div[i][5] << PLL46XX_MFR_SHIFT;
1328 vpll_con1 |= vpll_div[i][6] << PLL46XX_MRR_SHIFT;
1329 vpll_con0 |= vpll_div[i][7] << 27;
1330 break;
1331 }
1332 }
1333
1334 if (i == ARRAY_SIZE(vpll_div)) {
1335 printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n",
1336 __func__);
1337 return -EINVAL;
1338 }
1339
1340 __raw_writel(vpll_con0, S5P_VPLL_CON0);
1341 __raw_writel(vpll_con1, S5P_VPLL_CON1);
1342
1343 /* Wait for VPLL lock */
1344 while (!(__raw_readl(S5P_VPLL_CON0) & (1 << PLL46XX_LOCKED_SHIFT)))
1345 continue;
1346
1347 clk->rate = rate;
1348 return 0;
1349}
1350
1351static struct clk_ops exynos4_vpll_ops = {
1352 .get_rate = exynos4_vpll_get_rate,
1353 .set_rate = exynos4_vpll_set_rate,
1354};
1355
1165void __init_or_cpufreq exynos4_setup_clocks(void) 1356void __init_or_cpufreq exynos4_setup_clocks(void)
1166{ 1357{
1167 struct clk *xtal_clk; 1358 struct clk *xtal_clk;
@@ -1219,6 +1410,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void)
1219 clk_fout_apll.ops = &exynos4_fout_apll_ops; 1410 clk_fout_apll.ops = &exynos4_fout_apll_ops;
1220 clk_fout_mpll.rate = mpll; 1411 clk_fout_mpll.rate = mpll;
1221 clk_fout_epll.rate = epll; 1412 clk_fout_epll.rate = epll;
1413 clk_fout_vpll.ops = &exynos4_vpll_ops;
1222 clk_fout_vpll.rate = vpll; 1414 clk_fout_vpll.rate = vpll;
1223 1415
1224 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", 1416 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
@@ -1246,7 +1438,10 @@ void __init_or_cpufreq exynos4_setup_clocks(void)
1246} 1438}
1247 1439
1248static struct clk *clks[] __initdata = { 1440static struct clk *clks[] __initdata = {
1249 /* Nothing here yet */ 1441 &clk_sclk_hdmi27m,
1442 &clk_sclk_hdmiphy,
1443 &clk_sclk_usbphy0,
1444 &clk_sclk_usbphy1,
1250}; 1445};
1251 1446
1252#ifdef CONFIG_PM_SLEEP 1447#ifdef CONFIG_PM_SLEEP
@@ -1280,6 +1475,9 @@ void __init exynos4_register_clocks(void)
1280 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1475 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
1281 s3c_register_clksrc(sysclks[ptr], 1); 1476 s3c_register_clksrc(sysclks[ptr], 1);
1282 1477
1478 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++)
1479 s3c_register_clksrc(sclk_tv[ptr], 1);
1480
1283 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1481 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
1284 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1482 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
1285 1483
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index a348434f17b5..5b1765b37f75 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -28,6 +28,7 @@
28#include <plat/fimc-core.h> 28#include <plat/fimc-core.h>
29#include <plat/iic-core.h> 29#include <plat/iic-core.h>
30#include <plat/reset.h> 30#include <plat/reset.h>
31#include <plat/tv-core.h>
31 32
32#include <mach/regs-irq.h> 33#include <mach/regs-irq.h>
33#include <mach/regs-pmu.h> 34#include <mach/regs-pmu.h>
@@ -182,6 +183,7 @@ void __init exynos4_map_io(void)
182 s3c_i2c2_setname("s3c2440-i2c"); 183 s3c_i2c2_setname("s3c2440-i2c");
183 184
184 s5p_fb_setname(0, "exynos4-fb"); 185 s5p_fb_setname(0, "exynos4-fb");
186 s5p_hdmi_setname("exynos4-hdmi");
185} 187}
186 188
187void __init exynos4_init_clocks(int xtal) 189void __init exynos4_init_clocks(int xtal)
diff --git a/arch/arm/mach-exynos4/dma.c b/arch/arm/mach-exynos4/dma.c
index d57d66255021..9667c61e64fb 100644
--- a/arch/arm/mach-exynos4/dma.c
+++ b/arch/arm/mach-exynos4/dma.c
@@ -243,6 +243,7 @@ struct amba_device exynos4_device_pdma1 = {
243static int __init exynos4_dma_init(void) 243static int __init exynos4_dma_init(void)
244{ 244{
245 amba_device_register(&exynos4_device_pdma0, &iomem_resource); 245 amba_device_register(&exynos4_device_pdma0, &iomem_resource);
246 amba_device_register(&exynos4_device_pdma1, &iomem_resource);
246 247
247 return 0; 248 return 0;
248} 249}
diff --git a/arch/arm/mach-exynos4/include/mach/clkdev.h b/arch/arm/mach-exynos4/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/mach-exynos4/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h
index 2d3f6bcd9bc0..dfd4b7eecb90 100644
--- a/arch/arm/mach-exynos4/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -95,7 +95,11 @@
95#define IRQ_2D IRQ_SPI(89) 95#define IRQ_2D IRQ_SPI(89)
96#define IRQ_PCIE IRQ_SPI(90) 96#define IRQ_PCIE IRQ_SPI(90)
97 97
98#define IRQ_MIXER IRQ_SPI(91)
99#define IRQ_HDMI IRQ_SPI(92)
100#define IRQ_IIC_HDMIPHY IRQ_SPI(93)
98#define IRQ_MFC IRQ_SPI(94) 101#define IRQ_MFC IRQ_SPI(94)
102#define IRQ_SDO IRQ_SPI(95)
99 103
100#define IRQ_AUDIO_SS IRQ_SPI(96) 104#define IRQ_AUDIO_SS IRQ_SPI(96)
101#define IRQ_I2S0 IRQ_SPI(97) 105#define IRQ_I2S0 IRQ_SPI(97)
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h
index 9f97eb8499ee..918a979181af 100644
--- a/arch/arm/mach-exynos4/include/mach/map.h
+++ b/arch/arm/mach-exynos4/include/mach/map.h
@@ -112,6 +112,12 @@
112 112
113#define EXYNOS4_PA_UART 0x13800000 113#define EXYNOS4_PA_UART 0x13800000
114 114
115#define EXYNOS4_PA_VP 0x12C00000
116#define EXYNOS4_PA_MIXER 0x12C10000
117#define EXYNOS4_PA_SDO 0x12C20000
118#define EXYNOS4_PA_HDMI 0x12D00000
119#define EXYNOS4_PA_IIC_HDMIPHY 0x138E0000
120
115#define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) 121#define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000))
116 122
117#define EXYNOS4_PA_ADC 0x13910000 123#define EXYNOS4_PA_ADC 0x13910000
@@ -161,6 +167,12 @@
161#define S5P_PA_TIMER EXYNOS4_PA_TIMER 167#define S5P_PA_TIMER EXYNOS4_PA_TIMER
162#define S5P_PA_EHCI EXYNOS4_PA_EHCI 168#define S5P_PA_EHCI EXYNOS4_PA_EHCI
163 169
170#define S5P_PA_SDO EXYNOS4_PA_SDO
171#define S5P_PA_VP EXYNOS4_PA_VP
172#define S5P_PA_MIXER EXYNOS4_PA_MIXER
173#define S5P_PA_HDMI EXYNOS4_PA_HDMI
174#define S5P_PA_IIC_HDMIPHY EXYNOS4_PA_IIC_HDMIPHY
175
164#define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD 176#define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD
165 177
166/* UART */ 178/* UART */
diff --git a/arch/arm/mach-exynos4/include/mach/pm-core.h b/arch/arm/mach-exynos4/include/mach/pm-core.h
index 1df3b81f96e8..9d8da51e35ca 100644
--- a/arch/arm/mach-exynos4/include/mach/pm-core.h
+++ b/arch/arm/mach-exynos4/include/mach/pm-core.h
@@ -14,6 +14,10 @@
14 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation. 15 * published by the Free Software Foundation.
16*/ 16*/
17
18#ifndef __ASM_ARCH_PM_CORE_H
19#define __ASM_ARCH_PM_CORE_H __FILE__
20
17#include <mach/regs-pmu.h> 21#include <mach/regs-pmu.h>
18 22
19static inline void s3c_pm_debug_init_uart(void) 23static inline void s3c_pm_debug_init_uart(void)
@@ -53,7 +57,9 @@ static inline void s3c_pm_restored_gpios(void)
53 /* nothing here yet */ 57 /* nothing here yet */
54} 58}
55 59
56static inline void s3c_pm_saved_gpios(void) 60static inline void samsung_pm_saved_gpios(void)
57{ 61{
58 /* nothing here yet */ 62 /* nothing here yet */
59} 63}
64
65#endif /* __ASM_ARCH_PM_CORE_H */
diff --git a/arch/arm/mach-exynos4/include/mach/pmu.h b/arch/arm/mach-exynos4/include/mach/pmu.h
index a952904b010e..632dd5630138 100644
--- a/arch/arm/mach-exynos4/include/mach/pmu.h
+++ b/arch/arm/mach-exynos4/include/mach/pmu.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARCH_PMU_H 13#ifndef __ASM_ARCH_PMU_H
14#define __ASM_ARCH_PMU_H __FILE__ 14#define __ASM_ARCH_PMU_H __FILE__
15 15
16#define PMU_TABLE_END NULL
17
16enum sys_powerdown { 18enum sys_powerdown {
17 SYS_AFTR, 19 SYS_AFTR,
18 SYS_LPA, 20 SYS_LPA,
@@ -20,6 +22,11 @@ enum sys_powerdown {
20 NUM_SYS_POWERDOWN, 22 NUM_SYS_POWERDOWN,
21}; 23};
22 24
25struct exynos4_pmu_conf {
26 void __iomem *reg;
27 unsigned int val[NUM_SYS_POWERDOWN];
28};
29
23extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode); 30extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode);
24 31
25#endif /* __ASM_ARCH_PMU_H */ 32#endif /* __ASM_ARCH_PMU_H */
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
index cdf9b47c303c..4fff8e938fec 100644
--- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
@@ -25,9 +25,10 @@
25 25
26#define S5P_USE_STANDBY_WFI0 (1 << 16) 26#define S5P_USE_STANDBY_WFI0 (1 << 16)
27#define S5P_USE_STANDBY_WFI1 (1 << 17) 27#define S5P_USE_STANDBY_WFI1 (1 << 17)
28#define S5P_USE_STANDBYWFI_ISP_ARM (1 << 18)
28#define S5P_USE_STANDBY_WFE0 (1 << 24) 29#define S5P_USE_STANDBY_WFE0 (1 << 24)
29#define S5P_USE_STANDBY_WFE1 (1 << 25) 30#define S5P_USE_STANDBY_WFE1 (1 << 25)
30#define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24)) 31#define S5P_USE_STANDBYWFE_ISP_ARM (1 << 26)
31 32
32#define S5P_SWRESET S5P_PMUREG(0x0400) 33#define S5P_SWRESET S5P_PMUREG(0x0400)
33 34
@@ -35,15 +36,17 @@
35#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) 36#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604)
36#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) 37#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608)
37 38
38#define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) 39#define S5P_HDMI_PHY_CONTROL S5P_PMUREG(0x0700)
39#define S5P_USBHOST_PHY_ENABLE (1 << 0) 40#define S5P_HDMI_PHY_ENABLE (1 << 0)
41
42#define S5P_DAC_PHY_CONTROL S5P_PMUREG(0x070C)
43#define S5P_DAC_PHY_ENABLE (1 << 0)
40 44
41#define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4) 45#define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4)
42#define S5P_MIPI_DPHY_ENABLE (1 << 0) 46#define S5P_MIPI_DPHY_ENABLE (1 << 0)
43#define S5P_MIPI_DPHY_SRESETN (1 << 1) 47#define S5P_MIPI_DPHY_SRESETN (1 << 1)
44#define S5P_MIPI_DPHY_MRESETN (1 << 2) 48#define S5P_MIPI_DPHY_MRESETN (1 << 2)
45 49
46#define S5P_PMU_SATA_PHY_CONTROL S5P_PMUREG(0x0720)
47#define S5P_INFORM0 S5P_PMUREG(0x0800) 50#define S5P_INFORM0 S5P_PMUREG(0x0800)
48#define S5P_INFORM1 S5P_PMUREG(0x0804) 51#define S5P_INFORM1 S5P_PMUREG(0x0804)
49#define S5P_INFORM2 S5P_PMUREG(0x0808) 52#define S5P_INFORM2 S5P_PMUREG(0x0808)
@@ -76,7 +79,6 @@
76#define S5P_CMU_CLKSTOP_MFC_LOWPWR S5P_PMUREG(0x1148) 79#define S5P_CMU_CLKSTOP_MFC_LOWPWR S5P_PMUREG(0x1148)
77#define S5P_CMU_CLKSTOP_G3D_LOWPWR S5P_PMUREG(0x114C) 80#define S5P_CMU_CLKSTOP_G3D_LOWPWR S5P_PMUREG(0x114C)
78#define S5P_CMU_CLKSTOP_LCD0_LOWPWR S5P_PMUREG(0x1150) 81#define S5P_CMU_CLKSTOP_LCD0_LOWPWR S5P_PMUREG(0x1150)
79#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154)
80#define S5P_CMU_CLKSTOP_MAUDIO_LOWPWR S5P_PMUREG(0x1158) 82#define S5P_CMU_CLKSTOP_MAUDIO_LOWPWR S5P_PMUREG(0x1158)
81#define S5P_CMU_CLKSTOP_GPS_LOWPWR S5P_PMUREG(0x115C) 83#define S5P_CMU_CLKSTOP_GPS_LOWPWR S5P_PMUREG(0x115C)
82#define S5P_CMU_RESET_CAM_LOWPWR S5P_PMUREG(0x1160) 84#define S5P_CMU_RESET_CAM_LOWPWR S5P_PMUREG(0x1160)
@@ -84,7 +86,6 @@
84#define S5P_CMU_RESET_MFC_LOWPWR S5P_PMUREG(0x1168) 86#define S5P_CMU_RESET_MFC_LOWPWR S5P_PMUREG(0x1168)
85#define S5P_CMU_RESET_G3D_LOWPWR S5P_PMUREG(0x116C) 87#define S5P_CMU_RESET_G3D_LOWPWR S5P_PMUREG(0x116C)
86#define S5P_CMU_RESET_LCD0_LOWPWR S5P_PMUREG(0x1170) 88#define S5P_CMU_RESET_LCD0_LOWPWR S5P_PMUREG(0x1170)
87#define S5P_CMU_RESET_LCD1_LOWPWR S5P_PMUREG(0x1174)
88#define S5P_CMU_RESET_MAUDIO_LOWPWR S5P_PMUREG(0x1178) 89#define S5P_CMU_RESET_MAUDIO_LOWPWR S5P_PMUREG(0x1178)
89#define S5P_CMU_RESET_GPS_LOWPWR S5P_PMUREG(0x117C) 90#define S5P_CMU_RESET_GPS_LOWPWR S5P_PMUREG(0x117C)
90#define S5P_TOP_BUS_LOWPWR S5P_PMUREG(0x1180) 91#define S5P_TOP_BUS_LOWPWR S5P_PMUREG(0x1180)
@@ -92,14 +93,11 @@
92#define S5P_TOP_PWR_LOWPWR S5P_PMUREG(0x1188) 93#define S5P_TOP_PWR_LOWPWR S5P_PMUREG(0x1188)
93#define S5P_LOGIC_RESET_LOWPWR S5P_PMUREG(0x11A0) 94#define S5P_LOGIC_RESET_LOWPWR S5P_PMUREG(0x11A0)
94#define S5P_ONENAND_MEM_LOWPWR S5P_PMUREG(0x11C0) 95#define S5P_ONENAND_MEM_LOWPWR S5P_PMUREG(0x11C0)
95#define S5P_MODIMIF_MEM_LOWPWR S5P_PMUREG(0x11C4)
96#define S5P_G2D_ACP_MEM_LOWPWR S5P_PMUREG(0x11C8) 96#define S5P_G2D_ACP_MEM_LOWPWR S5P_PMUREG(0x11C8)
97#define S5P_USBOTG_MEM_LOWPWR S5P_PMUREG(0x11CC) 97#define S5P_USBOTG_MEM_LOWPWR S5P_PMUREG(0x11CC)
98#define S5P_HSMMC_MEM_LOWPWR S5P_PMUREG(0x11D0) 98#define S5P_HSMMC_MEM_LOWPWR S5P_PMUREG(0x11D0)
99#define S5P_CSSYS_MEM_LOWPWR S5P_PMUREG(0x11D4) 99#define S5P_CSSYS_MEM_LOWPWR S5P_PMUREG(0x11D4)
100#define S5P_SECSS_MEM_LOWPWR S5P_PMUREG(0x11D8) 100#define S5P_SECSS_MEM_LOWPWR S5P_PMUREG(0x11D8)
101#define S5P_PCIE_MEM_LOWPWR S5P_PMUREG(0x11E0)
102#define S5P_SATA_MEM_LOWPWR S5P_PMUREG(0x11E4)
103#define S5P_PAD_RETENTION_DRAM_LOWPWR S5P_PMUREG(0x1200) 101#define S5P_PAD_RETENTION_DRAM_LOWPWR S5P_PMUREG(0x1200)
104#define S5P_PAD_RETENTION_MAUDIO_LOWPWR S5P_PMUREG(0x1204) 102#define S5P_PAD_RETENTION_MAUDIO_LOWPWR S5P_PMUREG(0x1204)
105#define S5P_PAD_RETENTION_GPIO_LOWPWR S5P_PMUREG(0x1220) 103#define S5P_PAD_RETENTION_GPIO_LOWPWR S5P_PMUREG(0x1220)
@@ -120,7 +118,6 @@
120#define S5P_MFC_LOWPWR S5P_PMUREG(0x1388) 118#define S5P_MFC_LOWPWR S5P_PMUREG(0x1388)
121#define S5P_G3D_LOWPWR S5P_PMUREG(0x138C) 119#define S5P_G3D_LOWPWR S5P_PMUREG(0x138C)
122#define S5P_LCD0_LOWPWR S5P_PMUREG(0x1390) 120#define S5P_LCD0_LOWPWR S5P_PMUREG(0x1390)
123#define S5P_LCD1_LOWPWR S5P_PMUREG(0x1394)
124#define S5P_MAUDIO_LOWPWR S5P_PMUREG(0x1398) 121#define S5P_MAUDIO_LOWPWR S5P_PMUREG(0x1398)
125#define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) 122#define S5P_GPS_LOWPWR S5P_PMUREG(0x139C)
126#define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) 123#define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0)
@@ -156,7 +153,6 @@
156#define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40) 153#define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40)
157#define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60) 154#define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60)
158#define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80) 155#define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80)
159#define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0)
160#define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0) 156#define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0)
161 157
162#define S5P_PMU_SATA_PHY_CONTROL_EN 0x1 158#define S5P_PMU_SATA_PHY_CONTROL_EN 0x1
@@ -165,4 +161,60 @@
165 161
166#define S5P_CHECK_SLEEP 0x00000BAD 162#define S5P_CHECK_SLEEP 0x00000BAD
167 163
164/* Only for EXYNOS4210 */
165#define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708)
166#define S5P_USBHOST_PHY_ENABLE (1 << 0)
167
168#define S5P_PMU_SATA_PHY_CONTROL S5P_PMUREG(0x0720)
169
170#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154)
171#define S5P_CMU_RESET_LCD1_LOWPWR S5P_PMUREG(0x1174)
172#define S5P_MODIMIF_MEM_LOWPWR S5P_PMUREG(0x11C4)
173#define S5P_PCIE_MEM_LOWPWR S5P_PMUREG(0x11E0)
174#define S5P_SATA_MEM_LOWPWR S5P_PMUREG(0x11E4)
175#define S5P_LCD1_LOWPWR S5P_PMUREG(0x1394)
176
177#define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0)
178
179/* Only for EXYNOS4212 */
180#define S5P_ISP_ARM_LOWPWR S5P_PMUREG(0x1050)
181#define S5P_DIS_IRQ_ISP_ARM_LOCAL_LOWPWR S5P_PMUREG(0x1054)
182#define S5P_DIS_IRQ_ISP_ARM_CENTRAL_LOWPWR S5P_PMUREG(0x1058)
183#define S5P_CMU_ACLKSTOP_COREBLK_LOWPWR S5P_PMUREG(0x1110)
184#define S5P_CMU_SCLKSTOP_COREBLK_LOWPWR S5P_PMUREG(0x1114)
185#define S5P_CMU_RESET_COREBLK_LOWPWR S5P_PMUREG(0x111C)
186#define S5P_MPLLUSER_SYSCLK_LOWPWR S5P_PMUREG(0x1130)
187#define S5P_CMU_CLKSTOP_ISP_LOWPWR S5P_PMUREG(0x1154)
188#define S5P_CMU_RESET_ISP_LOWPWR S5P_PMUREG(0x1174)
189#define S5P_TOP_BUS_COREBLK_LOWPWR S5P_PMUREG(0x1190)
190#define S5P_TOP_RETENTION_COREBLK_LOWPWR S5P_PMUREG(0x1194)
191#define S5P_TOP_PWR_COREBLK_LOWPWR S5P_PMUREG(0x1198)
192#define S5P_OSCCLK_GATE_LOWPWR S5P_PMUREG(0x11A4)
193#define S5P_LOGIC_RESET_COREBLK_LOWPWR S5P_PMUREG(0x11B0)
194#define S5P_OSCCLK_GATE_COREBLK_LOWPWR S5P_PMUREG(0x11B4)
195#define S5P_HSI_MEM_LOWPWR S5P_PMUREG(0x11C4)
196#define S5P_ROTATOR_MEM_LOWPWR S5P_PMUREG(0x11DC)
197#define S5P_PAD_RETENTION_GPIO_COREBLK_LOWPWR S5P_PMUREG(0x123C)
198#define S5P_PAD_ISOLATION_COREBLK_LOWPWR S5P_PMUREG(0x1250)
199#define S5P_GPIO_MODE_COREBLK_LOWPWR S5P_PMUREG(0x1320)
200#define S5P_TOP_ASB_RESET_LOWPWR S5P_PMUREG(0x1344)
201#define S5P_TOP_ASB_ISOLATION_LOWPWR S5P_PMUREG(0x1348)
202#define S5P_ISP_LOWPWR S5P_PMUREG(0x1394)
203#define S5P_DRAM_FREQ_DOWN_LOWPWR S5P_PMUREG(0x13B0)
204#define S5P_DDRPHY_DLLOFF_LOWPWR S5P_PMUREG(0x13B4)
205#define S5P_CMU_SYSCLK_ISP_LOWPWR S5P_PMUREG(0x13B8)
206#define S5P_CMU_SYSCLK_GPS_LOWPWR S5P_PMUREG(0x13BC)
207#define S5P_LPDDR_PHY_DLL_LOCK_LOWPWR S5P_PMUREG(0x13C0)
208
209#define S5P_ARM_L2_0_OPTION S5P_PMUREG(0x2608)
210#define S5P_ARM_L2_1_OPTION S5P_PMUREG(0x2628)
211#define S5P_ONENAND_MEM_OPTION S5P_PMUREG(0x2E08)
212#define S5P_HSI_MEM_OPTION S5P_PMUREG(0x2E28)
213#define S5P_G2D_ACP_MEM_OPTION S5P_PMUREG(0x2E48)
214#define S5P_USBOTG_MEM_OPTION S5P_PMUREG(0x2E68)
215#define S5P_HSMMC_MEM_OPTION S5P_PMUREG(0x2E88)
216#define S5P_CSSYS_MEM_OPTION S5P_PMUREG(0x2EA8)
217#define S5P_SECSS_MEM_OPTION S5P_PMUREG(0x2EC8)
218#define S5P_ROTATOR_MEM_OPTION S5P_PMUREG(0x2F48)
219
168#endif /* __ASM_ARCH_REGS_PMU_H */ 220#endif /* __ASM_ARCH_REGS_PMU_H */
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
index 6e0536818bf5..2204911a24e9 100644
--- a/arch/arm/mach-exynos4/mach-nuri.c
+++ b/arch/arm/mach-exynos4/mach-nuri.c
@@ -32,10 +32,12 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34#include <plat/adc.h> 34#include <plat/adc.h>
35#include <plat/regs-fb-v4.h>
35#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
36#include <plat/exynos4.h> 37#include <plat/exynos4.h>
37#include <plat/cpu.h> 38#include <plat/cpu.h>
38#include <plat/devs.h> 39#include <plat/devs.h>
40#include <plat/fb.h>
39#include <plat/sdhci.h> 41#include <plat/sdhci.h>
40#include <plat/ehci.h> 42#include <plat/ehci.h>
41#include <plat/clock.h> 43#include <plat/clock.h>
@@ -199,6 +201,33 @@ static struct platform_device nuri_gpio_keys = {
199 }, 201 },
200}; 202};
201 203
204/* Frame Buffer */
205static struct s3c_fb_pd_win nuri_fb_win0 = {
206 .win_mode = {
207 .left_margin = 64,
208 .right_margin = 16,
209 .upper_margin = 64,
210 .lower_margin = 1,
211 .hsync_len = 48,
212 .vsync_len = 3,
213 .xres = 1280,
214 .yres = 800,
215 .refresh = 60,
216 },
217 .max_bpp = 24,
218 .default_bpp = 16,
219 .virtual_x = 1280,
220 .virtual_y = 800,
221};
222
223static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
224 .win[0] = &nuri_fb_win0,
225 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
226 VIDCON0_CLKSEL_LCD,
227 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
228 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
229};
230
202static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power) 231static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power)
203{ 232{
204 int gpio = EXYNOS4_GPE1(5); 233 int gpio = EXYNOS4_GPE1(5);
@@ -1092,6 +1121,7 @@ static struct platform_device *nuri_devices[] __initdata = {
1092 /* Samsung Platform Devices */ 1121 /* Samsung Platform Devices */
1093 &s3c_device_i2c5, /* PMIC should initialize first */ 1122 &s3c_device_i2c5, /* PMIC should initialize first */
1094 &emmc_fixed_voltage, 1123 &emmc_fixed_voltage,
1124 &s5p_device_fimd0,
1095 &s3c_device_hsmmc0, 1125 &s3c_device_hsmmc0,
1096 &s3c_device_hsmmc2, 1126 &s3c_device_hsmmc2,
1097 &s3c_device_hsmmc3, 1127 &s3c_device_hsmmc3,
@@ -1106,6 +1136,7 @@ static struct platform_device *nuri_devices[] __initdata = {
1106 &s5p_device_mfc_l, 1136 &s5p_device_mfc_l,
1107 &s5p_device_mfc_r, 1137 &s5p_device_mfc_r,
1108 &exynos4_device_pd[PD_MFC], 1138 &exynos4_device_pd[PD_MFC],
1139 &exynos4_device_pd[PD_LCD0],
1109 1140
1110 /* NURI Devices */ 1141 /* NURI Devices */
1111 &nuri_gpio_keys, 1142 &nuri_gpio_keys,
@@ -1142,12 +1173,15 @@ static void __init nuri_machine_init(void)
1142 i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); 1173 i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
1143 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); 1174 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
1144 1175
1176 s5p_fimd0_set_platdata(&nuri_fb_pdata);
1177
1145 nuri_ehci_init(); 1178 nuri_ehci_init();
1146 clk_xusbxti.rate = 24000000; 1179 clk_xusbxti.rate = 24000000;
1147 1180
1148 /* Last */ 1181 /* Last */
1149 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); 1182 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
1150 s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; 1183 s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
1184 s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
1151} 1185}
1152 1186
1153MACHINE_START(NURI, "NURI") 1187MACHINE_START(NURI, "NURI")
diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c
index b5f6f38557c9..71db8480bb5a 100644
--- a/arch/arm/mach-exynos4/mach-origen.c
+++ b/arch/arm/mach-exynos4/mach-origen.c
@@ -14,16 +14,31 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/pwm_backlight.h>
18#include <linux/gpio_keys.h>
19#include <linux/i2c.h>
20#include <linux/regulator/machine.h>
21#include <linux/mfd/max8997.h>
22#include <linux/lcd.h>
17 23
18#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
19#include <asm/mach-types.h> 25#include <asm/mach-types.h>
20 26
27#include <video/platform_lcd.h>
28
21#include <plat/regs-serial.h> 29#include <plat/regs-serial.h>
30#include <plat/regs-fb-v4.h>
22#include <plat/exynos4.h> 31#include <plat/exynos4.h>
23#include <plat/cpu.h> 32#include <plat/cpu.h>
24#include <plat/devs.h> 33#include <plat/devs.h>
25#include <plat/sdhci.h> 34#include <plat/sdhci.h>
26#include <plat/iic.h> 35#include <plat/iic.h>
36#include <plat/ehci.h>
37#include <plat/clock.h>
38#include <plat/gpio-cfg.h>
39#include <plat/backlight.h>
40#include <plat/pd.h>
41#include <plat/fb.h>
27 42
28#include <mach/map.h> 43#include <mach/map.h>
29 44
@@ -72,19 +87,543 @@ static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
72 }, 87 },
73}; 88};
74 89
90static struct regulator_consumer_supply __initdata ldo3_consumer[] = {
91 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
92};
93static struct regulator_consumer_supply __initdata ldo6_consumer[] = {
94 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */
95};
96static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
97 REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */
98};
99static struct regulator_consumer_supply __initdata ldo8_consumer[] = {
100 REGULATOR_SUPPLY("vdd", "s5p-adc"), /* ADC */
101};
102static struct regulator_consumer_supply __initdata ldo9_consumer[] = {
103 REGULATOR_SUPPLY("dvdd", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
104};
105static struct regulator_consumer_supply __initdata ldo11_consumer[] = {
106 REGULATOR_SUPPLY("dvdd", "alc5625"), /* Realtek ALC5625 */
107};
108static struct regulator_consumer_supply __initdata ldo14_consumer[] = {
109 REGULATOR_SUPPLY("avdd18", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
110};
111static struct regulator_consumer_supply __initdata ldo17_consumer[] = {
112 REGULATOR_SUPPLY("vdd33", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
113};
114static struct regulator_consumer_supply __initdata buck1_consumer[] = {
115 REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */
116};
117static struct regulator_consumer_supply __initdata buck2_consumer[] = {
118 REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */
119};
120static struct regulator_consumer_supply __initdata buck3_consumer[] = {
121 REGULATOR_SUPPLY("vdd_g3d", "mali_drm"), /* G3D */
122};
123static struct regulator_consumer_supply __initdata buck7_consumer[] = {
124 REGULATOR_SUPPLY("vcc", "platform-lcd"), /* LCD */
125};
126
127static struct regulator_init_data __initdata max8997_ldo1_data = {
128 .constraints = {
129 .name = "VDD_ABB_3.3V",
130 .min_uV = 3300000,
131 .max_uV = 3300000,
132 .apply_uV = 1,
133 .state_mem = {
134 .disabled = 1,
135 },
136 },
137};
138
139static struct regulator_init_data __initdata max8997_ldo2_data = {
140 .constraints = {
141 .name = "VDD_ALIVE_1.1V",
142 .min_uV = 1100000,
143 .max_uV = 1100000,
144 .apply_uV = 1,
145 .always_on = 1,
146 .state_mem = {
147 .enabled = 1,
148 },
149 },
150};
151
152static struct regulator_init_data __initdata max8997_ldo3_data = {
153 .constraints = {
154 .name = "VMIPI_1.1V",
155 .min_uV = 1100000,
156 .max_uV = 1100000,
157 .apply_uV = 1,
158 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
159 .state_mem = {
160 .disabled = 1,
161 },
162 },
163 .num_consumer_supplies = ARRAY_SIZE(ldo3_consumer),
164 .consumer_supplies = ldo3_consumer,
165};
166
167static struct regulator_init_data __initdata max8997_ldo4_data = {
168 .constraints = {
169 .name = "VDD_RTC_1.8V",
170 .min_uV = 1800000,
171 .max_uV = 1800000,
172 .apply_uV = 1,
173 .always_on = 1,
174 .state_mem = {
175 .disabled = 1,
176 },
177 },
178};
179
180static struct regulator_init_data __initdata max8997_ldo6_data = {
181 .constraints = {
182 .name = "VMIPI_1.8V",
183 .min_uV = 1800000,
184 .max_uV = 1800000,
185 .apply_uV = 1,
186 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
187 .state_mem = {
188 .disabled = 1,
189 },
190 },
191 .num_consumer_supplies = ARRAY_SIZE(ldo6_consumer),
192 .consumer_supplies = ldo6_consumer,
193};
194
195static struct regulator_init_data __initdata max8997_ldo7_data = {
196 .constraints = {
197 .name = "VDD_AUD_1.8V",
198 .min_uV = 1800000,
199 .max_uV = 1800000,
200 .apply_uV = 1,
201 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
202 .state_mem = {
203 .disabled = 1,
204 },
205 },
206 .num_consumer_supplies = ARRAY_SIZE(ldo7_consumer),
207 .consumer_supplies = ldo7_consumer,
208};
209
210static struct regulator_init_data __initdata max8997_ldo8_data = {
211 .constraints = {
212 .name = "VADC_3.3V",
213 .min_uV = 3300000,
214 .max_uV = 3300000,
215 .apply_uV = 1,
216 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
217 .state_mem = {
218 .disabled = 1,
219 },
220 },
221 .num_consumer_supplies = ARRAY_SIZE(ldo8_consumer),
222 .consumer_supplies = ldo8_consumer,
223};
224
225static struct regulator_init_data __initdata max8997_ldo9_data = {
226 .constraints = {
227 .name = "DVDD_SWB_2.8V",
228 .min_uV = 2800000,
229 .max_uV = 2800000,
230 .apply_uV = 1,
231 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
232 .state_mem = {
233 .disabled = 1,
234 },
235 },
236 .num_consumer_supplies = ARRAY_SIZE(ldo9_consumer),
237 .consumer_supplies = ldo9_consumer,
238};
239
240static struct regulator_init_data __initdata max8997_ldo10_data = {
241 .constraints = {
242 .name = "VDD_PLL_1.1V",
243 .min_uV = 1100000,
244 .max_uV = 1100000,
245 .apply_uV = 1,
246 .always_on = 1,
247 .state_mem = {
248 .disabled = 1,
249 },
250 },
251};
252
253static struct regulator_init_data __initdata max8997_ldo11_data = {
254 .constraints = {
255 .name = "VDD_AUD_3V",
256 .min_uV = 3000000,
257 .max_uV = 3000000,
258 .apply_uV = 1,
259 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
260 .state_mem = {
261 .disabled = 1,
262 },
263 },
264 .num_consumer_supplies = ARRAY_SIZE(ldo11_consumer),
265 .consumer_supplies = ldo11_consumer,
266};
267
268static struct regulator_init_data __initdata max8997_ldo14_data = {
269 .constraints = {
270 .name = "AVDD18_SWB_1.8V",
271 .min_uV = 1800000,
272 .max_uV = 1800000,
273 .apply_uV = 1,
274 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
275 .state_mem = {
276 .disabled = 1,
277 },
278 },
279 .num_consumer_supplies = ARRAY_SIZE(ldo14_consumer),
280 .consumer_supplies = ldo14_consumer,
281};
282
283static struct regulator_init_data __initdata max8997_ldo17_data = {
284 .constraints = {
285 .name = "VDD_SWB_3.3V",
286 .min_uV = 3300000,
287 .max_uV = 3300000,
288 .apply_uV = 1,
289 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
290 .state_mem = {
291 .disabled = 1,
292 },
293 },
294 .num_consumer_supplies = ARRAY_SIZE(ldo17_consumer),
295 .consumer_supplies = ldo17_consumer,
296};
297
298static struct regulator_init_data __initdata max8997_ldo21_data = {
299 .constraints = {
300 .name = "VDD_MIF_1.2V",
301 .min_uV = 1200000,
302 .max_uV = 1200000,
303 .apply_uV = 1,
304 .always_on = 1,
305 .state_mem = {
306 .disabled = 1,
307 },
308 },
309};
310
311static struct regulator_init_data __initdata max8997_buck1_data = {
312 .constraints = {
313 .name = "VDD_ARM_1.2V",
314 .min_uV = 950000,
315 .max_uV = 1350000,
316 .always_on = 1,
317 .boot_on = 1,
318 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
319 .state_mem = {
320 .disabled = 1,
321 },
322 },
323 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer),
324 .consumer_supplies = buck1_consumer,
325};
326
327static struct regulator_init_data __initdata max8997_buck2_data = {
328 .constraints = {
329 .name = "VDD_INT_1.1V",
330 .min_uV = 900000,
331 .max_uV = 1100000,
332 .always_on = 1,
333 .boot_on = 1,
334 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
335 .state_mem = {
336 .disabled = 1,
337 },
338 },
339 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer),
340 .consumer_supplies = buck2_consumer,
341};
342
343static struct regulator_init_data __initdata max8997_buck3_data = {
344 .constraints = {
345 .name = "VDD_G3D_1.1V",
346 .min_uV = 900000,
347 .max_uV = 1100000,
348 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
349 REGULATOR_CHANGE_STATUS,
350 .state_mem = {
351 .disabled = 1,
352 },
353 },
354 .num_consumer_supplies = ARRAY_SIZE(buck3_consumer),
355 .consumer_supplies = buck3_consumer,
356};
357
358static struct regulator_init_data __initdata max8997_buck5_data = {
359 .constraints = {
360 .name = "VDDQ_M1M2_1.2V",
361 .min_uV = 1200000,
362 .max_uV = 1200000,
363 .apply_uV = 1,
364 .always_on = 1,
365 .state_mem = {
366 .disabled = 1,
367 },
368 },
369};
370
371static struct regulator_init_data __initdata max8997_buck7_data = {
372 .constraints = {
373 .name = "VDD_LCD_3.3V",
374 .min_uV = 3300000,
375 .max_uV = 3300000,
376 .boot_on = 1,
377 .apply_uV = 1,
378 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
379 .state_mem = {
380 .disabled = 1
381 },
382 },
383 .num_consumer_supplies = ARRAY_SIZE(buck7_consumer),
384 .consumer_supplies = buck7_consumer,
385};
386
387static struct max8997_regulator_data __initdata origen_max8997_regulators[] = {
388 { MAX8997_LDO1, &max8997_ldo1_data },
389 { MAX8997_LDO2, &max8997_ldo2_data },
390 { MAX8997_LDO3, &max8997_ldo3_data },
391 { MAX8997_LDO4, &max8997_ldo4_data },
392 { MAX8997_LDO6, &max8997_ldo6_data },
393 { MAX8997_LDO7, &max8997_ldo7_data },
394 { MAX8997_LDO8, &max8997_ldo8_data },
395 { MAX8997_LDO9, &max8997_ldo9_data },
396 { MAX8997_LDO10, &max8997_ldo10_data },
397 { MAX8997_LDO11, &max8997_ldo11_data },
398 { MAX8997_LDO14, &max8997_ldo14_data },
399 { MAX8997_LDO17, &max8997_ldo17_data },
400 { MAX8997_LDO21, &max8997_ldo21_data },
401 { MAX8997_BUCK1, &max8997_buck1_data },
402 { MAX8997_BUCK2, &max8997_buck2_data },
403 { MAX8997_BUCK3, &max8997_buck3_data },
404 { MAX8997_BUCK5, &max8997_buck5_data },
405 { MAX8997_BUCK7, &max8997_buck7_data },
406};
407
408struct max8997_platform_data __initdata origen_max8997_pdata = {
409 .num_regulators = ARRAY_SIZE(origen_max8997_regulators),
410 .regulators = origen_max8997_regulators,
411
412 .wakeup = true,
413 .buck1_gpiodvs = false,
414 .buck2_gpiodvs = false,
415 .buck5_gpiodvs = false,
416 .irq_base = IRQ_GPIO_END + 1,
417
418 .ignore_gpiodvs_side_effect = true,
419 .buck125_default_idx = 0x0,
420
421 .buck125_gpios[0] = EXYNOS4_GPX0(0),
422 .buck125_gpios[1] = EXYNOS4_GPX0(1),
423 .buck125_gpios[2] = EXYNOS4_GPX0(2),
424
425 .buck1_voltage[0] = 1350000,
426 .buck1_voltage[1] = 1300000,
427 .buck1_voltage[2] = 1250000,
428 .buck1_voltage[3] = 1200000,
429 .buck1_voltage[4] = 1150000,
430 .buck1_voltage[5] = 1100000,
431 .buck1_voltage[6] = 1000000,
432 .buck1_voltage[7] = 950000,
433
434 .buck2_voltage[0] = 1100000,
435 .buck2_voltage[1] = 1100000,
436 .buck2_voltage[2] = 1100000,
437 .buck2_voltage[3] = 1100000,
438 .buck2_voltage[4] = 1000000,
439 .buck2_voltage[5] = 1000000,
440 .buck2_voltage[6] = 1000000,
441 .buck2_voltage[7] = 1000000,
442
443 .buck5_voltage[0] = 1200000,
444 .buck5_voltage[1] = 1200000,
445 .buck5_voltage[2] = 1200000,
446 .buck5_voltage[3] = 1200000,
447 .buck5_voltage[4] = 1200000,
448 .buck5_voltage[5] = 1200000,
449 .buck5_voltage[6] = 1200000,
450 .buck5_voltage[7] = 1200000,
451};
452
453/* I2C0 */
454static struct i2c_board_info i2c0_devs[] __initdata = {
455 {
456 I2C_BOARD_INFO("max8997", (0xCC >> 1)),
457 .platform_data = &origen_max8997_pdata,
458 .irq = IRQ_EINT(4),
459 },
460};
461
462static struct s3c_sdhci_platdata origen_hsmmc0_pdata __initdata = {
463 .cd_type = S3C_SDHCI_CD_INTERNAL,
464 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
465};
466
75static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = { 467static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
76 .cd_type = S3C_SDHCI_CD_GPIO, 468 .cd_type = S3C_SDHCI_CD_INTERNAL,
77 .ext_cd_gpio = EXYNOS4_GPK2(2),
78 .ext_cd_gpio_invert = 1,
79 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 469 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
80}; 470};
81 471
472/* USB EHCI */
473static struct s5p_ehci_platdata origen_ehci_pdata;
474
475static void __init origen_ehci_init(void)
476{
477 struct s5p_ehci_platdata *pdata = &origen_ehci_pdata;
478
479 s5p_ehci_set_platdata(pdata);
480}
481
482static struct gpio_keys_button origen_gpio_keys_table[] = {
483 {
484 .code = KEY_MENU,
485 .gpio = EXYNOS4_GPX1(5),
486 .desc = "gpio-keys: KEY_MENU",
487 .type = EV_KEY,
488 .active_low = 1,
489 .wakeup = 1,
490 .debounce_interval = 1,
491 }, {
492 .code = KEY_HOME,
493 .gpio = EXYNOS4_GPX1(6),
494 .desc = "gpio-keys: KEY_HOME",
495 .type = EV_KEY,
496 .active_low = 1,
497 .wakeup = 1,
498 .debounce_interval = 1,
499 }, {
500 .code = KEY_BACK,
501 .gpio = EXYNOS4_GPX1(7),
502 .desc = "gpio-keys: KEY_BACK",
503 .type = EV_KEY,
504 .active_low = 1,
505 .wakeup = 1,
506 .debounce_interval = 1,
507 }, {
508 .code = KEY_UP,
509 .gpio = EXYNOS4_GPX2(0),
510 .desc = "gpio-keys: KEY_UP",
511 .type = EV_KEY,
512 .active_low = 1,
513 .wakeup = 1,
514 .debounce_interval = 1,
515 }, {
516 .code = KEY_DOWN,
517 .gpio = EXYNOS4_GPX2(1),
518 .desc = "gpio-keys: KEY_DOWN",
519 .type = EV_KEY,
520 .active_low = 1,
521 .wakeup = 1,
522 .debounce_interval = 1,
523 },
524};
525
526static struct gpio_keys_platform_data origen_gpio_keys_data = {
527 .buttons = origen_gpio_keys_table,
528 .nbuttons = ARRAY_SIZE(origen_gpio_keys_table),
529};
530
531static struct platform_device origen_device_gpiokeys = {
532 .name = "gpio-keys",
533 .dev = {
534 .platform_data = &origen_gpio_keys_data,
535 },
536};
537
538static void lcd_hv070wsa_set_power(struct plat_lcd_data *pd, unsigned int power)
539{
540 int ret;
541
542 if (power)
543 ret = gpio_request_one(EXYNOS4_GPE3(4),
544 GPIOF_OUT_INIT_HIGH, "GPE3_4");
545 else
546 ret = gpio_request_one(EXYNOS4_GPE3(4),
547 GPIOF_OUT_INIT_LOW, "GPE3_4");
548
549 gpio_free(EXYNOS4_GPE3(4));
550
551 if (ret)
552 pr_err("failed to request gpio for LCD power: %d\n", ret);
553}
554
555static struct plat_lcd_data origen_lcd_hv070wsa_data = {
556 .set_power = lcd_hv070wsa_set_power,
557};
558
559static struct platform_device origen_lcd_hv070wsa = {
560 .name = "platform-lcd",
561 .dev.parent = &s5p_device_fimd0.dev,
562 .dev.platform_data = &origen_lcd_hv070wsa_data,
563};
564
565static struct s3c_fb_pd_win origen_fb_win0 = {
566 .win_mode = {
567 .left_margin = 64,
568 .right_margin = 16,
569 .upper_margin = 64,
570 .lower_margin = 16,
571 .hsync_len = 48,
572 .vsync_len = 3,
573 .xres = 1024,
574 .yres = 600,
575 },
576 .max_bpp = 32,
577 .default_bpp = 24,
578};
579
580static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
581 .win[0] = &origen_fb_win0,
582 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
583 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
584 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
585};
586
82static struct platform_device *origen_devices[] __initdata = { 587static struct platform_device *origen_devices[] __initdata = {
83 &s3c_device_hsmmc2, 588 &s3c_device_hsmmc2,
589 &s3c_device_hsmmc0,
590 &s3c_device_i2c0,
84 &s3c_device_rtc, 591 &s3c_device_rtc,
85 &s3c_device_wdt, 592 &s3c_device_wdt,
593 &s5p_device_ehci,
594 &s5p_device_fimc0,
595 &s5p_device_fimc1,
596 &s5p_device_fimc2,
597 &s5p_device_fimc3,
598 &s5p_device_fimd0,
599 &s5p_device_hdmi,
600 &s5p_device_i2c_hdmiphy,
601 &s5p_device_mixer,
602 &exynos4_device_pd[PD_LCD0],
603 &exynos4_device_pd[PD_TV],
604 &origen_device_gpiokeys,
605 &origen_lcd_hv070wsa,
606};
607
608/* LCD Backlight data */
609static struct samsung_bl_gpio_info origen_bl_gpio_info = {
610 .no = EXYNOS4_GPD0(0),
611 .func = S3C_GPIO_SFN(2),
86}; 612};
87 613
614static struct platform_pwm_backlight_data origen_bl_data = {
615 .pwm_id = 0,
616 .pwm_period_ns = 1000,
617};
618
619static void s5p_tv_setup(void)
620{
621 /* Direct HPD to HDMI chip */
622 gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug");
623 s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3));
624 s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE);
625}
626
88static void __init origen_map_io(void) 627static void __init origen_map_io(void)
89{ 628{
90 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 629 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -92,10 +631,42 @@ static void __init origen_map_io(void)
92 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs)); 631 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
93} 632}
94 633
634static void __init origen_power_init(void)
635{
636 gpio_request(EXYNOS4_GPX0(4), "PMIC_IRQ");
637 s3c_gpio_cfgpin(EXYNOS4_GPX0(4), S3C_GPIO_SFN(0xf));
638 s3c_gpio_setpull(EXYNOS4_GPX0(4), S3C_GPIO_PULL_NONE);
639}
640
95static void __init origen_machine_init(void) 641static void __init origen_machine_init(void)
96{ 642{
643 origen_power_init();
644
645 s3c_i2c0_set_platdata(NULL);
646 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
647
648 /*
649 * Since sdhci instance 2 can contain a bootable media,
650 * sdhci instance 0 is registered after instance 2.
651 */
97 s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata); 652 s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
653 s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
654
655 origen_ehci_init();
656 clk_xusbxti.rate = 24000000;
657
658 s5p_tv_setup();
659 s5p_i2c_hdmiphy_set_platdata(NULL);
660
661 s5p_fimd0_set_platdata(&origen_lcd_pdata);
662
98 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices)); 663 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
664 s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
665
666 s5p_device_hdmi.dev.parent = &exynos4_device_pd[PD_TV].dev;
667 s5p_device_mixer.dev.parent = &exynos4_device_pd[PD_TV].dev;
668
669 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
99} 670}
100 671
101MACHINE_START(ORIGEN, "ORIGEN") 672MACHINE_START(ORIGEN, "ORIGEN")
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index 2c1a076c6a73..cec2afabe7b4 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -37,6 +37,9 @@
37#include <plat/pd.h> 37#include <plat/pd.h>
38#include <plat/gpio-cfg.h> 38#include <plat/gpio-cfg.h>
39#include <plat/backlight.h> 39#include <plat/backlight.h>
40#include <plat/mfc.h>
41#include <plat/ehci.h>
42#include <plat/clock.h>
40 43
41#include <mach/map.h> 44#include <mach/map.h>
42 45
@@ -232,17 +235,36 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
232 {I2C_BOARD_INFO("wm8994", 0x1a),}, 235 {I2C_BOARD_INFO("wm8994", 0x1a),},
233}; 236};
234 237
238/* USB EHCI */
239static struct s5p_ehci_platdata smdkv310_ehci_pdata;
240
241static void __init smdkv310_ehci_init(void)
242{
243 struct s5p_ehci_platdata *pdata = &smdkv310_ehci_pdata;
244
245 s5p_ehci_set_platdata(pdata);
246}
247
235static struct platform_device *smdkv310_devices[] __initdata = { 248static struct platform_device *smdkv310_devices[] __initdata = {
236 &s3c_device_hsmmc0, 249 &s3c_device_hsmmc0,
237 &s3c_device_hsmmc1, 250 &s3c_device_hsmmc1,
238 &s3c_device_hsmmc2, 251 &s3c_device_hsmmc2,
239 &s3c_device_hsmmc3, 252 &s3c_device_hsmmc3,
240 &s3c_device_i2c1, 253 &s3c_device_i2c1,
254 &s5p_device_i2c_hdmiphy,
241 &s3c_device_rtc, 255 &s3c_device_rtc,
242 &s3c_device_wdt, 256 &s3c_device_wdt,
257 &s5p_device_ehci,
258 &s5p_device_fimc0,
259 &s5p_device_fimc1,
260 &s5p_device_fimc2,
261 &s5p_device_fimc3,
243 &exynos4_device_ac97, 262 &exynos4_device_ac97,
244 &exynos4_device_i2s0, 263 &exynos4_device_i2s0,
245 &samsung_device_keypad, 264 &samsung_device_keypad,
265 &s5p_device_mfc,
266 &s5p_device_mfc_l,
267 &s5p_device_mfc_r,
246 &exynos4_device_pd[PD_MFC], 268 &exynos4_device_pd[PD_MFC],
247 &exynos4_device_pd[PD_G3D], 269 &exynos4_device_pd[PD_G3D],
248 &exynos4_device_pd[PD_LCD0], 270 &exynos4_device_pd[PD_LCD0],
@@ -258,6 +280,8 @@ static struct platform_device *smdkv310_devices[] __initdata = {
258 &smdkv310_lcd_lte480wv, 280 &smdkv310_lcd_lte480wv,
259 &smdkv310_smsc911x, 281 &smdkv310_smsc911x,
260 &exynos4_device_ahci, 282 &exynos4_device_ahci,
283 &s5p_device_hdmi,
284 &s5p_device_mixer,
261}; 285};
262 286
263static void __init smdkv310_smsc911x_init(void) 287static void __init smdkv310_smsc911x_init(void)
@@ -294,6 +318,18 @@ static struct platform_pwm_backlight_data smdkv310_bl_data = {
294 .pwm_period_ns = 1000, 318 .pwm_period_ns = 1000,
295}; 319};
296 320
321static void s5p_tv_setup(void)
322{
323 /* direct HPD to HDMI chip */
324 WARN_ON(gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug"));
325 s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3));
326 s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE);
327
328 /* setup dependencies between TV devices */
329 s5p_device_hdmi.dev.parent = &exynos4_device_pd[PD_TV].dev;
330 s5p_device_mixer.dev.parent = &exynos4_device_pd[PD_TV].dev;
331}
332
297static void __init smdkv310_map_io(void) 333static void __init smdkv310_map_io(void)
298{ 334{
299 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 335 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -301,6 +337,11 @@ static void __init smdkv310_map_io(void)
301 s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs)); 337 s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
302} 338}
303 339
340static void __init smdkv310_reserve(void)
341{
342 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
343}
344
304static void __init smdkv310_machine_init(void) 345static void __init smdkv310_machine_init(void)
305{ 346{
306 s3c_i2c1_set_platdata(NULL); 347 s3c_i2c1_set_platdata(NULL);
@@ -313,12 +354,19 @@ static void __init smdkv310_machine_init(void)
313 s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata); 354 s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
314 s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata); 355 s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
315 356
357 s5p_tv_setup();
358 s5p_i2c_hdmiphy_set_platdata(NULL);
359
316 samsung_keypad_set_platdata(&smdkv310_keypad_data); 360 samsung_keypad_set_platdata(&smdkv310_keypad_data);
317 361
318 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data); 362 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);
319 s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata); 363 s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata);
320 364
365 smdkv310_ehci_init();
366 clk_xusbxti.rate = 24000000;
367
321 platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices)); 368 platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
369 s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
322} 370}
323 371
324MACHINE_START(SMDKV310, "SMDKV310") 372MACHINE_START(SMDKV310, "SMDKV310")
@@ -329,6 +377,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
329 .map_io = smdkv310_map_io, 377 .map_io = smdkv310_map_io,
330 .init_machine = smdkv310_machine_init, 378 .init_machine = smdkv310_machine_init,
331 .timer = &exynos4_timer, 379 .timer = &exynos4_timer,
380 .reserve = &smdkv310_reserve,
332MACHINE_END 381MACHINE_END
333 382
334MACHINE_START(SMDKC210, "SMDKC210") 383MACHINE_START(SMDKC210, "SMDKC210")
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index 2aac6f755c8e..a2a177ff4b44 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -13,6 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/gpio_keys.h> 14#include <linux/gpio_keys.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/fb.h>
16#include <linux/mfd/max8998.h> 17#include <linux/mfd/max8998.h>
17#include <linux/regulator/machine.h> 18#include <linux/regulator/machine.h>
18#include <linux/regulator/fixed.h> 19#include <linux/regulator/fixed.h>
@@ -31,12 +32,21 @@
31#include <plat/devs.h> 32#include <plat/devs.h>
32#include <plat/iic.h> 33#include <plat/iic.h>
33#include <plat/gpio-cfg.h> 34#include <plat/gpio-cfg.h>
35#include <plat/fb.h>
34#include <plat/mfc.h> 36#include <plat/mfc.h>
35#include <plat/sdhci.h> 37#include <plat/sdhci.h>
36#include <plat/pd.h> 38#include <plat/pd.h>
39#include <plat/regs-fb-v4.h>
40#include <plat/fimc-core.h>
41#include <plat/camport.h>
42#include <plat/mipi_csis.h>
37 43
38#include <mach/map.h> 44#include <mach/map.h>
39 45
46#include <media/v4l2-mediabus.h>
47#include <media/s5p_fimc.h>
48#include <media/m5mols.h>
49
40/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
41#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
42 S3C2410_UCON_RXILEVEL | \ 52 S3C2410_UCON_RXILEVEL | \
@@ -110,6 +120,9 @@ static struct regulator_consumer_supply lp3974_buck1_consumer =
110static struct regulator_consumer_supply lp3974_buck2_consumer = 120static struct regulator_consumer_supply lp3974_buck2_consumer =
111 REGULATOR_SUPPLY("vddg3d", NULL); 121 REGULATOR_SUPPLY("vddg3d", NULL);
112 122
123static struct regulator_consumer_supply lp3974_buck3_consumer =
124 REGULATOR_SUPPLY("vdet", "s5p-sdo");
125
113static struct regulator_init_data lp3974_buck1_data = { 126static struct regulator_init_data lp3974_buck1_data = {
114 .constraints = { 127 .constraints = {
115 .name = "VINT_1.1V", 128 .name = "VINT_1.1V",
@@ -153,6 +166,8 @@ static struct regulator_init_data lp3974_buck3_data = {
153 .enabled = 1, 166 .enabled = 1,
154 }, 167 },
155 }, 168 },
169 .num_consumer_supplies = 1,
170 .consumer_supplies = &lp3974_buck3_consumer,
156}; 171};
157 172
158static struct regulator_init_data lp3974_buck4_data = { 173static struct regulator_init_data lp3974_buck4_data = {
@@ -181,6 +196,12 @@ static struct regulator_init_data lp3974_ldo2_data = {
181 }, 196 },
182}; 197};
183 198
199static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
200 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"),
201 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"),
202 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"),
203};
204
184static struct regulator_init_data lp3974_ldo3_data = { 205static struct regulator_init_data lp3974_ldo3_data = {
185 .constraints = { 206 .constraints = {
186 .name = "VUSB+MIPI_1.1V", 207 .name = "VUSB+MIPI_1.1V",
@@ -192,6 +213,12 @@ static struct regulator_init_data lp3974_ldo3_data = {
192 .disabled = 1, 213 .disabled = 1,
193 }, 214 },
194 }, 215 },
216 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo3_consumer),
217 .consumer_supplies = lp3974_ldo3_consumer,
218};
219
220static struct regulator_consumer_supply lp3974_ldo4_consumer[] = {
221 REGULATOR_SUPPLY("vdd_osc", "exynos4-hdmi"),
195}; 222};
196 223
197static struct regulator_init_data lp3974_ldo4_data = { 224static struct regulator_init_data lp3974_ldo4_data = {
@@ -205,6 +232,8 @@ static struct regulator_init_data lp3974_ldo4_data = {
205 .disabled = 1, 232 .disabled = 1,
206 }, 233 },
207 }, 234 },
235 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo4_consumer),
236 .consumer_supplies = lp3974_ldo4_consumer,
208}; 237};
209 238
210static struct regulator_init_data lp3974_ldo5_data = { 239static struct regulator_init_data lp3974_ldo5_data = {
@@ -233,6 +262,10 @@ static struct regulator_init_data lp3974_ldo6_data = {
233 }, 262 },
234}; 263};
235 264
265static struct regulator_consumer_supply lp3974_ldo7_consumer[] = {
266 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"),
267};
268
236static struct regulator_init_data lp3974_ldo7_data = { 269static struct regulator_init_data lp3974_ldo7_data = {
237 .constraints = { 270 .constraints = {
238 .name = "VLCD+VMIPI_1.8V", 271 .name = "VLCD+VMIPI_1.8V",
@@ -244,6 +277,12 @@ static struct regulator_init_data lp3974_ldo7_data = {
244 .disabled = 1, 277 .disabled = 1,
245 }, 278 },
246 }, 279 },
280 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo7_consumer),
281 .consumer_supplies = lp3974_ldo7_consumer,
282};
283
284static struct regulator_consumer_supply lp3974_ldo8_consumer[] = {
285 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
247}; 286};
248 287
249static struct regulator_init_data lp3974_ldo8_data = { 288static struct regulator_init_data lp3974_ldo8_data = {
@@ -257,6 +296,8 @@ static struct regulator_init_data lp3974_ldo8_data = {
257 .disabled = 1, 296 .disabled = 1,
258 }, 297 },
259 }, 298 },
299 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo8_consumer),
300 .consumer_supplies = lp3974_ldo8_consumer,
260}; 301};
261 302
262static struct regulator_init_data lp3974_ldo9_data = { 303static struct regulator_init_data lp3974_ldo9_data = {
@@ -286,6 +327,9 @@ static struct regulator_init_data lp3974_ldo10_data = {
286 }, 327 },
287}; 328};
288 329
330static struct regulator_consumer_supply lp3974_ldo11_consumer =
331 REGULATOR_SUPPLY("dig_28", "0-001f");
332
289static struct regulator_init_data lp3974_ldo11_data = { 333static struct regulator_init_data lp3974_ldo11_data = {
290 .constraints = { 334 .constraints = {
291 .name = "CAM_AF_3.3V", 335 .name = "CAM_AF_3.3V",
@@ -297,6 +341,8 @@ static struct regulator_init_data lp3974_ldo11_data = {
297 .disabled = 1, 341 .disabled = 1,
298 }, 342 },
299 }, 343 },
344 .num_consumer_supplies = 1,
345 .consumer_supplies = &lp3974_ldo11_consumer,
300}; 346};
301 347
302static struct regulator_init_data lp3974_ldo12_data = { 348static struct regulator_init_data lp3974_ldo12_data = {
@@ -325,6 +371,9 @@ static struct regulator_init_data lp3974_ldo13_data = {
325 }, 371 },
326}; 372};
327 373
374static struct regulator_consumer_supply lp3974_ldo14_consumer =
375 REGULATOR_SUPPLY("dig_18", "0-001f");
376
328static struct regulator_init_data lp3974_ldo14_data = { 377static struct regulator_init_data lp3974_ldo14_data = {
329 .constraints = { 378 .constraints = {
330 .name = "CAM_I_HOST_1.8V", 379 .name = "CAM_I_HOST_1.8V",
@@ -336,8 +385,14 @@ static struct regulator_init_data lp3974_ldo14_data = {
336 .disabled = 1, 385 .disabled = 1,
337 }, 386 },
338 }, 387 },
388 .num_consumer_supplies = 1,
389 .consumer_supplies = &lp3974_ldo14_consumer,
339}; 390};
340 391
392
393static struct regulator_consumer_supply lp3974_ldo15_consumer =
394 REGULATOR_SUPPLY("dig_12", "0-001f");
395
341static struct regulator_init_data lp3974_ldo15_data = { 396static struct regulator_init_data lp3974_ldo15_data = {
342 .constraints = { 397 .constraints = {
343 .name = "CAM_S_DIG+FM33_CORE_1.2V", 398 .name = "CAM_S_DIG+FM33_CORE_1.2V",
@@ -349,6 +404,12 @@ static struct regulator_init_data lp3974_ldo15_data = {
349 .disabled = 1, 404 .disabled = 1,
350 }, 405 },
351 }, 406 },
407 .num_consumer_supplies = 1,
408 .consumer_supplies = &lp3974_ldo15_consumer,
409};
410
411static struct regulator_consumer_supply lp3974_ldo16_consumer[] = {
412 REGULATOR_SUPPLY("a_sensor", "0-001f"),
352}; 413};
353 414
354static struct regulator_init_data lp3974_ldo16_data = { 415static struct regulator_init_data lp3974_ldo16_data = {
@@ -362,6 +423,8 @@ static struct regulator_init_data lp3974_ldo16_data = {
362 .disabled = 1, 423 .disabled = 1,
363 }, 424 },
364 }, 425 },
426 .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo16_consumer),
427 .consumer_supplies = lp3974_ldo16_consumer,
365}; 428};
366 429
367static struct regulator_init_data lp3974_ldo17_data = { 430static struct regulator_init_data lp3974_ldo17_data = {
@@ -472,6 +535,43 @@ static struct max8998_platform_data universal_lp3974_pdata = {
472 .wakeup = true, 535 .wakeup = true,
473}; 536};
474 537
538
539enum fixed_regulator_id {
540 FIXED_REG_ID_MMC0,
541 FIXED_REG_ID_HDMI_5V,
542 FIXED_REG_ID_CAM_S_IF,
543 FIXED_REG_ID_CAM_I_CORE,
544 FIXED_REG_ID_CAM_VT_DIO,
545};
546
547static struct regulator_consumer_supply hdmi_fixed_consumer =
548 REGULATOR_SUPPLY("hdmi-en", "exynos4-hdmi");
549
550static struct regulator_init_data hdmi_fixed_voltage_init_data = {
551 .constraints = {
552 .name = "HDMI_5V",
553 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
554 },
555 .num_consumer_supplies = 1,
556 .consumer_supplies = &hdmi_fixed_consumer,
557};
558
559static struct fixed_voltage_config hdmi_fixed_voltage_config = {
560 .supply_name = "HDMI_EN1",
561 .microvolts = 5000000,
562 .gpio = EXYNOS4_GPE0(1),
563 .enable_high = true,
564 .init_data = &hdmi_fixed_voltage_init_data,
565};
566
567static struct platform_device hdmi_fixed_voltage = {
568 .name = "reg-fixed-voltage",
569 .id = FIXED_REG_ID_HDMI_5V,
570 .dev = {
571 .platform_data = &hdmi_fixed_voltage_config,
572 },
573};
574
475/* GPIO I2C 5 (PMIC) */ 575/* GPIO I2C 5 (PMIC) */
476static struct i2c_board_info i2c5_devs[] __initdata = { 576static struct i2c_board_info i2c5_devs[] __initdata = {
477 { 577 {
@@ -573,6 +673,11 @@ static void __init universal_touchkey_init(void)
573 gpio_direction_output(gpio, 1); 673 gpio_direction_output(gpio, 1);
574} 674}
575 675
676static struct s3c2410_platform_i2c universal_i2c0_platdata __initdata = {
677 .frequency = 300 * 1000,
678 .sda_delay = 200,
679};
680
576/* GPIO KEYS */ 681/* GPIO KEYS */
577static struct gpio_keys_button universal_gpio_keys_tables[] = { 682static struct gpio_keys_button universal_gpio_keys_tables[] = {
578 { 683 {
@@ -658,7 +763,7 @@ static struct fixed_voltage_config mmc0_fixed_voltage_config = {
658 763
659static struct platform_device mmc0_fixed_voltage = { 764static struct platform_device mmc0_fixed_voltage = {
660 .name = "reg-fixed-voltage", 765 .name = "reg-fixed-voltage",
661 .id = 0, 766 .id = FIXED_REG_ID_MMC0,
662 .dev = { 767 .dev = {
663 .platform_data = &mmc0_fixed_voltage_config, 768 .platform_data = &mmc0_fixed_voltage_config,
664 }, 769 },
@@ -692,18 +797,165 @@ static void __init universal_sdhci_init(void)
692 s3c_sdhci3_set_platdata(&universal_hsmmc3_data); 797 s3c_sdhci3_set_platdata(&universal_hsmmc3_data);
693} 798}
694 799
695/* I2C0 */
696static struct i2c_board_info i2c0_devs[] __initdata = {
697 /* Camera, To be updated */
698};
699
700/* I2C1 */ 800/* I2C1 */
701static struct i2c_board_info i2c1_devs[] __initdata = { 801static struct i2c_board_info i2c1_devs[] __initdata = {
702 /* Gyro, To be updated */ 802 /* Gyro, To be updated */
703}; 803};
704 804
805/* Frame Buffer */
806static struct s3c_fb_pd_win universal_fb_win0 = {
807 .win_mode = {
808 .left_margin = 16,
809 .right_margin = 16,
810 .upper_margin = 2,
811 .lower_margin = 28,
812 .hsync_len = 2,
813 .vsync_len = 1,
814 .xres = 480,
815 .yres = 800,
816 .refresh = 55,
817 },
818 .max_bpp = 32,
819 .default_bpp = 16,
820};
821
822static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
823 .win[0] = &universal_fb_win0,
824 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
825 VIDCON0_CLKSEL_LCD,
826 .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
827 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
828 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
829};
830
831static struct regulator_consumer_supply cam_i_core_supply =
832 REGULATOR_SUPPLY("core", "0-001f");
833
834static struct regulator_init_data cam_i_core_reg_init_data = {
835 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
836 .num_consumer_supplies = 1,
837 .consumer_supplies = &cam_i_core_supply,
838};
839
840static struct fixed_voltage_config cam_i_core_fixed_voltage_cfg = {
841 .supply_name = "CAM_I_CORE_1.2V",
842 .microvolts = 1200000,
843 .gpio = EXYNOS4_GPE2(2), /* CAM_8M_CORE_EN */
844 .enable_high = 1,
845 .init_data = &cam_i_core_reg_init_data,
846};
847
848static struct platform_device cam_i_core_fixed_reg_dev = {
849 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_I_CORE,
850 .dev = { .platform_data = &cam_i_core_fixed_voltage_cfg },
851};
852
853static struct regulator_consumer_supply cam_s_if_supply =
854 REGULATOR_SUPPLY("d_sensor", "0-001f");
855
856static struct regulator_init_data cam_s_if_reg_init_data = {
857 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
858 .num_consumer_supplies = 1,
859 .consumer_supplies = &cam_s_if_supply,
860};
861
862static struct fixed_voltage_config cam_s_if_fixed_voltage_cfg = {
863 .supply_name = "CAM_S_IF_1.8V",
864 .microvolts = 1800000,
865 .gpio = EXYNOS4_GPE3(0), /* CAM_PWR_EN1 */
866 .enable_high = 1,
867 .init_data = &cam_s_if_reg_init_data,
868};
869
870static struct platform_device cam_s_if_fixed_reg_dev = {
871 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_S_IF,
872 .dev = { .platform_data = &cam_s_if_fixed_voltage_cfg },
873};
874
875static struct s5p_platform_mipi_csis mipi_csis_platdata = {
876 .clk_rate = 166000000UL,
877 .lanes = 2,
878 .alignment = 32,
879 .hs_settle = 12,
880 .phy_enable = s5p_csis_phy_enable,
881};
882
883#define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3)
884#define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */
885#define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5)
886
887static int m5mols_set_power(struct device *dev, int on)
888{
889 gpio_set_value(GPIO_CAM_LEVEL_EN(1), !on);
890 gpio_set_value(GPIO_CAM_LEVEL_EN(2), !!on);
891 return 0;
892}
893
894static struct m5mols_platform_data m5mols_platdata = {
895 .gpio_reset = GPIO_CAM_MEGA_nRST,
896 .reset_polarity = 0,
897 .set_power = m5mols_set_power,
898};
899
900static struct i2c_board_info m5mols_board_info = {
901 I2C_BOARD_INFO("M5MOLS", 0x1F),
902 .platform_data = &m5mols_platdata,
903};
904
905static struct s5p_fimc_isp_info universal_camera_sensors[] = {
906 {
907 .mux_id = 0,
908 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
909 V4L2_MBUS_VSYNC_ACTIVE_LOW,
910 .bus_type = FIMC_MIPI_CSI2,
911 .board_info = &m5mols_board_info,
912 .i2c_bus_num = 0,
913 .clk_frequency = 21600000UL,
914 .csi_data_align = 32,
915 },
916};
917
918static struct s5p_platform_fimc fimc_md_platdata = {
919 .isp_info = universal_camera_sensors,
920 .num_clients = ARRAY_SIZE(universal_camera_sensors),
921};
922
923static struct gpio universal_camera_gpios[] = {
924 { GPIO_CAM_LEVEL_EN(1), GPIOF_OUT_INIT_HIGH, "CAM_LVL_EN1" },
925 { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" },
926 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" },
927 { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" },
928};
929
930static void universal_camera_init(void)
931{
932 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
933 &s5p_device_mipi_csis0);
934 s3c_set_platdata(&fimc_md_platdata, sizeof(fimc_md_platdata),
935 &s5p_device_fimc_md);
936
937 if (gpio_request_array(universal_camera_gpios,
938 ARRAY_SIZE(universal_camera_gpios))) {
939 pr_err("%s: GPIO request failed\n", __func__);
940 return;
941 }
942
943 if (!s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xf)))
944 m5mols_board_info.irq = gpio_to_irq(GPIO_CAM_8M_ISP_INT);
945 else
946 pr_err("Failed to configure 8M_ISP_INT GPIO\n");
947
948 /* Free GPIOs controlled directly by the sensor drivers. */
949 gpio_free(GPIO_CAM_MEGA_nRST);
950 gpio_free(GPIO_CAM_8M_ISP_INT);
951
952 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A))
953 pr_err("Camera port A setup failed\n");
954}
955
705static struct platform_device *universal_devices[] __initdata = { 956static struct platform_device *universal_devices[] __initdata = {
706 /* Samsung Platform Devices */ 957 /* Samsung Platform Devices */
958 &s5p_device_mipi_csis0,
707 &s5p_device_fimc0, 959 &s5p_device_fimc0,
708 &s5p_device_fimc1, 960 &s5p_device_fimc1,
709 &s5p_device_fimc2, 961 &s5p_device_fimc2,
@@ -712,17 +964,30 @@ static struct platform_device *universal_devices[] __initdata = {
712 &s3c_device_hsmmc0, 964 &s3c_device_hsmmc0,
713 &s3c_device_hsmmc2, 965 &s3c_device_hsmmc2,
714 &s3c_device_hsmmc3, 966 &s3c_device_hsmmc3,
967 &s3c_device_i2c0,
715 &s3c_device_i2c3, 968 &s3c_device_i2c3,
716 &s3c_device_i2c5, 969 &s3c_device_i2c5,
970 &s5p_device_i2c_hdmiphy,
971 &hdmi_fixed_voltage,
972 &exynos4_device_pd[PD_TV],
973 &s5p_device_hdmi,
974 &s5p_device_sdo,
975 &s5p_device_mixer,
717 976
718 /* Universal Devices */ 977 /* Universal Devices */
719 &i2c_gpio12, 978 &i2c_gpio12,
720 &universal_gpio_keys, 979 &universal_gpio_keys,
721 &s5p_device_onenand, 980 &s5p_device_onenand,
981 &s5p_device_fimd0,
722 &s5p_device_mfc, 982 &s5p_device_mfc,
723 &s5p_device_mfc_l, 983 &s5p_device_mfc_l,
724 &s5p_device_mfc_r, 984 &s5p_device_mfc_r,
725 &exynos4_device_pd[PD_MFC], 985 &exynos4_device_pd[PD_MFC],
986 &exynos4_device_pd[PD_LCD0],
987 &exynos4_device_pd[PD_CAM],
988 &cam_i_core_fixed_reg_dev,
989 &cam_s_if_fixed_reg_dev,
990 &s5p_device_fimc_md,
726}; 991};
727 992
728static void __init universal_map_io(void) 993static void __init universal_map_io(void)
@@ -732,6 +997,20 @@ static void __init universal_map_io(void)
732 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 997 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
733} 998}
734 999
1000void s5p_tv_setup(void)
1001{
1002 /* direct HPD to HDMI chip */
1003 gpio_request(EXYNOS4_GPX3(7), "hpd-plug");
1004
1005 gpio_direction_input(EXYNOS4_GPX3(7));
1006 s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3));
1007 s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE);
1008
1009 /* setup dependencies between TV devices */
1010 s5p_device_hdmi.dev.parent = &exynos4_device_pd[PD_TV].dev;
1011 s5p_device_mixer.dev.parent = &exynos4_device_pd[PD_TV].dev;
1012}
1013
735static void __init universal_reserve(void) 1014static void __init universal_reserve(void)
736{ 1015{
737 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); 1016 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
@@ -740,8 +1019,9 @@ static void __init universal_reserve(void)
740static void __init universal_machine_init(void) 1019static void __init universal_machine_init(void)
741{ 1020{
742 universal_sdhci_init(); 1021 universal_sdhci_init();
1022 s5p_tv_setup();
743 1023
744 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); 1024 s3c_i2c0_set_platdata(&universal_i2c0_platdata);
745 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 1025 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
746 1026
747 universal_tsp_init(); 1027 universal_tsp_init();
@@ -749,15 +1029,28 @@ static void __init universal_machine_init(void)
749 i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); 1029 i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
750 1030
751 s3c_i2c5_set_platdata(NULL); 1031 s3c_i2c5_set_platdata(NULL);
1032 s5p_i2c_hdmiphy_set_platdata(NULL);
752 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 1033 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
753 1034
1035 s5p_fimd0_set_platdata(&universal_lcd_pdata);
1036
754 universal_touchkey_init(); 1037 universal_touchkey_init();
755 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs, 1038 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
756 ARRAY_SIZE(i2c_gpio12_devs)); 1039 ARRAY_SIZE(i2c_gpio12_devs));
757 1040
1041 universal_camera_init();
1042
758 /* Last */ 1043 /* Last */
759 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); 1044 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
1045
760 s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; 1046 s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
1047 s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
1048
1049 s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
1050 s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
1051 s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
1052 s5p_device_fimc3.dev.parent = &exynos4_device_pd[PD_CAM].dev;
1053 s5p_device_mipi_csis0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
761} 1054}
762 1055
763MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") 1056MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index 62e4f4363006..509a435afd4b 100644
--- a/arch/arm/mach-exynos4/pm.c
+++ b/arch/arm/mach-exynos4/pm.c
@@ -339,6 +339,13 @@ static int exynos4_pm_suspend(void)
339 tmp &= ~S5P_CENTRAL_LOWPWR_CFG; 339 tmp &= ~S5P_CENTRAL_LOWPWR_CFG;
340 __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION); 340 __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
341 341
342 if (soc_is_exynos4212()) {
343 tmp = __raw_readl(S5P_CENTRAL_SEQ_OPTION);
344 tmp &= ~(S5P_USE_STANDBYWFI_ISP_ARM |
345 S5P_USE_STANDBYWFE_ISP_ARM);
346 __raw_writel(tmp, S5P_CENTRAL_SEQ_OPTION);
347 }
348
342 /* Save Power control register */ 349 /* Save Power control register */
343 asm ("mrc p15, 0, %0, c15, c0, 0" 350 asm ("mrc p15, 0, %0, c15, c0, 0"
344 : "=r" (tmp) : : "cc"); 351 : "=r" (tmp) : : "cc");
diff --git a/arch/arm/mach-exynos4/pmu.c b/arch/arm/mach-exynos4/pmu.c
index 7ea9eb2a20d2..bba48f5c3e8f 100644
--- a/arch/arm/mach-exynos4/pmu.c
+++ b/arch/arm/mach-exynos4/pmu.c
@@ -16,160 +16,215 @@
16#include <mach/regs-clock.h> 16#include <mach/regs-clock.h>
17#include <mach/pmu.h> 17#include <mach/pmu.h>
18 18
19static void __iomem *sys_powerdown_reg[] = { 19static struct exynos4_pmu_conf *exynos4_pmu_config;
20 S5P_ARM_CORE0_LOWPWR, 20
21 S5P_DIS_IRQ_CORE0, 21static struct exynos4_pmu_conf exynos4210_pmu_config[] = {
22 S5P_DIS_IRQ_CENTRAL0, 22 /* { .reg = address, .val = { AFTR, LPA, SLEEP } */
23 S5P_ARM_CORE1_LOWPWR, 23 { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
24 S5P_DIS_IRQ_CORE1, 24 { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } },
25 S5P_DIS_IRQ_CENTRAL1, 25 { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
26 S5P_ARM_COMMON_LOWPWR, 26 { S5P_ARM_CORE1_LOWPWR, { 0x0, 0x0, 0x2 } },
27 S5P_L2_0_LOWPWR, 27 { S5P_DIS_IRQ_CORE1, { 0x0, 0x0, 0x0 } },
28 S5P_L2_1_LOWPWR, 28 { S5P_DIS_IRQ_CENTRAL1, { 0x0, 0x0, 0x0 } },
29 S5P_CMU_ACLKSTOP_LOWPWR, 29 { S5P_ARM_COMMON_LOWPWR, { 0x0, 0x0, 0x2 } },
30 S5P_CMU_SCLKSTOP_LOWPWR, 30 { S5P_L2_0_LOWPWR, { 0x2, 0x2, 0x3 } },
31 S5P_CMU_RESET_LOWPWR, 31 { S5P_L2_1_LOWPWR, { 0x2, 0x2, 0x3 } },
32 S5P_APLL_SYSCLK_LOWPWR, 32 { S5P_CMU_ACLKSTOP_LOWPWR, { 0x1, 0x0, 0x0 } },
33 S5P_MPLL_SYSCLK_LOWPWR, 33 { S5P_CMU_SCLKSTOP_LOWPWR, { 0x1, 0x0, 0x0 } },
34 S5P_VPLL_SYSCLK_LOWPWR, 34 { S5P_CMU_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
35 S5P_EPLL_SYSCLK_LOWPWR, 35 { S5P_APLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
36 S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, 36 { S5P_MPLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
37 S5P_CMU_RESET_GPSALIVE_LOWPWR, 37 { S5P_VPLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
38 S5P_CMU_CLKSTOP_CAM_LOWPWR, 38 { S5P_EPLL_SYSCLK_LOWPWR, { 0x1, 0x1, 0x0 } },
39 S5P_CMU_CLKSTOP_TV_LOWPWR, 39 { S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, { 0x1, 0x1, 0x0 } },
40 S5P_CMU_CLKSTOP_MFC_LOWPWR, 40 { S5P_CMU_RESET_GPSALIVE_LOWPWR, { 0x1, 0x1, 0x0 } },
41 S5P_CMU_CLKSTOP_G3D_LOWPWR, 41 { S5P_CMU_CLKSTOP_CAM_LOWPWR, { 0x1, 0x1, 0x0 } },
42 S5P_CMU_CLKSTOP_LCD0_LOWPWR, 42 { S5P_CMU_CLKSTOP_TV_LOWPWR, { 0x1, 0x1, 0x0 } },
43 S5P_CMU_CLKSTOP_LCD1_LOWPWR, 43 { S5P_CMU_CLKSTOP_MFC_LOWPWR, { 0x1, 0x1, 0x0 } },
44 S5P_CMU_CLKSTOP_MAUDIO_LOWPWR, 44 { S5P_CMU_CLKSTOP_G3D_LOWPWR, { 0x1, 0x1, 0x0 } },
45 S5P_CMU_CLKSTOP_GPS_LOWPWR, 45 { S5P_CMU_CLKSTOP_LCD0_LOWPWR, { 0x1, 0x1, 0x0 } },
46 S5P_CMU_RESET_CAM_LOWPWR, 46 { S5P_CMU_CLKSTOP_LCD1_LOWPWR, { 0x1, 0x1, 0x0 } },
47 S5P_CMU_RESET_TV_LOWPWR, 47 { S5P_CMU_CLKSTOP_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
48 S5P_CMU_RESET_MFC_LOWPWR, 48 { S5P_CMU_CLKSTOP_GPS_LOWPWR, { 0x1, 0x1, 0x0 } },
49 S5P_CMU_RESET_G3D_LOWPWR, 49 { S5P_CMU_RESET_CAM_LOWPWR, { 0x1, 0x1, 0x0 } },
50 S5P_CMU_RESET_LCD0_LOWPWR, 50 { S5P_CMU_RESET_TV_LOWPWR, { 0x1, 0x1, 0x0 } },
51 S5P_CMU_RESET_LCD1_LOWPWR, 51 { S5P_CMU_RESET_MFC_LOWPWR, { 0x1, 0x1, 0x0 } },
52 S5P_CMU_RESET_MAUDIO_LOWPWR, 52 { S5P_CMU_RESET_G3D_LOWPWR, { 0x1, 0x1, 0x0 } },
53 S5P_CMU_RESET_GPS_LOWPWR, 53 { S5P_CMU_RESET_LCD0_LOWPWR, { 0x1, 0x1, 0x0 } },
54 S5P_TOP_BUS_LOWPWR, 54 { S5P_CMU_RESET_LCD1_LOWPWR, { 0x1, 0x1, 0x0 } },
55 S5P_TOP_RETENTION_LOWPWR, 55 { S5P_CMU_RESET_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
56 S5P_TOP_PWR_LOWPWR, 56 { S5P_CMU_RESET_GPS_LOWPWR, { 0x1, 0x1, 0x0 } },
57 S5P_LOGIC_RESET_LOWPWR, 57 { S5P_TOP_BUS_LOWPWR, { 0x3, 0x0, 0x0 } },
58 S5P_ONENAND_MEM_LOWPWR, 58 { S5P_TOP_RETENTION_LOWPWR, { 0x1, 0x0, 0x1 } },
59 S5P_MODIMIF_MEM_LOWPWR, 59 { S5P_TOP_PWR_LOWPWR, { 0x3, 0x0, 0x3 } },
60 S5P_G2D_ACP_MEM_LOWPWR, 60 { S5P_LOGIC_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
61 S5P_USBOTG_MEM_LOWPWR, 61 { S5P_ONENAND_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
62 S5P_HSMMC_MEM_LOWPWR, 62 { S5P_MODIMIF_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
63 S5P_CSSYS_MEM_LOWPWR, 63 { S5P_G2D_ACP_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
64 S5P_SECSS_MEM_LOWPWR, 64 { S5P_USBOTG_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
65 S5P_PCIE_MEM_LOWPWR, 65 { S5P_HSMMC_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
66 S5P_SATA_MEM_LOWPWR, 66 { S5P_CSSYS_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
67 S5P_PAD_RETENTION_DRAM_LOWPWR, 67 { S5P_SECSS_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
68 S5P_PAD_RETENTION_MAUDIO_LOWPWR, 68 { S5P_PCIE_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
69 S5P_PAD_RETENTION_GPIO_LOWPWR, 69 { S5P_SATA_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
70 S5P_PAD_RETENTION_UART_LOWPWR, 70 { S5P_PAD_RETENTION_DRAM_LOWPWR, { 0x1, 0x0, 0x0 } },
71 S5P_PAD_RETENTION_MMCA_LOWPWR, 71 { S5P_PAD_RETENTION_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
72 S5P_PAD_RETENTION_MMCB_LOWPWR, 72 { S5P_PAD_RETENTION_GPIO_LOWPWR, { 0x1, 0x0, 0x0 } },
73 S5P_PAD_RETENTION_EBIA_LOWPWR, 73 { S5P_PAD_RETENTION_UART_LOWPWR, { 0x1, 0x0, 0x0 } },
74 S5P_PAD_RETENTION_EBIB_LOWPWR, 74 { S5P_PAD_RETENTION_MMCA_LOWPWR, { 0x1, 0x0, 0x0 } },
75 S5P_PAD_RETENTION_ISOLATION_LOWPWR, 75 { S5P_PAD_RETENTION_MMCB_LOWPWR, { 0x1, 0x0, 0x0 } },
76 S5P_PAD_RETENTION_ALV_SEL_LOWPWR, 76 { S5P_PAD_RETENTION_EBIA_LOWPWR, { 0x1, 0x0, 0x0 } },
77 S5P_XUSBXTI_LOWPWR, 77 { S5P_PAD_RETENTION_EBIB_LOWPWR, { 0x1, 0x0, 0x0 } },
78 S5P_XXTI_LOWPWR, 78 { S5P_PAD_RETENTION_ISOLATION_LOWPWR, { 0x1, 0x0, 0x0 } },
79 S5P_EXT_REGULATOR_LOWPWR, 79 { S5P_PAD_RETENTION_ALV_SEL_LOWPWR, { 0x1, 0x0, 0x0 } },
80 S5P_GPIO_MODE_LOWPWR, 80 { S5P_XUSBXTI_LOWPWR, { 0x1, 0x1, 0x0 } },
81 S5P_GPIO_MODE_MAUDIO_LOWPWR, 81 { S5P_XXTI_LOWPWR, { 0x1, 0x1, 0x0 } },
82 S5P_CAM_LOWPWR, 82 { S5P_EXT_REGULATOR_LOWPWR, { 0x1, 0x1, 0x0 } },
83 S5P_TV_LOWPWR, 83 { S5P_GPIO_MODE_LOWPWR, { 0x1, 0x0, 0x0 } },
84 S5P_MFC_LOWPWR, 84 { S5P_GPIO_MODE_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
85 S5P_G3D_LOWPWR, 85 { S5P_CAM_LOWPWR, { 0x7, 0x0, 0x0 } },
86 S5P_LCD0_LOWPWR, 86 { S5P_TV_LOWPWR, { 0x7, 0x0, 0x0 } },
87 S5P_LCD1_LOWPWR, 87 { S5P_MFC_LOWPWR, { 0x7, 0x0, 0x0 } },
88 S5P_MAUDIO_LOWPWR, 88 { S5P_G3D_LOWPWR, { 0x7, 0x0, 0x0 } },
89 S5P_GPS_LOWPWR, 89 { S5P_LCD0_LOWPWR, { 0x7, 0x0, 0x0 } },
90 S5P_GPS_ALIVE_LOWPWR, 90 { S5P_LCD1_LOWPWR, { 0x7, 0x0, 0x0 } },
91 { S5P_MAUDIO_LOWPWR, { 0x7, 0x7, 0x0 } },
92 { S5P_GPS_LOWPWR, { 0x7, 0x0, 0x0 } },
93 { S5P_GPS_ALIVE_LOWPWR, { 0x7, 0x0, 0x0 } },
94 { PMU_TABLE_END,},
91}; 95};
92 96
93static const unsigned int sys_powerdown_val[][NUM_SYS_POWERDOWN] = { 97static struct exynos4_pmu_conf exynos4212_pmu_config[] = {
94 /* { AFTR, LPA, SLEEP }*/ 98 { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
95 { 0, 0, 2 }, /* ARM_CORE0 */ 99 { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } },
96 { 0, 0, 0 }, /* ARM_DIS_IRQ_CORE0 */ 100 { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
97 { 0, 0, 0 }, /* ARM_DIS_IRQ_CENTRAL0 */ 101 { S5P_ARM_CORE1_LOWPWR, { 0x0, 0x0, 0x2 } },
98 { 0, 0, 2 }, /* ARM_CORE1 */ 102 { S5P_DIS_IRQ_CORE1, { 0x0, 0x0, 0x0 } },
99 { 0, 0, 0 }, /* ARM_DIS_IRQ_CORE1 */ 103 { S5P_DIS_IRQ_CENTRAL1, { 0x0, 0x0, 0x0 } },
100 { 0, 0, 0 }, /* ARM_DIS_IRQ_CENTRAL1 */ 104 { S5P_ISP_ARM_LOWPWR, { 0x1, 0x0, 0x0 } },
101 { 0, 0, 2 }, /* ARM_COMMON */ 105 { S5P_DIS_IRQ_ISP_ARM_LOCAL_LOWPWR, { 0x0, 0x0, 0x0 } },
102 { 2, 2, 3 }, /* ARM_CPU_L2_0 */ 106 { S5P_DIS_IRQ_ISP_ARM_CENTRAL_LOWPWR, { 0x0, 0x0, 0x0 } },
103 { 2, 2, 3 }, /* ARM_CPU_L2_1 */ 107 { S5P_ARM_COMMON_LOWPWR, { 0x0, 0x0, 0x2 } },
104 { 1, 0, 0 }, /* CMU_ACLKSTOP */ 108 { S5P_L2_0_LOWPWR, { 0x0, 0x0, 0x3 } },
105 { 1, 0, 0 }, /* CMU_SCLKSTOP */ 109 /* XXX_OPTION register should be set other field */
106 { 1, 1, 0 }, /* CMU_RESET */ 110 { S5P_ARM_L2_0_OPTION, { 0x10, 0x10, 0x0 } },
107 { 1, 0, 0 }, /* APLL_SYSCLK */ 111 { S5P_L2_1_LOWPWR, { 0x0, 0x0, 0x3 } },
108 { 1, 0, 0 }, /* MPLL_SYSCLK */ 112 { S5P_ARM_L2_1_OPTION, { 0x10, 0x10, 0x0 } },
109 { 1, 0, 0 }, /* VPLL_SYSCLK */ 113 { S5P_CMU_ACLKSTOP_LOWPWR, { 0x1, 0x0, 0x0 } },
110 { 1, 1, 0 }, /* EPLL_SYSCLK */ 114 { S5P_CMU_SCLKSTOP_LOWPWR, { 0x1, 0x0, 0x0 } },
111 { 1, 1, 0 }, /* CMU_CLKSTOP_GPS_ALIVE */ 115 { S5P_CMU_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
112 { 1, 1, 0 }, /* CMU_RESET_GPS_ALIVE */ 116 { S5P_DRAM_FREQ_DOWN_LOWPWR, { 0x1, 0x1, 0x1 } },
113 { 1, 1, 0 }, /* CMU_CLKSTOP_CAM */ 117 { S5P_DDRPHY_DLLOFF_LOWPWR, { 0x1, 0x1, 0x1 } },
114 { 1, 1, 0 }, /* CMU_CLKSTOP_TV */ 118 { S5P_LPDDR_PHY_DLL_LOCK_LOWPWR, { 0x1, 0x1, 0x1 } },
115 { 1, 1, 0 }, /* CMU_CLKSTOP_MFC */ 119 { S5P_CMU_ACLKSTOP_COREBLK_LOWPWR, { 0x1, 0x0, 0x0 } },
116 { 1, 1, 0 }, /* CMU_CLKSTOP_G3D */ 120 { S5P_CMU_SCLKSTOP_COREBLK_LOWPWR, { 0x1, 0x0, 0x0 } },
117 { 1, 1, 0 }, /* CMU_CLKSTOP_LCD0 */ 121 { S5P_CMU_RESET_COREBLK_LOWPWR, { 0x1, 0x1, 0x0 } },
118 { 1, 1, 0 }, /* CMU_CLKSTOP_LCD1 */ 122 { S5P_APLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
119 { 1, 1, 0 }, /* CMU_CLKSTOP_MAUDIO */ 123 { S5P_MPLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
120 { 1, 1, 0 }, /* CMU_CLKSTOP_GPS */ 124 { S5P_VPLL_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
121 { 1, 1, 0 }, /* CMU_RESET_CAM */ 125 { S5P_EPLL_SYSCLK_LOWPWR, { 0x1, 0x1, 0x0 } },
122 { 1, 1, 0 }, /* CMU_RESET_TV */ 126 { S5P_MPLLUSER_SYSCLK_LOWPWR, { 0x1, 0x0, 0x0 } },
123 { 1, 1, 0 }, /* CMU_RESET_MFC */ 127 { S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, { 0x1, 0x0, 0x0 } },
124 { 1, 1, 0 }, /* CMU_RESET_G3D */ 128 { S5P_CMU_RESET_GPSALIVE_LOWPWR, { 0x1, 0x0, 0x0 } },
125 { 1, 1, 0 }, /* CMU_RESET_LCD0 */ 129 { S5P_CMU_CLKSTOP_CAM_LOWPWR, { 0x1, 0x0, 0x0 } },
126 { 1, 1, 0 }, /* CMU_RESET_LCD1 */ 130 { S5P_CMU_CLKSTOP_TV_LOWPWR, { 0x1, 0x0, 0x0 } },
127 { 1, 1, 0 }, /* CMU_RESET_MAUDIO */ 131 { S5P_CMU_CLKSTOP_MFC_LOWPWR, { 0x1, 0x0, 0x0 } },
128 { 1, 1, 0 }, /* CMU_RESET_GPS */ 132 { S5P_CMU_CLKSTOP_G3D_LOWPWR, { 0x1, 0x0, 0x0 } },
129 { 3, 0, 0 }, /* TOP_BUS */ 133 { S5P_CMU_CLKSTOP_LCD0_LOWPWR, { 0x1, 0x0, 0x0 } },
130 { 1, 0, 1 }, /* TOP_RETENTION */ 134 { S5P_CMU_CLKSTOP_ISP_LOWPWR, { 0x1, 0x0, 0x0 } },
131 { 3, 0, 3 }, /* TOP_PWR */ 135 { S5P_CMU_CLKSTOP_MAUDIO_LOWPWR, { 0x1, 0x0, 0x0 } },
132 { 1, 1, 0 }, /* LOGIC_RESET */ 136 { S5P_CMU_CLKSTOP_GPS_LOWPWR, { 0x1, 0x0, 0x0 } },
133 { 3, 0, 0 }, /* ONENAND_MEM */ 137 { S5P_CMU_RESET_CAM_LOWPWR, { 0x1, 0x0, 0x0 } },
134 { 3, 0, 0 }, /* MODIMIF_MEM */ 138 { S5P_CMU_RESET_TV_LOWPWR, { 0x1, 0x0, 0x0 } },
135 { 3, 0, 0 }, /* G2D_ACP_MEM */ 139 { S5P_CMU_RESET_MFC_LOWPWR, { 0x1, 0x0, 0x0 } },
136 { 3, 0, 0 }, /* USBOTG_MEM */ 140 { S5P_CMU_RESET_G3D_LOWPWR, { 0x1, 0x0, 0x0 } },
137 { 3, 0, 0 }, /* HSMMC_MEM */ 141 { S5P_CMU_RESET_LCD0_LOWPWR, { 0x1, 0x0, 0x0 } },
138 { 3, 0, 0 }, /* CSSYS_MEM */ 142 { S5P_CMU_RESET_ISP_LOWPWR, { 0x1, 0x0, 0x0 } },
139 { 3, 0, 0 }, /* SECSS_MEM */ 143 { S5P_CMU_RESET_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
140 { 3, 0, 0 }, /* PCIE_MEM */ 144 { S5P_CMU_RESET_GPS_LOWPWR, { 0x1, 0x0, 0x0 } },
141 { 3, 0, 0 }, /* SATA_MEM */ 145 { S5P_TOP_BUS_LOWPWR, { 0x3, 0x0, 0x0 } },
142 { 1, 0, 0 }, /* PAD_RETENTION_DRAM */ 146 { S5P_TOP_RETENTION_LOWPWR, { 0x1, 0x0, 0x1 } },
143 { 1, 1, 0 }, /* PAD_RETENTION_MAUDIO */ 147 { S5P_TOP_PWR_LOWPWR, { 0x3, 0x0, 0x3 } },
144 { 1, 0, 0 }, /* PAD_RETENTION_GPIO */ 148 { S5P_TOP_BUS_COREBLK_LOWPWR, { 0x3, 0x0, 0x0 } },
145 { 1, 0, 0 }, /* PAD_RETENTION_UART */ 149 { S5P_TOP_RETENTION_COREBLK_LOWPWR, { 0x1, 0x0, 0x1 } },
146 { 1, 0, 0 }, /* PAD_RETENTION_MMCA */ 150 { S5P_TOP_PWR_COREBLK_LOWPWR, { 0x3, 0x0, 0x3 } },
147 { 1, 0, 0 }, /* PAD_RETENTION_MMCB */ 151 { S5P_LOGIC_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
148 { 1, 0, 0 }, /* PAD_RETENTION_EBIA */ 152 { S5P_OSCCLK_GATE_LOWPWR, { 0x1, 0x0, 0x1 } },
149 { 1, 0, 0 }, /* PAD_RETENTION_EBIB */ 153 { S5P_LOGIC_RESET_COREBLK_LOWPWR, { 0x1, 0x1, 0x0 } },
150 { 1, 0, 0 }, /* PAD_RETENTION_ISOLATION */ 154 { S5P_OSCCLK_GATE_COREBLK_LOWPWR, { 0x1, 0x0, 0x1 } },
151 { 1, 0, 0 }, /* PAD_RETENTION_ALV_SEL */ 155 { S5P_ONENAND_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
152 { 1, 1, 0 }, /* XUSBXTI */ 156 { S5P_ONENAND_MEM_OPTION, { 0x10, 0x10, 0x0 } },
153 { 1, 1, 0 }, /* XXTI */ 157 { S5P_HSI_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
154 { 1, 1, 0 }, /* EXT_REGULATOR */ 158 { S5P_HSI_MEM_OPTION, { 0x10, 0x10, 0x0 } },
155 { 1, 0, 0 }, /* GPIO_MODE */ 159 { S5P_G2D_ACP_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
156 { 1, 1, 0 }, /* GPIO_MODE_MAUDIO */ 160 { S5P_G2D_ACP_MEM_OPTION, { 0x10, 0x10, 0x0 } },
157 { 7, 0, 0 }, /* CAM */ 161 { S5P_USBOTG_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
158 { 7, 0, 0 }, /* TV */ 162 { S5P_USBOTG_MEM_OPTION, { 0x10, 0x10, 0x0 } },
159 { 7, 0, 0 }, /* MFC */ 163 { S5P_HSMMC_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
160 { 7, 0, 0 }, /* G3D */ 164 { S5P_HSMMC_MEM_OPTION, { 0x10, 0x10, 0x0 } },
161 { 7, 0, 0 }, /* LCD0 */ 165 { S5P_CSSYS_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
162 { 7, 0, 0 }, /* LCD1 */ 166 { S5P_CSSYS_MEM_OPTION, { 0x10, 0x10, 0x0 } },
163 { 7, 7, 0 }, /* MAUDIO */ 167 { S5P_SECSS_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
164 { 7, 0, 0 }, /* GPS */ 168 { S5P_SECSS_MEM_OPTION, { 0x10, 0x10, 0x0 } },
165 { 7, 0, 0 }, /* GPS_ALIVE */ 169 { S5P_ROTATOR_MEM_LOWPWR, { 0x3, 0x0, 0x0 } },
170 { S5P_ROTATOR_MEM_OPTION, { 0x10, 0x10, 0x0 } },
171 { S5P_PAD_RETENTION_DRAM_LOWPWR, { 0x1, 0x0, 0x0 } },
172 { S5P_PAD_RETENTION_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
173 { S5P_PAD_RETENTION_GPIO_LOWPWR, { 0x1, 0x0, 0x0 } },
174 { S5P_PAD_RETENTION_UART_LOWPWR, { 0x1, 0x0, 0x0 } },
175 { S5P_PAD_RETENTION_MMCA_LOWPWR, { 0x1, 0x0, 0x0 } },
176 { S5P_PAD_RETENTION_MMCB_LOWPWR, { 0x1, 0x0, 0x0 } },
177 { S5P_PAD_RETENTION_EBIA_LOWPWR, { 0x1, 0x0, 0x0 } },
178 { S5P_PAD_RETENTION_EBIB_LOWPWR, { 0x1, 0x0, 0x0 } },
179 { S5P_PAD_RETENTION_GPIO_COREBLK_LOWPWR,{ 0x1, 0x0, 0x0 } },
180 { S5P_PAD_RETENTION_ISOLATION_LOWPWR, { 0x1, 0x0, 0x0 } },
181 { S5P_PAD_ISOLATION_COREBLK_LOWPWR, { 0x1, 0x0, 0x0 } },
182 { S5P_PAD_RETENTION_ALV_SEL_LOWPWR, { 0x1, 0x0, 0x0 } },
183 { S5P_XUSBXTI_LOWPWR, { 0x1, 0x1, 0x0 } },
184 { S5P_XXTI_LOWPWR, { 0x1, 0x1, 0x0 } },
185 { S5P_EXT_REGULATOR_LOWPWR, { 0x1, 0x1, 0x0 } },
186 { S5P_GPIO_MODE_LOWPWR, { 0x1, 0x0, 0x0 } },
187 { S5P_GPIO_MODE_COREBLK_LOWPWR, { 0x1, 0x0, 0x0 } },
188 { S5P_GPIO_MODE_MAUDIO_LOWPWR, { 0x1, 0x1, 0x0 } },
189 { S5P_TOP_ASB_RESET_LOWPWR, { 0x1, 0x1, 0x1 } },
190 { S5P_TOP_ASB_ISOLATION_LOWPWR, { 0x1, 0x0, 0x1 } },
191 { S5P_CAM_LOWPWR, { 0x7, 0x0, 0x0 } },
192 { S5P_TV_LOWPWR, { 0x7, 0x0, 0x0 } },
193 { S5P_MFC_LOWPWR, { 0x7, 0x0, 0x0 } },
194 { S5P_G3D_LOWPWR, { 0x7, 0x0, 0x0 } },
195 { S5P_LCD0_LOWPWR, { 0x7, 0x0, 0x0 } },
196 { S5P_ISP_LOWPWR, { 0x7, 0x0, 0x0 } },
197 { S5P_MAUDIO_LOWPWR, { 0x7, 0x7, 0x0 } },
198 { S5P_GPS_LOWPWR, { 0x7, 0x0, 0x0 } },
199 { S5P_GPS_ALIVE_LOWPWR, { 0x7, 0x0, 0x0 } },
200 { S5P_CMU_SYSCLK_ISP_LOWPWR, { 0x1, 0x0, 0x0 } },
201 { S5P_CMU_SYSCLK_GPS_LOWPWR, { 0x1, 0x0, 0x0 } },
202 { PMU_TABLE_END,},
166}; 203};
167 204
168void exynos4_sys_powerdown_conf(enum sys_powerdown mode) 205void exynos4_sys_powerdown_conf(enum sys_powerdown mode)
169{ 206{
170 unsigned int count = ARRAY_SIZE(sys_powerdown_reg); 207 unsigned int i;
208
209 for (i = 0; (exynos4_pmu_config[i].reg != PMU_TABLE_END) ; i++)
210 __raw_writel(exynos4_pmu_config[i].val[mode],
211 exynos4_pmu_config[i].reg);
212}
213
214static int __init exynos4_pmu_init(void)
215{
216 exynos4_pmu_config = exynos4210_pmu_config;
217
218 if (soc_is_exynos4210()) {
219 exynos4_pmu_config = exynos4210_pmu_config;
220 pr_info("EXYNOS4210 PMU Initialize\n");
221 } else if (soc_is_exynos4212()) {
222 exynos4_pmu_config = exynos4212_pmu_config;
223 pr_info("EXYNOS4212 PMU Initialize\n");
224 } else {
225 pr_info("EXYNOS4: PMU not supported\n");
226 }
171 227
172 for (; count > 0; count--) 228 return 0;
173 __raw_writel(sys_powerdown_val[count - 1][mode],
174 sys_powerdown_reg[count - 1]);
175} 229}
230arch_initcall(exynos4_pmu_init);
diff --git a/arch/arm/mach-exynos4/setup-sdhci.c b/arch/arm/mach-exynos4/setup-sdhci.c
index 1e83f8cf236d..92937b410906 100644
--- a/arch/arm/mach-exynos4/setup-sdhci.c
+++ b/arch/arm/mach-exynos4/setup-sdhci.c
@@ -10,16 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/kernel.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <linux/mmc/card.h>
20#include <linux/mmc/host.h>
21
22#include <plat/regs-sdhci.h>
23 14
24/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 15/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
25 16
@@ -29,41 +20,3 @@ char *exynos4_hsmmc_clksrcs[4] = {
29 [2] = "sclk_mmc", /* mmc_bus */ 20 [2] = "sclk_mmc", /* mmc_bus */
30 [3] = NULL, 21 [3] = NULL,
31}; 22};
32
33void exynos4_setup_sdhci_cfg_card(struct platform_device *dev, void __iomem *r,
34 struct mmc_ios *ios, struct mmc_card *card)
35{
36 u32 ctrl2, ctrl3;
37
38 /* don't need to alter anything according to card-type */
39
40 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
41
42 /* select base clock source to HCLK */
43
44 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
45
46 /*
47 * clear async mode, enable conflict mask, rx feedback ctrl, SD
48 * clk hold and no use debounce count
49 */
50
51 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
52 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
53 S3C_SDHCI_CTRL2_ENFBCLKRX |
54 S3C_SDHCI_CTRL2_DFCNT_NONE |
55 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
56
57 /* Tx and Rx feedback clock delay control */
58
59 if (ios->clock < 25 * 1000000)
60 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
61 S3C_SDHCI_CTRL3_FCSEL2 |
62 S3C_SDHCI_CTRL3_FCSEL1 |
63 S3C_SDHCI_CTRL3_FCSEL0);
64 else
65 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
66
67 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
68 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
69}
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 3700cf32af0f..5261a7ed0999 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -6,7 +6,6 @@ config CPU_S3C2410
6 bool 6 bool
7 depends on ARCH_S3C2410 7 depends on ARCH_S3C2410
8 select CPU_ARM920T 8 select CPU_ARM920T
9 select S3C_GPIO_PULL_UP
10 select S3C2410_CLOCK 9 select S3C2410_CLOCK
11 select CPU_LLSERIAL_S3C2410 10 select CPU_LLSERIAL_S3C2410
12 select S3C2410_PM if PM 11 select S3C2410_PM if PM
diff --git a/arch/arm/mach-s3c2410/include/mach/fb.h b/arch/arm/mach-s3c2410/include/mach/fb.h
index eee0654eb8fb..a957bc8ed44f 100644
--- a/arch/arm/mach-s3c2410/include/mach/fb.h
+++ b/arch/arm/mach-s3c2410/include/mach/fb.h
@@ -1,74 +1 @@
1/* arch/arm/mach-s3c2410/include/mach/fb.h #include <plat/fb-s3c2410.h>
2 *
3 * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
4 *
5 * Inspired by pxafb.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#ifndef __ASM_ARM_FB_H
13#define __ASM_ARM_FB_H
14
15#include <mach/regs-lcd.h>
16
17struct s3c2410fb_hw {
18 unsigned long lcdcon1;
19 unsigned long lcdcon2;
20 unsigned long lcdcon3;
21 unsigned long lcdcon4;
22 unsigned long lcdcon5;
23};
24
25/* LCD description */
26struct s3c2410fb_display {
27 /* LCD type */
28 unsigned type;
29
30 /* Screen size */
31 unsigned short width;
32 unsigned short height;
33
34 /* Screen info */
35 unsigned short xres;
36 unsigned short yres;
37 unsigned short bpp;
38
39 unsigned pixclock; /* pixclock in picoseconds */
40 unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */
41 unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
42 unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */
43 unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */
44 unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */
45 unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */
46
47 /* lcd configuration registers */
48 unsigned long lcdcon5;
49};
50
51struct s3c2410fb_mach_info {
52
53 struct s3c2410fb_display *displays; /* attached diplays info */
54 unsigned num_displays; /* number of defined displays */
55 unsigned default_display;
56
57 /* GPIOs */
58
59 unsigned long gpcup;
60 unsigned long gpcup_mask;
61 unsigned long gpccon;
62 unsigned long gpccon_mask;
63 unsigned long gpdup;
64 unsigned long gpdup_mask;
65 unsigned long gpdcon;
66 unsigned long gpdcon_mask;
67
68 /* lpc3600 control register */
69 unsigned long lpcsel;
70};
71
72extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
73
74#endif /* __ASM_ARM_FB_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
index bab139201761..c53ad34c6579 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
@@ -1,98 +1 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h #include <plat/gpio-fns.h>
2 *
3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - hardware
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __MACH_GPIO_FNS_H
14#define __MACH_GPIO_FNS_H __FILE__
15
16/* These functions are in the to-be-removed category and it is strongly
17 * encouraged not to use these in new code. They will be marked deprecated
18 * very soon.
19 *
20 * Most of the functionality can be either replaced by the gpiocfg calls
21 * for the s3c platform or by the generic GPIOlib API.
22 *
23 * As of 2.6.35-rc, these will be removed, with the few drivers using them
24 * either replaced or given a wrapper until the calls can be removed.
25*/
26
27#include <plat/gpio-cfg.h>
28
29static inline void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int cfg)
30{
31 /* 1:1 mapping between cfgpin and setcfg calls at the moment */
32 s3c_gpio_cfgpin(pin, cfg);
33}
34
35/* external functions for GPIO support
36 *
37 * These allow various different clients to access the same GPIO
38 * registers without conflicting. If your driver only owns the entire
39 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
40*/
41
42extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
43
44/* s3c2410_gpio_getirq
45 *
46 * turn the given pin number into the corresponding IRQ number
47 *
48 * returns:
49 * < 0 = no interrupt for this pin
50 * >=0 = interrupt number for the pin
51*/
52
53extern int s3c2410_gpio_getirq(unsigned int pin);
54
55/* s3c2410_gpio_irqfilter
56 *
57 * set the irq filtering on the given pin
58 *
59 * on = 0 => disable filtering
60 * 1 => enable filtering
61 *
62 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
63 * width of filter (0 through 63)
64 *
65 *
66*/
67
68extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
69 unsigned int config);
70
71/* s3c2410_gpio_pullup
72 *
73 * This call should be replaced with s3c_gpio_setpull().
74 *
75 * As a note, there is currently no distinction between pull-up and pull-down
76 * in the s3c24xx series devices with only an on/off configuration.
77 */
78
79/* s3c2410_gpio_pullup
80 *
81 * configure the pull-up control on the given pin
82 *
83 * to = 1 => disable the pull-up
84 * 0 => enable the pull-up
85 *
86 * eg;
87 *
88 * s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
89 * s3c2410_gpio_pullup(S3C2410_GPE(8), 0);
90*/
91
92extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
93
94extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
95
96extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
97
98#endif /* __MACH_GPIO_FNS_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-track.h b/arch/arm/mach-s3c2410/include/mach/gpio-track.h
index d67819dde42a..c410a078622c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-track.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-track.h
@@ -17,11 +17,11 @@
17 17
18#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
19 19
20extern struct s3c_gpio_chip s3c24xx_gpios[]; 20extern struct samsung_gpio_chip s3c24xx_gpios[];
21 21
22static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin) 22static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int pin)
23{ 23{
24 struct s3c_gpio_chip *chip; 24 struct samsung_gpio_chip *chip;
25 25
26 if (pin > S3C_GPIO_END) 26 if (pin > S3C_GPIO_END)
27 return NULL; 27 return NULL;
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index e5a68ea13113..e53b2177319e 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -191,9 +191,9 @@
191#define IRQ_LCD_SYSTEM IRQ_S3C2443_LCD2 191#define IRQ_LCD_SYSTEM IRQ_S3C2443_LCD2
192 192
193#ifdef CONFIG_CPU_S3C2440 193#ifdef CONFIG_CPU_S3C2440
194#define IRQ_S3C244x_AC97 IRQ_S3C2440_AC97 194#define IRQ_S3C244X_AC97 IRQ_S3C2440_AC97
195#else 195#else
196#define IRQ_S3C244x_AC97 IRQ_S3C2443_AC97 196#define IRQ_S3C244X_AC97 IRQ_S3C2443_AC97
197#endif 197#endif
198 198
199/* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ 199/* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index 4cf495f813a7..78ae807f1281 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -149,6 +149,7 @@
149#define S3C24XX_PA_RTC S3C2410_PA_RTC 149#define S3C24XX_PA_RTC S3C2410_PA_RTC
150#define S3C24XX_PA_ADC S3C2410_PA_ADC 150#define S3C24XX_PA_ADC S3C2410_PA_ADC
151#define S3C24XX_PA_SPI S3C2410_PA_SPI 151#define S3C24XX_PA_SPI S3C2410_PA_SPI
152#define S3C24XX_PA_SPI1 (S3C2410_PA_SPI + S3C2410_SPI1)
152#define S3C24XX_PA_SDI S3C2410_PA_SDI 153#define S3C24XX_PA_SDI S3C2410_PA_SDI
153#define S3C24XX_PA_NAND S3C2410_PA_NAND 154#define S3C24XX_PA_NAND S3C2410_PA_NAND
154 155
diff --git a/arch/arm/mach-s3c2410/include/mach/pm-core.h b/arch/arm/mach-s3c2410/include/mach/pm-core.h
index 45eea5210c87..2eef7e6f7675 100644
--- a/arch/arm/mach-s3c2410/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/pm-core.h
@@ -64,4 +64,4 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
64} 64}
65 65
66static inline void s3c_pm_restored_gpios(void) { } 66static inline void s3c_pm_restored_gpios(void) { }
67static inline void s3c_pm_saved_gpios(void) { } 67static inline void samsung_pm_saved_gpios(void) { }
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
index 5e06c7265835..df6434f326f0 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
@@ -102,6 +102,7 @@
102#define S3C2443_PCLKCON_UART3 (1<<3) 102#define S3C2443_PCLKCON_UART3 (1<<3)
103#define S3C2443_PCLKCON_IIC (1<<4) 103#define S3C2443_PCLKCON_IIC (1<<4)
104#define S3C2443_PCLKCON_SDI (1<<5) 104#define S3C2443_PCLKCON_SDI (1<<5)
105#define S3C2443_PCLKCON_HSSPI (1<<6)
105#define S3C2443_PCLKCON_ADC (1<<7) 106#define S3C2443_PCLKCON_ADC (1<<7)
106#define S3C2443_PCLKCON_AC97 (1<<8) 107#define S3C2443_PCLKCON_AC97 (1<<8)
107#define S3C2443_PCLKCON_IIS (1<<9) 108#define S3C2443_PCLKCON_IIS (1<<9)
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 556c535829f0..caa4ae29ec79 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -696,9 +696,9 @@ static void __init h1940_init(void)
696 S3C2410_MISCCR_USBSUSPND0 | 696 S3C2410_MISCCR_USBSUSPND0 |
697 S3C2410_MISCCR_USBSUSPND1, 0x0); 697 S3C2410_MISCCR_USBSUSPND1, 0x0);
698 698
699 tmp = (0x78 << S3C24XX_PLLCON_MDIVSHIFT) 699 tmp = (0x78 << S3C24XX_PLL_MDIV_SHIFT)
700 | (0x02 << S3C24XX_PLLCON_PDIVSHIFT) 700 | (0x02 << S3C24XX_PLL_PDIV_SHIFT)
701 | (0x03 << S3C24XX_PLLCON_SDIVSHIFT); 701 | (0x03 << S3C24XX_PLL_SDIV_SHIFT);
702 writel(tmp, S3C2410_UPLLCON); 702 writel(tmp, S3C2410_UPLLCON);
703 703
704 gpio_request(S3C2410_GPC(0), "LCD power"); 704 gpio_request(S3C2410_GPC(0), "LCD power");
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 367d376deb96..451852156254 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -49,6 +49,7 @@
49 49
50#include <mach/regs-gpio.h> 50#include <mach/regs-gpio.h>
51#include <mach/leds-gpio.h> 51#include <mach/leds-gpio.h>
52#include <mach/regs-lcd.h>
52#include <plat/regs-serial.h> 53#include <plat/regs-serial.h>
53#include <mach/fb.h> 54#include <mach/fb.h>
54#include <plat/nand.h> 55#include <plat/nand.h>
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index 343a540d86a9..3d7ebc557a72 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -72,8 +72,8 @@ void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
72 72
73void __init s3c2410_map_io(void) 73void __init s3c2410_map_io(void)
74{ 74{
75 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; 75 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
76 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; 76 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
77 77
78 iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); 78 iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
79} 79}
diff --git a/arch/arm/mach-s3c2412/gpio.c b/arch/arm/mach-s3c2412/gpio.c
new file mode 100644
index 000000000000..4526f6ba31a8
--- /dev/null
+++ b/arch/arm/mach-s3c2412/gpio.c
@@ -0,0 +1,62 @@
1/* linux/arch/arm/mach-s3c2412/gpio.c
2 *
3 * Copyright (c) 2007 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://armlinux.simtec.co.uk/.
7 *
8 * S3C2412/S3C2413 specific GPIO support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/module.h>
18#include <linux/interrupt.h>
19#include <linux/gpio.h>
20
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23
24#include <mach/regs-gpio.h>
25#include <mach/hardware.h>
26
27#include <plat/gpio-core.h>
28
29int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state)
30{
31 struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
32 unsigned long offs = pin - chip->chip.base;
33 unsigned long flags;
34 unsigned long slpcon;
35
36 offs *= 2;
37
38 if (pin < S3C2410_GPB(0))
39 return -EINVAL;
40
41 if (pin >= S3C2410_GPF(0) &&
42 pin <= S3C2410_GPG(16))
43 return -EINVAL;
44
45 if (pin > S3C2410_GPH(16))
46 return -EINVAL;
47
48 local_irq_save(flags);
49
50 slpcon = __raw_readl(chip->base + 0x0C);
51
52 slpcon &= ~(3 << offs);
53 slpcon |= state << offs;
54
55 __raw_writel(slpcon, chip->base + 0x0C);
56
57 local_irq_restore(flags);
58
59 return 0;
60}
61
62EXPORT_SYMBOL(s3c2412_gpio_set_sleepcfg);
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
index 69b48a7d1dbd..84c7b03e5a30 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -13,7 +13,6 @@ config CPU_S3C2416
13 select CPU_ARM926T 13 select CPU_ARM926T
14 select S3C2416_DMA if S3C2410_DMA 14 select S3C2416_DMA if S3C2410_DMA
15 select CPU_LLSERIAL_S3C2440 15 select CPU_LLSERIAL_S3C2440
16 select S3C_GPIO_PULL_UPDOWN
17 select SAMSUNG_CLKSRC 16 select SAMSUNG_CLKSRC
18 select S3C2443_CLOCK 17 select S3C2443_CLOCK
19 help 18 help
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c2416/clock.c
index 21a5e81f0ab5..72b7c6274c79 100644
--- a/arch/arm/mach-s3c2416/clock.c
+++ b/arch/arm/mach-s3c2416/clock.c
@@ -21,7 +21,6 @@
21#include <plat/cpu.h> 21#include <plat/cpu.h>
22 22
23#include <plat/cpu-freq.h> 23#include <plat/cpu-freq.h>
24#include <plat/pll6553x.h>
25#include <plat/pll.h> 24#include <plat/pll.h>
26 25
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -38,6 +37,32 @@ static unsigned int armdiv[8] = {
38 [7] = 8, 37 [7] = 8,
39}; 38};
40 39
40static struct clksrc_clk hsspi_eplldiv = {
41 .clk = {
42 .name = "hsspi-eplldiv",
43 .parent = &clk_esysclk.clk,
44 .ctrlbit = (1 << 14),
45 .enable = s3c2443_clkcon_enable_s,
46 },
47 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 24 },
48};
49
50static struct clk *hsspi_sources[] = {
51 [0] = &hsspi_eplldiv.clk,
52 [1] = NULL, /* to fix */
53};
54
55static struct clksrc_clk hsspi_mux = {
56 .clk = {
57 .name = "hsspi-if",
58 },
59 .sources = &(struct clksrc_sources) {
60 .sources = hsspi_sources,
61 .nr_sources = ARRAY_SIZE(hsspi_sources),
62 },
63 .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 18 },
64};
65
41static struct clksrc_clk hsmmc_div[] = { 66static struct clksrc_clk hsmmc_div[] = {
42 [0] = { 67 [0] = {
43 .clk = { 68 .clk = {
@@ -114,6 +139,8 @@ void __init_or_cpufreq s3c2416_setup_clocks(void)
114 139
115 140
116static struct clksrc_clk *clksrcs[] __initdata = { 141static struct clksrc_clk *clksrcs[] __initdata = {
142 &hsspi_eplldiv,
143 &hsspi_mux,
117 &hsmmc_div[0], 144 &hsmmc_div[0],
118 &hsmmc_div[1], 145 &hsmmc_div[1],
119 &hsmmc_mux[0], 146 &hsmmc_mux[0],
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 20b3fdfb3051..7dbee81c8908 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -120,8 +120,8 @@ void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
120 120
121void __init s3c2416_map_io(void) 121void __init s3c2416_map_io(void)
122{ 122{
123 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; 123 s3c24xx_gpiocfg_default.set_pull = samsung_gpio_setpull_updown;
124 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; 124 s3c24xx_gpiocfg_default.get_pull = samsung_gpio_getpull_updown;
125 125
126 /* initialize device information early */ 126 /* initialize device information early */
127 s3c2416_default_sdhci0(); 127 s3c2416_default_sdhci0();
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
index ed34fad8f2c6..cee53955eb02 100644
--- a/arch/arm/mach-s3c2416/setup-sdhci.c
+++ b/arch/arm/mach-s3c2416/setup-sdhci.c
@@ -12,17 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15#include <linux/kernel.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23
24#include <plat/regs-sdhci.h>
25#include <plat/sdhci.h>
26 16
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 17/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28 18
@@ -32,30 +22,3 @@ char *s3c2416_hsmmc_clksrcs[4] = {
32 [2] = "hsmmc-if", 22 [2] = "hsmmc-if",
33 /* [3] = "48m", - note not successfully used yet */ 23 /* [3] = "48m", - note not successfully used yet */
34}; 24};
35
36void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 ctrl2 = __raw_readl(r + S3C_SDHCI_CONTROL2);
44 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
45 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
46 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
47 S3C_SDHCI_CTRL2_ENFBCLKRX |
48 S3C_SDHCI_CTRL2_DFCNT_NONE |
49 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
50
51 if (ios->clock < 25 * 1000000)
52 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
53 S3C_SDHCI_CTRL3_FCSEL2 |
54 S3C_SDHCI_CTRL3_FCSEL1 |
55 S3C_SDHCI_CTRL3_FCSEL0);
56 else
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
58
59 __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2);
60 __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3);
61}
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index c461fb8e15c0..914e620f1257 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -5,7 +5,6 @@
5config CPU_S3C2440 5config CPU_S3C2440
6 bool 6 bool
7 select CPU_ARM920T 7 select CPU_ARM920T
8 select S3C_GPIO_PULL_UP
9 select S3C2410_CLOCK 8 select S3C2410_CLOCK
10 select S3C2410_PM if PM 9 select S3C2410_PM if PM
11 select S3C2440_DMA if S3C2410_DMA 10 select S3C2440_DMA if S3C2410_DMA
@@ -17,7 +16,6 @@ config CPU_S3C2440
17config CPU_S3C2442 16config CPU_S3C2442
18 bool 17 bool
19 select CPU_ARM920T 18 select CPU_ARM920T
20 select S3C_GPIO_PULL_DOWN
21 select S3C2410_CLOCK 19 select S3C2410_CLOCK
22 select S3C2410_PM if PM 20 select S3C2410_PM if PM
23 select CPU_S3C244X 21 select CPU_S3C244X
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index 684dbb3567f5..0d3453bf567c 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -43,6 +43,7 @@
43 43
44#include <mach/regs-gpio.h> 44#include <mach/regs-gpio.h>
45#include <mach/regs-gpioj.h> 45#include <mach/regs-gpioj.h>
46#include <mach/regs-lcd.h>
46#include <mach/h1940.h> 47#include <mach/h1940.h>
47#include <mach/fb.h> 48#include <mach/fb.h>
48 49
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
index 2270d3360216..37f8cc6aabd4 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c2440/s3c2440.c
@@ -70,6 +70,6 @@ void __init s3c2440_map_io(void)
70{ 70{
71 s3c244x_map_io(); 71 s3c244x_map_io();
72 72
73 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; 73 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
74 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; 74 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
75} 75}
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c
index 6f2b65e6e068..2c822e09392f 100644
--- a/arch/arm/mach-s3c2440/s3c2442.c
+++ b/arch/arm/mach-s3c2440/s3c2442.c
@@ -182,6 +182,6 @@ void __init s3c2442_map_io(void)
182{ 182{
183 s3c244x_map_io(); 183 s3c244x_map_io();
184 184
185 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1down; 185 s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1down;
186 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1down; 186 s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1down;
187} 187}
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index d8eb86823df7..8814031516ce 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -10,7 +10,6 @@ config CPU_S3C2443
10 select CPU_LLSERIAL_S3C2440 10 select CPU_LLSERIAL_S3C2440
11 select SAMSUNG_CLKSRC 11 select SAMSUNG_CLKSRC
12 select S3C2443_CLOCK 12 select S3C2443_CLOCK
13 select S3C_GPIO_PULL_S3C2443
14 help 13 help
15 Support for the S3C2443 SoC from the S3C24XX line 14 Support for the S3C2443 SoC from the S3C24XX line
16 15
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 38058af48972..cd51d04e1de7 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -57,10 +57,6 @@
57 57
58/* clock selections */ 58/* clock selections */
59 59
60static struct clk clk_i2s_ext = {
61 .name = "i2s-ext",
62};
63
64/* armdiv 60/* armdiv
65 * 61 *
66 * this clock is sourced from msysclk and can have a number of 62 * this clock is sourced from msysclk and can have a number of
@@ -173,7 +169,7 @@ static struct clksrc_clk clk_arm = {
173 169
174static struct clksrc_clk clk_hsspi = { 170static struct clksrc_clk clk_hsspi = {
175 .clk = { 171 .clk = {
176 .name = "hsspi", 172 .name = "hsspi-if",
177 .parent = &clk_esysclk.clk, 173 .parent = &clk_esysclk.clk,
178 .ctrlbit = S3C2443_SCLKCON_HSSPICLK, 174 .ctrlbit = S3C2443_SCLKCON_HSSPICLK,
179 .enable = s3c2443_clkcon_enable_s, 175 .enable = s3c2443_clkcon_enable_s,
@@ -235,48 +231,6 @@ static struct clk clk_hsmmc = {
235 }, 231 },
236}; 232};
237 233
238/* i2s_eplldiv
239 *
240 * This clock is the output from the I2S divisor of ESYSCLK, and is separate
241 * from the mux that comes after it (cannot merge into one single clock)
242*/
243
244static struct clksrc_clk clk_i2s_eplldiv = {
245 .clk = {
246 .name = "i2s-eplldiv",
247 .parent = &clk_esysclk.clk,
248 },
249 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, },
250};
251
252/* i2s-ref
253 *
254 * i2s bus reference clock, selectable from external, esysclk or epllref
255 *
256 * Note, this used to be two clocks, but was compressed into one.
257*/
258
259struct clk *clk_i2s_srclist[] = {
260 [0] = &clk_i2s_eplldiv.clk,
261 [1] = &clk_i2s_ext,
262 [2] = &clk_epllref.clk,
263 [3] = &clk_epllref.clk,
264};
265
266static struct clksrc_clk clk_i2s = {
267 .clk = {
268 .name = "i2s-if",
269 .ctrlbit = S3C2443_SCLKCON_I2SCLK,
270 .enable = s3c2443_clkcon_enable_s,
271
272 },
273 .sources = &(struct clksrc_sources) {
274 .sources = clk_i2s_srclist,
275 .nr_sources = ARRAY_SIZE(clk_i2s_srclist),
276 },
277 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 },
278};
279
280/* standard clock definitions */ 234/* standard clock definitions */
281 235
282static struct clk init_clocks_off[] = { 236static struct clk init_clocks_off[] = {
@@ -286,11 +240,6 @@ static struct clk init_clocks_off[] = {
286 .enable = s3c2443_clkcon_enable_p, 240 .enable = s3c2443_clkcon_enable_p,
287 .ctrlbit = S3C2443_PCLKCON_SDI, 241 .ctrlbit = S3C2443_PCLKCON_SDI,
288 }, { 242 }, {
289 .name = "iis",
290 .parent = &clk_p,
291 .enable = s3c2443_clkcon_enable_p,
292 .ctrlbit = S3C2443_PCLKCON_IIS,
293 }, {
294 .name = "spi", 243 .name = "spi",
295 .devname = "s3c2410-spi.0", 244 .devname = "s3c2410-spi.0",
296 .parent = &clk_p, 245 .parent = &clk_p,
@@ -312,8 +261,6 @@ static struct clk init_clocks[] = {
312 261
313static struct clksrc_clk *clksrcs[] __initdata = { 262static struct clksrc_clk *clksrcs[] __initdata = {
314 &clk_arm, 263 &clk_arm,
315 &clk_i2s_eplldiv,
316 &clk_i2s,
317 &clk_hsspi, 264 &clk_hsspi,
318 &clk_hsmmc_div, 265 &clk_hsmmc_div,
319}; 266};
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index e6a28ba52c7d..5df6458ddd42 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -90,8 +90,8 @@ void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
90 90
91void __init s3c2443_map_io(void) 91void __init s3c2443_map_io(void)
92{ 92{
93 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443; 93 s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
94 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443; 94 s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
95 95
96 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 96 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
97} 97}
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index f057b6ae4f90..5552e048c2be 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -288,5 +288,6 @@ config MACH_WLF_CRAGG_6410
288 select S3C_DEV_RTC 288 select S3C_DEV_RTC
289 select S3C64XX_DEV_SPI 289 select S3C64XX_DEV_SPI
290 select S3C24XX_GPIO_EXTRA128 290 select S3C24XX_GPIO_EXTRA128
291 select I2C
291 help 292 help
292 Machine support for the Wolfson Cragganmore S3C6410 variant. 293 Machine support for the Wolfson Cragganmore S3C6410 variant.
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 61b4034a0c22..cfc0b9941808 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -13,7 +13,6 @@ obj- :=
13# Core files 13# Core files
14obj-y += cpu.o 14obj-y += cpu.o
15obj-y += clock.o 15obj-y += clock.o
16obj-y += gpiolib.o
17 16
18# Core support for S3C6400 system 17# Core support for S3C6400 system
19 18
@@ -55,12 +54,10 @@ obj-$(CONFIG_MACH_HMT) += mach-hmt.o
55obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o 54obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o
56obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o 55obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o
57obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o 56obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o
58obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o 57obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o
59 58
60# device support 59# device support
61 60
62obj-y += dev-uart.o 61obj-y += dev-uart.o
63obj-y += dev-audio.o 62obj-y += dev-audio.o
64obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 63obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
65obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o
66obj-$(CONFIG_S3C64XX_DEV_ONENAND1) += dev-onenand1.o
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index 8cf39e33579e..39c238d7a3dc 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -25,13 +25,13 @@
25 25
26#include <mach/regs-sys.h> 26#include <mach/regs-sys.h>
27#include <mach/regs-clock.h> 27#include <mach/regs-clock.h>
28#include <mach/pll.h>
29 28
30#include <plat/cpu.h> 29#include <plat/cpu.h>
31#include <plat/devs.h> 30#include <plat/devs.h>
32#include <plat/cpu-freq.h> 31#include <plat/cpu-freq.h>
33#include <plat/clock.h> 32#include <plat/clock.h>
34#include <plat/clock-clksrc.h> 33#include <plat/clock-clksrc.h>
34#include <plat/pll.h>
35 35
36/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call 36/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
37 * ext_xtal_mux for want of an actual name from the manual. 37 * ext_xtal_mux for want of an actual name from the manual.
@@ -735,7 +735,8 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
735 /* For now assume the mux always selects the crystal */ 735 /* For now assume the mux always selects the crystal */
736 clk_ext_xtal_mux.parent = xtal_clk; 736 clk_ext_xtal_mux.parent = xtal_clk;
737 737
738 epll = s3c6400_get_epll(xtal); 738 epll = s3c_get_pll6553x(xtal, __raw_readl(S3C_EPLL_CON0),
739 __raw_readl(S3C_EPLL_CON1));
739 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON)); 740 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON));
740 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON)); 741 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON));
741 742
@@ -744,7 +745,13 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
744 printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n", 745 printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n",
745 apll, mpll, epll); 746 apll, mpll, epll);
746 747
747 hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2); 748 if(__raw_readl(S3C64XX_OTHERS) & S3C64XX_OTHERS_SYNCMUXSEL)
749 /* Synchronous mode */
750 hclk2 = apll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
751 else
752 /* Asynchronous mode */
753 hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
754
748 hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK); 755 hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK);
749 pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK); 756 pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK);
750 757
diff --git a/arch/arm/mach-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
index c7047838e112..de085b798aa4 100644
--- a/arch/arm/mach-s3c64xx/cpu.c
+++ b/arch/arm/mach-s3c64xx/cpu.c
@@ -34,8 +34,8 @@
34#include <plat/devs.h> 34#include <plat/devs.h>
35#include <plat/clock.h> 35#include <plat/clock.h>
36 36
37#include <mach/s3c6400.h> 37#include <plat/s3c6400.h>
38#include <mach/s3c6410.h> 38#include <plat/s3c6410.h>
39 39
40/* table of supported CPUs */ 40/* table of supported CPUs */
41 41
diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c b/arch/arm/mach-s3c64xx/dev-onenand1.c
deleted file mode 100644
index 999f9e17a1e4..000000000000
--- a/arch/arm/mach-s3c64xx/dev-onenand1.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/dev-onenand1.c
3 *
4 * Copyright (c) 2008-2010 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S3C64XX series device definition for OneNAND devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/onenand.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/devs.h>
23
24static struct resource s3c64xx_onenand1_resources[] = {
25 [0] = {
26 .start = S3C64XX_PA_ONENAND1,
27 .end = S3C64XX_PA_ONENAND1 + 0x400 - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = S3C64XX_PA_ONENAND1_BUF,
32 .end = S3C64XX_PA_ONENAND1_BUF + S3C64XX_SZ_ONENAND1_BUF - 1,
33 .flags = IORESOURCE_MEM,
34 },
35 [2] = {
36 .start = IRQ_ONENAND1,
37 .end = IRQ_ONENAND1,
38 .flags = IORESOURCE_IRQ,
39 },
40};
41
42struct platform_device s3c64xx_device_onenand1 = {
43 .name = "samsung-onenand",
44 .id = 1,
45 .num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources),
46 .resource = s3c64xx_onenand1_resources,
47};
48
49void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
50{
51 s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
52 &s3c64xx_device_onenand1);
53}
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index 67c97fab62fd..17d62f4f8204 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -740,7 +740,7 @@ static int __init s3c64xx_dma_init(void)
740 } 740 }
741 741
742 /* Set all DMA configuration to be DMA, not SDMA */ 742 /* Set all DMA configuration to be DMA, not SDMA */
743 writel(0xffffff, S3C_SYSREG(0x110)); 743 writel(0xffffff, S3C64XX_SDMA_SEL);
744 744
745 /* Register standard DMA controllers */ 745 /* Register standard DMA controllers */
746 s3c64xx_dma_init1(0, DMACH_UART0, IRQ_DMA0, 0x75000000); 746 s3c64xx_dma_init1(0, DMACH_UART0, IRQ_DMA0, 0x75000000);
diff --git a/arch/arm/mach-s3c64xx/gpiolib.c b/arch/arm/mach-s3c64xx/gpiolib.c
deleted file mode 100644
index 92b09085caaa..000000000000
--- a/arch/arm/mach-s3c64xx/gpiolib.c
+++ /dev/null
@@ -1,290 +0,0 @@
1/* arch/arm/plat-s3c64xx/gpiolib.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - GPIOlib support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/irq.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19
20#include <mach/map.h>
21
22#include <plat/gpio-core.h>
23#include <plat/gpio-cfg.h>
24#include <plat/gpio-cfg-helpers.h>
25#include <mach/regs-gpio.h>
26
27/* GPIO bank summary:
28 *
29 * Bank GPIOs Style SlpCon ExtInt Group
30 * A 8 4Bit Yes 1
31 * B 7 4Bit Yes 1
32 * C 8 4Bit Yes 2
33 * D 5 4Bit Yes 3
34 * E 5 4Bit Yes None
35 * F 16 2Bit Yes 4 [1]
36 * G 7 4Bit Yes 5
37 * H 10 4Bit[2] Yes 6
38 * I 16 2Bit Yes None
39 * J 12 2Bit Yes None
40 * K 16 4Bit[2] No None
41 * L 15 4Bit[2] No None
42 * M 6 4Bit No IRQ_EINT
43 * N 16 2Bit No IRQ_EINT
44 * O 16 2Bit Yes 7
45 * P 15 2Bit Yes 8
46 * Q 9 2Bit Yes 9
47 *
48 * [1] BANKF pins 14,15 do not form part of the external interrupt sources
49 * [2] BANK has two control registers, GPxCON0 and GPxCON1
50 */
51
52static struct s3c_gpio_cfg gpio_4bit_cfg_noint = {
53 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
54 .get_config = s3c_gpio_getcfg_s3c64xx_4bit,
55 .set_pull = s3c_gpio_setpull_updown,
56 .get_pull = s3c_gpio_getpull_updown,
57};
58
59static struct s3c_gpio_cfg gpio_4bit_cfg_eint0111 = {
60 .cfg_eint = 7,
61 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
62 .get_config = s3c_gpio_getcfg_s3c64xx_4bit,
63 .set_pull = s3c_gpio_setpull_updown,
64 .get_pull = s3c_gpio_getpull_updown,
65};
66
67static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = {
68 .cfg_eint = 3,
69 .get_config = s3c_gpio_getcfg_s3c64xx_4bit,
70 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
71 .set_pull = s3c_gpio_setpull_updown,
72 .get_pull = s3c_gpio_getpull_updown,
73};
74
75static int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin)
76{
77 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO;
78}
79
80static struct s3c_gpio_chip gpio_4bit[] = {
81 {
82 .base = S3C64XX_GPA_BASE,
83 .config = &gpio_4bit_cfg_eint0111,
84 .chip = {
85 .base = S3C64XX_GPA(0),
86 .ngpio = S3C64XX_GPIO_A_NR,
87 .label = "GPA",
88 },
89 }, {
90 .base = S3C64XX_GPB_BASE,
91 .config = &gpio_4bit_cfg_eint0111,
92 .chip = {
93 .base = S3C64XX_GPB(0),
94 .ngpio = S3C64XX_GPIO_B_NR,
95 .label = "GPB",
96 },
97 }, {
98 .base = S3C64XX_GPC_BASE,
99 .config = &gpio_4bit_cfg_eint0111,
100 .chip = {
101 .base = S3C64XX_GPC(0),
102 .ngpio = S3C64XX_GPIO_C_NR,
103 .label = "GPC",
104 },
105 }, {
106 .base = S3C64XX_GPD_BASE,
107 .config = &gpio_4bit_cfg_eint0111,
108 .chip = {
109 .base = S3C64XX_GPD(0),
110 .ngpio = S3C64XX_GPIO_D_NR,
111 .label = "GPD",
112 },
113 }, {
114 .base = S3C64XX_GPE_BASE,
115 .config = &gpio_4bit_cfg_noint,
116 .chip = {
117 .base = S3C64XX_GPE(0),
118 .ngpio = S3C64XX_GPIO_E_NR,
119 .label = "GPE",
120 },
121 }, {
122 .base = S3C64XX_GPG_BASE,
123 .config = &gpio_4bit_cfg_eint0111,
124 .chip = {
125 .base = S3C64XX_GPG(0),
126 .ngpio = S3C64XX_GPIO_G_NR,
127 .label = "GPG",
128 },
129 }, {
130 .base = S3C64XX_GPM_BASE,
131 .config = &gpio_4bit_cfg_eint0011,
132 .chip = {
133 .base = S3C64XX_GPM(0),
134 .ngpio = S3C64XX_GPIO_M_NR,
135 .label = "GPM",
136 .to_irq = s3c64xx_gpio2int_gpm,
137 },
138 },
139};
140
141static int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin)
142{
143 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO;
144}
145
146static struct s3c_gpio_chip gpio_4bit2[] = {
147 {
148 .base = S3C64XX_GPH_BASE + 0x4,
149 .config = &gpio_4bit_cfg_eint0111,
150 .chip = {
151 .base = S3C64XX_GPH(0),
152 .ngpio = S3C64XX_GPIO_H_NR,
153 .label = "GPH",
154 },
155 }, {
156 .base = S3C64XX_GPK_BASE + 0x4,
157 .config = &gpio_4bit_cfg_noint,
158 .chip = {
159 .base = S3C64XX_GPK(0),
160 .ngpio = S3C64XX_GPIO_K_NR,
161 .label = "GPK",
162 },
163 }, {
164 .base = S3C64XX_GPL_BASE + 0x4,
165 .config = &gpio_4bit_cfg_eint0011,
166 .chip = {
167 .base = S3C64XX_GPL(0),
168 .ngpio = S3C64XX_GPIO_L_NR,
169 .label = "GPL",
170 .to_irq = s3c64xx_gpio2int_gpl,
171 },
172 },
173};
174
175static struct s3c_gpio_cfg gpio_2bit_cfg_noint = {
176 .set_config = s3c_gpio_setcfg_s3c24xx,
177 .get_config = s3c_gpio_getcfg_s3c24xx,
178 .set_pull = s3c_gpio_setpull_updown,
179 .get_pull = s3c_gpio_getpull_updown,
180};
181
182static struct s3c_gpio_cfg gpio_2bit_cfg_eint10 = {
183 .cfg_eint = 2,
184 .set_config = s3c_gpio_setcfg_s3c24xx,
185 .get_config = s3c_gpio_getcfg_s3c24xx,
186 .set_pull = s3c_gpio_setpull_updown,
187 .get_pull = s3c_gpio_getpull_updown,
188};
189
190static struct s3c_gpio_cfg gpio_2bit_cfg_eint11 = {
191 .cfg_eint = 3,
192 .set_config = s3c_gpio_setcfg_s3c24xx,
193 .get_config = s3c_gpio_getcfg_s3c24xx,
194 .set_pull = s3c_gpio_setpull_updown,
195 .get_pull = s3c_gpio_getpull_updown,
196};
197
198static struct s3c_gpio_chip gpio_2bit[] = {
199 {
200 .base = S3C64XX_GPF_BASE,
201 .config = &gpio_2bit_cfg_eint11,
202 .chip = {
203 .base = S3C64XX_GPF(0),
204 .ngpio = S3C64XX_GPIO_F_NR,
205 .label = "GPF",
206 },
207 }, {
208 .base = S3C64XX_GPI_BASE,
209 .config = &gpio_2bit_cfg_noint,
210 .chip = {
211 .base = S3C64XX_GPI(0),
212 .ngpio = S3C64XX_GPIO_I_NR,
213 .label = "GPI",
214 },
215 }, {
216 .base = S3C64XX_GPJ_BASE,
217 .config = &gpio_2bit_cfg_noint,
218 .chip = {
219 .base = S3C64XX_GPJ(0),
220 .ngpio = S3C64XX_GPIO_J_NR,
221 .label = "GPJ",
222 },
223 }, {
224 .base = S3C64XX_GPN_BASE,
225 .irq_base = IRQ_EINT(0),
226 .config = &gpio_2bit_cfg_eint10,
227 .chip = {
228 .base = S3C64XX_GPN(0),
229 .ngpio = S3C64XX_GPIO_N_NR,
230 .label = "GPN",
231 .to_irq = samsung_gpiolib_to_irq,
232 },
233 }, {
234 .base = S3C64XX_GPO_BASE,
235 .config = &gpio_2bit_cfg_eint11,
236 .chip = {
237 .base = S3C64XX_GPO(0),
238 .ngpio = S3C64XX_GPIO_O_NR,
239 .label = "GPO",
240 },
241 }, {
242 .base = S3C64XX_GPP_BASE,
243 .config = &gpio_2bit_cfg_eint11,
244 .chip = {
245 .base = S3C64XX_GPP(0),
246 .ngpio = S3C64XX_GPIO_P_NR,
247 .label = "GPP",
248 },
249 }, {
250 .base = S3C64XX_GPQ_BASE,
251 .config = &gpio_2bit_cfg_eint11,
252 .chip = {
253 .base = S3C64XX_GPQ(0),
254 .ngpio = S3C64XX_GPIO_Q_NR,
255 .label = "GPQ",
256 },
257 },
258};
259
260static __init void s3c64xx_gpiolib_add_2bit(struct s3c_gpio_chip *chip)
261{
262 chip->pm = __gpio_pm(&s3c_gpio_pm_2bit);
263}
264
265static __init void s3c64xx_gpiolib_add(struct s3c_gpio_chip *chips,
266 int nr_chips,
267 void (*fn)(struct s3c_gpio_chip *))
268{
269 for (; nr_chips > 0; nr_chips--, chips++) {
270 if (fn)
271 (fn)(chips);
272 s3c_gpiolib_add(chips);
273 }
274}
275
276static __init int s3c64xx_gpiolib_init(void)
277{
278 s3c64xx_gpiolib_add(gpio_4bit, ARRAY_SIZE(gpio_4bit),
279 samsung_gpiolib_add_4bit);
280
281 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2),
282 samsung_gpiolib_add_4bit2);
283
284 s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit),
285 s3c64xx_gpiolib_add_2bit);
286
287 return 0;
288}
289
290core_initcall(s3c64xx_gpiolib_init);
diff --git a/arch/arm/mach-s3c64xx/include/mach/clkdev.h b/arch/arm/mach-s3c64xx/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/mach-s3c64xx/include/mach/crag6410.h b/arch/arm/mach-s3c64xx/include/mach/crag6410.h
new file mode 100644
index 000000000000..be9074e17dfd
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/crag6410.h
@@ -0,0 +1,23 @@
1/* Cragganmore 6410 shared definitions
2 *
3 * Copyright 2011 Wolfson Microelectronics plc
4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef MACH_CRAG6410_H
12#define MACH_CRAG6410_H
13
14#include <linux/gpio.h>
15
16#define BANFF_PMIC_IRQ_BASE IRQ_BOARD_START
17#define GLENFARCLAS_PMIC_IRQ_BASE (IRQ_BOARD_START + 64)
18
19#define PCA935X_GPIO_BASE GPIO_BOARD_START
20#define CODEC_GPIO_BASE (GPIO_BOARD_START + 8)
21#define GLENFARCLAS_PMIC_GPIO_BASE (GPIO_BOARD_START + 16)
22
23#endif
diff --git a/arch/arm/mach-s3c64xx/include/mach/pll.h b/arch/arm/mach-s3c64xx/include/mach/pll.h
deleted file mode 100644
index 5ef0bb698ee0..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/pll.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/* arch/arm/plat-s3c64xx/include/plat/pll.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX PLL code
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define S3C6400_PLL_MDIV_MASK ((1 << (25-16+1)) - 1)
16#define S3C6400_PLL_PDIV_MASK ((1 << (13-8+1)) - 1)
17#define S3C6400_PLL_SDIV_MASK ((1 << (2-0+1)) - 1)
18#define S3C6400_PLL_MDIV_SHIFT (16)
19#define S3C6400_PLL_PDIV_SHIFT (8)
20#define S3C6400_PLL_SDIV_SHIFT (0)
21
22#include <asm/div64.h>
23#include <plat/pll6553x.h>
24
25static inline unsigned long s3c6400_get_pll(unsigned long baseclk,
26 u32 pllcon)
27{
28 u32 mdiv, pdiv, sdiv;
29 u64 fvco = baseclk;
30
31 mdiv = (pllcon >> S3C6400_PLL_MDIV_SHIFT) & S3C6400_PLL_MDIV_MASK;
32 pdiv = (pllcon >> S3C6400_PLL_PDIV_SHIFT) & S3C6400_PLL_PDIV_MASK;
33 sdiv = (pllcon >> S3C6400_PLL_SDIV_SHIFT) & S3C6400_PLL_SDIV_MASK;
34
35 fvco *= mdiv;
36 do_div(fvco, (pdiv << sdiv));
37
38 return (unsigned long)fvco;
39}
40
41static inline unsigned long s3c6400_get_epll(unsigned long baseclk)
42{
43 return s3c_get_pll6553x(baseclk, __raw_readl(S3C_EPLL_CON0),
44 __raw_readl(S3C_EPLL_CON1));
45}
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index 38659bebe4b1..fcf3dcabb694 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -104,7 +104,7 @@ static inline void s3c_pm_restored_gpios(void)
104 __raw_writel(0, S3C64XX_SLPEN); 104 __raw_writel(0, S3C64XX_SLPEN);
105} 105}
106 106
107static inline void s3c_pm_saved_gpios(void) 107static inline void samsung_pm_saved_gpios(void)
108{ 108{
109 /* turn on the sleep mode and keep it there, as it seems that during 109 /* turn on the sleep mode and keep it there, as it seems that during
110 * suspend the xCON registers get re-set and thus you can end up with 110 * suspend the xCON registers get re-set and thus you can end up with
diff --git a/arch/arm/mach-s3c64xx/include/mach/pwm-clock.h b/arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
deleted file mode 100644
index b25bedee0d52..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/pwm-clock.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64xx - pwm clock and timer support
9 */
10
11/**
12 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
13 * @tcfg: The timer TCFG1 register bits shifted down to 0.
14 *
15 * Return true if the given configuration from TCFG1 is a TCLK instead
16 * any of the TDIV clocks.
17 */
18static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
19{
20 return tcfg >= S3C64XX_TCFG1_MUX_TCLK;
21}
22
23/**
24 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
25 * @tcfg1: The tcfg1 setting, shifted down.
26 *
27 * Get the divisor value for the given tcfg1 setting. We assume the
28 * caller has already checked to see if this is not a TCLK source.
29 */
30static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
31{
32 return 1 << tcfg1;
33}
34
35/**
36 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
37 *
38 * Return true if we have a /1 in the tdiv setting.
39 */
40static inline unsigned int pwm_tdiv_has_div1(void)
41{
42 return 1;
43}
44
45/**
46 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
47 * @div: The divisor to calculate the bit information for.
48 *
49 * Turn a divisor into the necessary bit field for TCFG1.
50 */
51static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
52{
53 return ilog2(div);
54}
55
56#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-sys.h b/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
index 69b78d9f83b8..b91e02093289 100644
--- a/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
@@ -21,8 +21,11 @@
21#define S3C64XX_AHB_CON1 S3C_SYSREG(0x104) 21#define S3C64XX_AHB_CON1 S3C_SYSREG(0x104)
22#define S3C64XX_AHB_CON2 S3C_SYSREG(0x108) 22#define S3C64XX_AHB_CON2 S3C_SYSREG(0x108)
23 23
24#define S3C64XX_SDMA_SEL S3C_SYSREG(0x110)
25
24#define S3C64XX_OTHERS S3C_SYSREG(0x900) 26#define S3C64XX_OTHERS S3C_SYSREG(0x900)
25 27
26#define S3C64XX_OTHERS_USBMASK (1 << 16) 28#define S3C64XX_OTHERS_USBMASK (1 << 16)
29#define S3C64XX_OTHERS_SYNCMUXSEL (1 << 6)
27 30
28#endif /* _PLAT_REGS_SYS_H */ 31#endif /* _PLAT_REGS_SYS_H */
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index d164a282bfb4..8eba88e7209e 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -45,7 +45,7 @@
45#include <plat/fb.h> 45#include <plat/fb.h>
46#include <plat/regs-fb-v4.h> 46#include <plat/regs-fb-v4.h>
47 47
48#include <mach/s3c6410.h> 48#include <plat/s3c6410.h>
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/devs.h> 50#include <plat/devs.h>
51#include <plat/cpu.h> 51#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
new file mode 100644
index 000000000000..66668565ee75
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -0,0 +1,182 @@
1/* Speyside modules for Cragganmore - board data probing
2 *
3 * Copyright 2011 Wolfson Microelectronics plc
4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12#include <linux/interrupt.h>
13#include <linux/i2c.h>
14
15#include <linux/mfd/wm831x/irq.h>
16#include <linux/mfd/wm831x/gpio.h>
17
18#include <sound/wm8996.h>
19#include <sound/wm8962.h>
20#include <sound/wm9081.h>
21
22#include <mach/crag6410.h>
23
24static struct wm8996_retune_mobile_config wm8996_retune[] = {
25 {
26 .name = "Sub LPF",
27 .rate = 48000,
28 .regs = {
29 0x6318, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
30 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
31 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
32 },
33 },
34 {
35 .name = "Sub HPF",
36 .rate = 48000,
37 .regs = {
38 0x000A, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
39 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
40 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
41 },
42 },
43};
44
45static struct wm8996_pdata wm8996_pdata __initdata = {
46 .ldo_ena = S3C64XX_GPN(7),
47 .gpio_base = CODEC_GPIO_BASE,
48 .micdet_def = 1,
49 .inl_mode = WM8996_DIFFERRENTIAL_1,
50 .inr_mode = WM8996_DIFFERRENTIAL_1,
51
52 .irq_flags = IRQF_TRIGGER_RISING,
53
54 .gpio_default = {
55 0x8001, /* GPIO1 == ADCLRCLK1 */
56 0x8001, /* GPIO2 == ADCLRCLK2, input due to CPU */
57 0x0141, /* GPIO3 == HP_SEL */
58 0x0002, /* GPIO4 == IRQ */
59 0x020e, /* GPIO5 == CLKOUT */
60 },
61
62 .retune_mobile_cfgs = wm8996_retune,
63 .num_retune_mobile_cfgs = ARRAY_SIZE(wm8996_retune),
64};
65
66static struct wm8962_pdata wm8962_pdata __initdata = {
67 .gpio_init = {
68 0,
69 WM8962_GPIO_FN_OPCLK,
70 WM8962_GPIO_FN_DMICCLK,
71 0,
72 0x8000 | WM8962_GPIO_FN_DMICDAT,
73 WM8962_GPIO_FN_IRQ, /* Open drain mode */
74 },
75 .irq_active_low = true,
76};
77
78static struct wm9081_pdata wm9081_pdata __initdata = {
79 .irq_high = false,
80 .irq_cmos = false,
81};
82
83static const struct i2c_board_info wm1254_devs[] = {
84 { I2C_BOARD_INFO("wm8996", 0x1a),
85 .platform_data = &wm8996_pdata,
86 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
87 },
88 { I2C_BOARD_INFO("wm9081", 0x6c),
89 .platform_data = &wm9081_pdata, },
90};
91
92static const struct i2c_board_info wm1255_devs[] = {
93 { I2C_BOARD_INFO("wm5100", 0x1a),
94 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
95 },
96 { I2C_BOARD_INFO("wm9081", 0x6c),
97 .platform_data = &wm9081_pdata, },
98};
99
100static const struct i2c_board_info wm1259_devs[] = {
101 { I2C_BOARD_INFO("wm8962", 0x1a),
102 .platform_data = &wm8962_pdata,
103 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
104 },
105};
106
107
108static __devinitdata const struct {
109 u8 id;
110 const char *name;
111 const struct i2c_board_info *i2c_devs;
112 int num_i2c_devs;
113} gf_mods[] = {
114 { .id = 0x01, .name = "1250-EV1 Springbank" },
115 { .id = 0x02, .name = "1251-EV1 Jura" },
116 { .id = 0x03, .name = "1252-EV1 Glenlivet" },
117 { .id = 0x11, .name = "6249-EV2 Glenfarclas", },
118 { .id = 0x21, .name = "1275-EV1 Mortlach" },
119 { .id = 0x25, .name = "1274-EV1 Glencadam" },
120 { .id = 0x31, .name = "1253-EV1 Tomatin", },
121 { .id = 0x39, .name = "1254-EV1 Dallas Dhu",
122 .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) },
123 { .id = 0x3a, .name = "1259-EV1 Tobermory",
124 .i2c_devs = wm1259_devs, .num_i2c_devs = ARRAY_SIZE(wm1259_devs) },
125 { .id = 0x3b, .name = "1255-EV1 Kilchoman",
126 .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) },
127 { .id = 0x3c, .name = "1273-EV1 Longmorn" },
128};
129
130static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
131 const struct i2c_device_id *i2c_id)
132{
133 int ret, i, j, id, rev;
134
135 ret = i2c_smbus_read_byte_data(i2c, 0);
136 if (ret < 0) {
137 dev_err(&i2c->dev, "Failed to read ID: %d\n", ret);
138 return ret;
139 }
140
141 id = (ret & 0xfe) >> 2;
142 rev = ret & 0x3;
143 for (i = 0; i < ARRAY_SIZE(gf_mods); i++)
144 if (id == gf_mods[i].id)
145 break;
146
147 if (i < ARRAY_SIZE(gf_mods)) {
148 dev_info(&i2c->dev, "%s revision %d\n",
149 gf_mods[i].name, rev + 1);
150 for (j = 0; j < gf_mods[i].num_i2c_devs; j++) {
151 if (!i2c_new_device(i2c->adapter,
152 &(gf_mods[i].i2c_devs[j])))
153 dev_err(&i2c->dev,
154 "Failed to register dev: %d\n", ret);
155 }
156 } else {
157 dev_warn(&i2c->dev, "Unknown module ID %d revision %d\n",
158 id, rev);
159 }
160
161 return 0;
162}
163
164static const struct i2c_device_id wlf_gf_module_id[] = {
165 { "wlf-gf-module", 0 },
166 { }
167};
168
169static struct i2c_driver wlf_gf_module_driver = {
170 .driver = {
171 .name = "wlf-gf-module",
172 .owner = THIS_MODULE,
173 },
174 .probe = wlf_gf_module_probe,
175 .id_table = wlf_gf_module_id,
176};
177
178static int __init wlf_gf_module_register(void)
179{
180 return i2c_add_driver(&wlf_gf_module_driver);
181}
182module_init(wlf_gf_module_register);
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 806580388f30..d04b65448510 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -43,13 +43,14 @@
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44#include <mach/map.h> 44#include <mach/map.h>
45 45
46#include <mach/s3c6410.h>
47#include <mach/regs-sys.h> 46#include <mach/regs-sys.h>
48#include <mach/regs-gpio.h> 47#include <mach/regs-gpio.h>
49#include <mach/regs-modem.h> 48#include <mach/regs-modem.h>
49#include <mach/crag6410.h>
50 50
51#include <mach/regs-gpio-memport.h> 51#include <mach/regs-gpio-memport.h>
52 52
53#include <plat/s3c6410.h>
53#include <plat/regs-serial.h> 54#include <plat/regs-serial.h>
54#include <plat/regs-fb-v4.h> 55#include <plat/regs-fb-v4.h>
55#include <plat/fb.h> 56#include <plat/fb.h>
@@ -65,17 +66,6 @@
65#include <plat/iic.h> 66#include <plat/iic.h>
66#include <plat/pm.h> 67#include <plat/pm.h>
67 68
68#include <sound/wm8996.h>
69#include <sound/wm8962.h>
70#include <sound/wm9081.h>
71
72#define BANFF_PMIC_IRQ_BASE IRQ_BOARD_START
73#define GLENFARCLAS_PMIC_IRQ_BASE (IRQ_BOARD_START + 64)
74
75#define PCA935X_GPIO_BASE GPIO_BOARD_START
76#define CODEC_GPIO_BASE (GPIO_BOARD_START + 8)
77#define GLENFARCLAS_PMIC_GPIO_BASE (GPIO_BOARD_START + 16)
78
79/* serial port setup */ 69/* serial port setup */
80 70
81#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) 71#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
@@ -287,6 +277,11 @@ static struct platform_device speyside_device = {
287 .id = -1, 277 .id = -1,
288}; 278};
289 279
280static struct platform_device lowland_device = {
281 .name = "lowland",
282 .id = -1,
283};
284
290static struct platform_device speyside_wm8962_device = { 285static struct platform_device speyside_wm8962_device = {
291 .name = "speyside-wm8962", 286 .name = "speyside-wm8962",
292 .id = -1, 287 .id = -1,
@@ -295,6 +290,8 @@ static struct platform_device speyside_wm8962_device = {
295static struct regulator_consumer_supply wallvdd_consumers[] = { 290static struct regulator_consumer_supply wallvdd_consumers[] = {
296 REGULATOR_SUPPLY("SPKVDD1", "1-001a"), 291 REGULATOR_SUPPLY("SPKVDD1", "1-001a"),
297 REGULATOR_SUPPLY("SPKVDD2", "1-001a"), 292 REGULATOR_SUPPLY("SPKVDD2", "1-001a"),
293 REGULATOR_SUPPLY("SPKVDDL", "1-001a"),
294 REGULATOR_SUPPLY("SPKVDDR", "1-001a"),
298}; 295};
299 296
300static struct regulator_init_data wallvdd_data = { 297static struct regulator_init_data wallvdd_data = {
@@ -342,6 +339,7 @@ static struct platform_device *crag6410_devices[] __initdata = {
342 &crag6410_backlight_device, 339 &crag6410_backlight_device,
343 &speyside_device, 340 &speyside_device,
344 &speyside_wm8962_device, 341 &speyside_wm8962_device,
342 &lowland_device,
345 &wallvdd_device, 343 &wallvdd_device,
346}; 344};
347 345
@@ -350,6 +348,12 @@ static struct pca953x_platform_data crag6410_pca_data = {
350 .irq_base = 0, 348 .irq_base = 0,
351}; 349};
352 350
351/* VDDARM is controlled by DVS1 connected to GPK(0) */
352static struct wm831x_buckv_pdata vddarm_pdata = {
353 .dvs_control_src = 1,
354 .dvs_gpio = S3C64XX_GPK(0),
355};
356
353static struct regulator_consumer_supply vddarm_consumers[] __initdata = { 357static struct regulator_consumer_supply vddarm_consumers[] __initdata = {
354 REGULATOR_SUPPLY("vddarm", NULL), 358 REGULATOR_SUPPLY("vddarm", NULL),
355}; 359};
@@ -365,6 +369,7 @@ static struct regulator_init_data vddarm __initdata = {
365 .num_consumer_supplies = ARRAY_SIZE(vddarm_consumers), 369 .num_consumer_supplies = ARRAY_SIZE(vddarm_consumers),
366 .consumer_supplies = vddarm_consumers, 370 .consumer_supplies = vddarm_consumers,
367 .supply_regulator = "WALLVDD", 371 .supply_regulator = "WALLVDD",
372 .driver_data = &vddarm_pdata,
368}; 373};
369 374
370static struct regulator_init_data vddint __initdata = { 375static struct regulator_init_data vddint __initdata = {
@@ -500,6 +505,8 @@ static struct wm831x_pdata crag_pmic_pdata __initdata = {
500 .backup = &banff_backup_pdata, 505 .backup = &banff_backup_pdata,
501 506
502 .gpio_defaults = { 507 .gpio_defaults = {
508 /* GPIO5: DVS1_REQ - CMOS, DBVDD, active high */
509 [4] = WM831X_GPN_DIR | WM831X_GPN_POL | WM831X_GPN_ENA | 0x8,
503 /* GPIO11: Touchscreen data - CMOS, DBVDD, active high*/ 510 /* GPIO11: Touchscreen data - CMOS, DBVDD, active high*/
504 [10] = WM831X_GPN_POL | WM831X_GPN_ENA | 0x6, 511 [10] = WM831X_GPN_POL | WM831X_GPN_ENA | 0x6,
505 /* GPIO12: Touchscreen pen down - CMOS, DBVDD, active high*/ 512 /* GPIO12: Touchscreen pen down - CMOS, DBVDD, active high*/
@@ -557,8 +564,12 @@ static struct regulator_init_data pvdd_1v2 __initdata = {
557}; 564};
558 565
559static struct regulator_consumer_supply pvdd_1v8_consumers[] __initdata = { 566static struct regulator_consumer_supply pvdd_1v8_consumers[] __initdata = {
567 REGULATOR_SUPPLY("LDOVDD", "1-001a"),
560 REGULATOR_SUPPLY("PLLVDD", "1-001a"), 568 REGULATOR_SUPPLY("PLLVDD", "1-001a"),
561 REGULATOR_SUPPLY("DBVDD", "1-001a"), 569 REGULATOR_SUPPLY("DBVDD", "1-001a"),
570 REGULATOR_SUPPLY("DBVDD1", "1-001a"),
571 REGULATOR_SUPPLY("DBVDD2", "1-001a"),
572 REGULATOR_SUPPLY("DBVDD3", "1-001a"),
562 REGULATOR_SUPPLY("CPVDD", "1-001a"), 573 REGULATOR_SUPPLY("CPVDD", "1-001a"),
563 REGULATOR_SUPPLY("AVDD2", "1-001a"), 574 REGULATOR_SUPPLY("AVDD2", "1-001a"),
564 REGULATOR_SUPPLY("DCVDD", "1-001a"), 575 REGULATOR_SUPPLY("DCVDD", "1-001a"),
@@ -611,81 +622,16 @@ static struct wm831x_pdata glenfarclas_pmic_pdata __initdata = {
611 .disable_touch = true, 622 .disable_touch = true,
612}; 623};
613 624
614static struct wm8996_retune_mobile_config wm8996_retune[] = {
615 {
616 .name = "Sub LPF",
617 .rate = 48000,
618 .regs = {
619 0x6318, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
620 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
621 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
622 },
623 },
624 {
625 .name = "Sub HPF",
626 .rate = 48000,
627 .regs = {
628 0x000A, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
629 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
630 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
631 },
632 },
633};
634
635static struct wm8996_pdata wm8996_pdata __initdata = {
636 .ldo_ena = S3C64XX_GPN(7),
637 .gpio_base = CODEC_GPIO_BASE,
638 .micdet_def = 1,
639 .inl_mode = WM8996_DIFFERRENTIAL_1,
640 .inr_mode = WM8996_DIFFERRENTIAL_1,
641
642 .irq_flags = IRQF_TRIGGER_RISING,
643
644 .gpio_default = {
645 0x8001, /* GPIO1 == ADCLRCLK1 */
646 0x8001, /* GPIO2 == ADCLRCLK2, input due to CPU */
647 0x0141, /* GPIO3 == HP_SEL */
648 0x0002, /* GPIO4 == IRQ */
649 0x020e, /* GPIO5 == CLKOUT */
650 },
651
652 .retune_mobile_cfgs = wm8996_retune,
653 .num_retune_mobile_cfgs = ARRAY_SIZE(wm8996_retune),
654};
655
656static struct wm8962_pdata wm8962_pdata __initdata = {
657 .gpio_init = {
658 0,
659 WM8962_GPIO_FN_OPCLK,
660 WM8962_GPIO_FN_DMICCLK,
661 0,
662 0x8000 | WM8962_GPIO_FN_DMICDAT,
663 WM8962_GPIO_FN_IRQ, /* Open drain mode */
664 },
665 .irq_active_low = true,
666};
667
668static struct wm9081_pdata wm9081_pdata __initdata = {
669 .irq_high = false,
670 .irq_cmos = false,
671};
672
673static struct i2c_board_info i2c_devs1[] __initdata = { 625static struct i2c_board_info i2c_devs1[] __initdata = {
674 { I2C_BOARD_INFO("wm8311", 0x34), 626 { I2C_BOARD_INFO("wm8311", 0x34),
675 .irq = S3C_EINT(0), 627 .irq = S3C_EINT(0),
676 .platform_data = &glenfarclas_pmic_pdata }, 628 .platform_data = &glenfarclas_pmic_pdata },
677 629
630 { I2C_BOARD_INFO("wlf-gf-module", 0x24) },
631 { I2C_BOARD_INFO("wlf-gf-module", 0x25) },
632 { I2C_BOARD_INFO("wlf-gf-module", 0x26) },
633
678 { I2C_BOARD_INFO("wm1250-ev1", 0x27) }, 634 { I2C_BOARD_INFO("wm1250-ev1", 0x27) },
679 { I2C_BOARD_INFO("wm8996", 0x1a),
680 .platform_data = &wm8996_pdata,
681 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
682 },
683 { I2C_BOARD_INFO("wm9081", 0x6c),
684 .platform_data = &wm9081_pdata, },
685 { I2C_BOARD_INFO("wm8962", 0x1a),
686 .platform_data = &wm8962_pdata,
687 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
688 },
689}; 635};
690 636
691static void __init crag6410_map_io(void) 637static void __init crag6410_map_io(void)
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 19a0887e1c1e..952f75ff5deb 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -37,7 +37,7 @@
37#include <plat/fb.h> 37#include <plat/fb.h>
38#include <plat/nand.h> 38#include <plat/nand.h>
39 39
40#include <mach/s3c6410.h> 40#include <plat/s3c6410.h>
41#include <plat/clock.h> 41#include <plat/clock.h>
42#include <plat/devs.h> 42#include <plat/devs.h>
43#include <plat/cpu.h> 43#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index fb8969aa412e..1bc85c359498 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -32,8 +32,8 @@
32#include <mach/regs-gpio.h> 32#include <mach/regs-gpio.h>
33#include <mach/regs-modem.h> 33#include <mach/regs-modem.h>
34#include <mach/regs-srom.h> 34#include <mach/regs-srom.h>
35#include <mach/s3c6410.h>
36 35
36#include <plat/s3c6410.h>
37#include <plat/adc.h> 37#include <plat/adc.h>
38#include <plat/cpu.h> 38#include <plat/cpu.h>
39#include <plat/devs.h> 39#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index c30f2e5e0d85..cb13cba98b3d 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -39,7 +39,7 @@
39#include <plat/iic.h> 39#include <plat/iic.h>
40#include <plat/fb.h> 40#include <plat/fb.h>
41 41
42#include <mach/s3c6410.h> 42#include <plat/s3c6410.h>
43#include <plat/clock.h> 43#include <plat/clock.h>
44#include <plat/devs.h> 44#include <plat/devs.h>
45#include <plat/cpu.h> 45#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 93170d4834e7..87281e4b8471 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -33,8 +33,8 @@
33#include <mach/regs-gpio.h> 33#include <mach/regs-gpio.h>
34#include <mach/regs-modem.h> 34#include <mach/regs-modem.h>
35#include <mach/regs-srom.h> 35#include <mach/regs-srom.h>
36#include <mach/s3c6410.h>
37 36
37#include <plat/s3c6410.h>
38#include <plat/adc.h> 38#include <plat/adc.h>
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40#include <plat/devs.h> 40#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index cbb57ded3d95..94c831d88365 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -22,8 +22,8 @@
22 22
23#include <mach/map.h> 23#include <mach/map.h>
24#include <mach/regs-gpio.h> 24#include <mach/regs-gpio.h>
25#include <mach/s3c6410.h>
26 25
26#include <plat/s3c6410.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/fb.h> 29#include <plat/fb.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index 04f914b85fdf..f112547ce80a 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -22,8 +22,8 @@
22 22
23#include <mach/map.h> 23#include <mach/map.h>
24#include <mach/regs-gpio.h> 24#include <mach/regs-gpio.h>
25#include <mach/s3c6410.h>
26 25
26#include <plat/s3c6410.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/fb.h> 29#include <plat/fb.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index 6fd5e95f8f75..73450c2b530a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -31,7 +31,7 @@
31 31
32#include <plat/regs-serial.h> 32#include <plat/regs-serial.h>
33 33
34#include <mach/s3c6400.h> 34#include <plat/s3c6400.h>
35#include <plat/clock.h> 35#include <plat/clock.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 5f147c33edad..8bc8edd85e5a 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -63,7 +63,7 @@
63#include <plat/fb.h> 63#include <plat/fb.h>
64#include <plat/gpio-cfg.h> 64#include <plat/gpio-cfg.h>
65 65
66#include <mach/s3c6410.h> 66#include <plat/s3c6410.h>
67#include <plat/clock.h> 67#include <plat/clock.h>
68#include <plat/devs.h> 68#include <plat/devs.h>
69#include <plat/cpu.h> 69#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 055e2858b0dd..b375cd5c47cb 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -29,6 +29,7 @@
29#include <mach/regs-clock.h> 29#include <mach/regs-clock.h>
30#include <mach/regs-syscon-power.h> 30#include <mach/regs-syscon-power.h>
31#include <mach/regs-gpio-memport.h> 31#include <mach/regs-gpio-memport.h>
32#include <mach/regs-modem.h>
32 33
33#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 34#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
34void s3c_pm_debug_smdkled(u32 set, u32 clear) 35void s3c_pm_debug_smdkled(u32 set, u32 clear)
@@ -85,6 +86,9 @@ static struct sleep_save misc_save[] = {
85 SAVE_ITEM(S3C64XX_MEM0CONSLP0), 86 SAVE_ITEM(S3C64XX_MEM0CONSLP0),
86 SAVE_ITEM(S3C64XX_MEM0CONSLP1), 87 SAVE_ITEM(S3C64XX_MEM0CONSLP1),
87 SAVE_ITEM(S3C64XX_MEM1CONSLP), 88 SAVE_ITEM(S3C64XX_MEM1CONSLP),
89
90 SAVE_ITEM(S3C64XX_SDMA_SEL),
91 SAVE_ITEM(S3C64XX_MODEM_MIFPCON),
88}; 92};
89 93
90void s3c_pm_configure_extint(void) 94void s3c_pm_configure_extint(void)
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 5e93fe3f3f40..7a3bc32df425 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -38,7 +38,7 @@
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <plat/iic-core.h> 39#include <plat/iic-core.h>
40#include <plat/onenand-core.h> 40#include <plat/onenand-core.h>
41#include <mach/s3c6400.h> 41#include <plat/s3c6400.h>
42 42
43void __init s3c6400_map_io(void) 43void __init s3c6400_map_io(void)
44{ 44{
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 312aa6b115e8..4117003464ad 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -41,8 +41,8 @@
41#include <plat/adc-core.h> 41#include <plat/adc-core.h>
42#include <plat/iic-core.h> 42#include <plat/iic-core.h>
43#include <plat/onenand-core.h> 43#include <plat/onenand-core.h>
44#include <mach/s3c6400.h> 44#include <plat/s3c6400.h>
45#include <mach/s3c6410.h> 45#include <plat/s3c6410.h>
46 46
47void __init s3c6410_map_io(void) 47void __init s3c6410_map_io(void)
48{ 48{
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c b/arch/arm/mach-s3c64xx/setup-sdhci.c
index f344a222bc84..c75a71b21165 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci.c
@@ -12,17 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15#include <linux/kernel.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23
24#include <plat/regs-sdhci.h>
25#include <plat/sdhci.h>
26 16
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 17/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28 18
@@ -32,41 +22,3 @@ char *s3c64xx_hsmmc_clksrcs[4] = {
32 [2] = "mmc_bus", 22 [2] = "mmc_bus",
33 /* [3] = "48m", - note not successfully used yet */ 23 /* [3] = "48m", - note not successfully used yet */
34}; 24};
35
36void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
44 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
45 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
46 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
47 S3C_SDHCI_CTRL2_ENFBCLKRX |
48 S3C_SDHCI_CTRL2_DFCNT_NONE |
49 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
50
51 if (ios->clock < 25 * 1000000)
52 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
53 S3C_SDHCI_CTRL3_FCSEL2 |
54 S3C_SDHCI_CTRL3_FCSEL1 |
55 S3C_SDHCI_CTRL3_FCSEL0);
56 else
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
58
59 pr_debug("%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
60 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
61 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
62}
63
64void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
65 void __iomem *r,
66 struct mmc_ios *ios,
67 struct mmc_card *card)
68{
69 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
70
71 s3c6400_setup_sdhci_cfg_card(dev, r, ios, card);
72}
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 9527ed24dbff..18690c5f99e6 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -11,6 +11,8 @@ config CPU_S5P6440
11 bool 11 bool
12 select SAMSUNG_DMADEV 12 select SAMSUNG_DMADEV
13 select S5P_HRT 13 select S5P_HRT
14 select S5P_SLEEP if PM
15 select SAMSUNG_WAKEMASK if PM
14 help 16 help
15 Enable S5P6440 CPU support 17 Enable S5P6440 CPU support
16 18
@@ -18,9 +20,17 @@ config CPU_S5P6450
18 bool 20 bool
19 select SAMSUNG_DMADEV 21 select SAMSUNG_DMADEV
20 select S5P_HRT 22 select S5P_HRT
23 select S5P_SLEEP if PM
24 select SAMSUNG_WAKEMASK if PM
21 help 25 help
22 Enable S5P6450 CPU support 26 Enable S5P6450 CPU support
23 27
28config S5P64X0_SETUP_FB_24BPP
29 bool
30 help
31 Common setup code for S5P64X0 based boards with a LCD display
32 through RGB interface.
33
24config S5P64X0_SETUP_I2C1 34config S5P64X0_SETUP_I2C1
25 bool 35 bool
26 help 36 help
@@ -31,6 +41,7 @@ config S5P64X0_SETUP_I2C1
31config MACH_SMDK6440 41config MACH_SMDK6440
32 bool "SMDK6440" 42 bool "SMDK6440"
33 select CPU_S5P6440 43 select CPU_S5P6440
44 select S3C_DEV_FB
34 select S3C_DEV_I2C1 45 select S3C_DEV_I2C1
35 select S3C_DEV_RTC 46 select S3C_DEV_RTC
36 select S3C_DEV_WDT 47 select S3C_DEV_WDT
@@ -39,6 +50,7 @@ config MACH_SMDK6440
39 select SAMSUNG_DEV_BACKLIGHT 50 select SAMSUNG_DEV_BACKLIGHT
40 select SAMSUNG_DEV_PWM 51 select SAMSUNG_DEV_PWM
41 select SAMSUNG_DEV_TS 52 select SAMSUNG_DEV_TS
53 select S5P64X0_SETUP_FB_24BPP
42 select S5P64X0_SETUP_I2C1 54 select S5P64X0_SETUP_I2C1
43 help 55 help
44 Machine support for the Samsung SMDK6440 56 Machine support for the Samsung SMDK6440
@@ -46,6 +58,7 @@ config MACH_SMDK6440
46config MACH_SMDK6450 58config MACH_SMDK6450
47 bool "SMDK6450" 59 bool "SMDK6450"
48 select CPU_S5P6450 60 select CPU_S5P6450
61 select S3C_DEV_FB
49 select S3C_DEV_I2C1 62 select S3C_DEV_I2C1
50 select S3C_DEV_RTC 63 select S3C_DEV_RTC
51 select S3C_DEV_WDT 64 select S3C_DEV_WDT
@@ -54,6 +67,7 @@ config MACH_SMDK6450
54 select SAMSUNG_DEV_BACKLIGHT 67 select SAMSUNG_DEV_BACKLIGHT
55 select SAMSUNG_DEV_PWM 68 select SAMSUNG_DEV_PWM
56 select SAMSUNG_DEV_TS 69 select SAMSUNG_DEV_TS
70 select S5P64X0_SETUP_FB_24BPP
57 select S5P64X0_SETUP_I2C1 71 select S5P64X0_SETUP_I2C1
58 help 72 help
59 Machine support for the Samsung SMDK6450 73 Machine support for the Samsung SMDK6450
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index 5f6afdf067ed..a1324d8dc4e0 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -12,10 +12,11 @@ obj- :=
12 12
13# Core support for S5P64X0 system 13# Core support for S5P64X0 system
14 14
15obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o gpiolib.o 15obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o
16obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o irq-eint.o 16obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o irq-eint.o
17obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o 17obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o
18obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o 18obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o
19obj-$(CONFIG_PM) += pm.o irq-pm.o
19 20
20# machine support 21# machine support
21 22
@@ -28,3 +29,4 @@ obj-y += dev-audio.o
28obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 29obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
29 30
30obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o 31obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o
32obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c
index c1f548f69a0d..c54c65d511f0 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6440.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c
@@ -147,6 +147,7 @@ static struct clk init_clocks_off[] = {
147 .ctrlbit = (1 << 8), 147 .ctrlbit = (1 << 8),
148 }, { 148 }, {
149 .name = "dma", 149 .name = "dma",
150 .devname = "dma-pl330",
150 .parent = &clk_hclk_low.clk, 151 .parent = &clk_hclk_low.clk,
151 .enable = s5p64x0_hclk0_ctrl, 152 .enable = s5p64x0_hclk0_ctrl,
152 .ctrlbit = (1 << 12), 153 .ctrlbit = (1 << 12),
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c
index 3d9b60975570..2d04abfba12e 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6450.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c
@@ -180,6 +180,7 @@ static struct clk init_clocks_off[] = {
180 .ctrlbit = (1 << 3), 180 .ctrlbit = (1 << 3),
181 }, { 181 }, {
182 .name = "dma", 182 .name = "dma",
183 .devname = "dma-pl330",
183 .parent = &clk_hclk_low.clk, 184 .parent = &clk_hclk_low.clk,
184 .enable = s5p64x0_hclk0_ctrl, 185 .enable = s5p64x0_hclk0_ctrl,
185 .ctrlbit = (1 << 12), 186 .ctrlbit = (1 << 12),
diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
index 8a938542c54d..ecab40cf19ab 100644
--- a/arch/arm/mach-s5p64x0/cpu.c
+++ b/arch/arm/mach-s5p64x0/cpu.c
@@ -39,6 +39,7 @@
39#include <plat/s5p6440.h> 39#include <plat/s5p6440.h>
40#include <plat/s5p6450.h> 40#include <plat/s5p6450.h>
41#include <plat/adc-core.h> 41#include <plat/adc-core.h>
42#include <plat/fb-core.h>
42 43
43/* Initial IO mappings */ 44/* Initial IO mappings */
44 45
@@ -109,6 +110,7 @@ void __init s5p6440_map_io(void)
109{ 110{
110 /* initialize any device information early */ 111 /* initialize any device information early */
111 s3c_adc_setname("s3c64xx-adc"); 112 s3c_adc_setname("s3c64xx-adc");
113 s3c_fb_setname("s5p64x0-fb");
112 114
113 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc)); 115 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
114 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); 116 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
@@ -119,6 +121,7 @@ void __init s5p6450_map_io(void)
119{ 121{
120 /* initialize any device information early */ 122 /* initialize any device information early */
121 s3c_adc_setname("s3c64xx-adc"); 123 s3c_adc_setname("s3c64xx-adc");
124 s3c_fb_setname("s5p64x0-fb");
122 125
123 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc)); 126 iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
124 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); 127 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
diff --git a/arch/arm/mach-s5p64x0/include/mach/clkdev.h b/arch/arm/mach-s5p64x0/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-s5p64x0/include/mach/irqs.h
index 5837a36ece8d..53982db9d259 100644
--- a/arch/arm/mach-s5p64x0/include/mach/irqs.h
+++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h
@@ -87,6 +87,10 @@
87 87
88#define IRQ_I2S0 IRQ_I2SV40 88#define IRQ_I2S0 IRQ_I2SV40
89 89
90#define IRQ_LCD_FIFO IRQ_DISPCON0
91#define IRQ_LCD_VSYNC IRQ_DISPCON1
92#define IRQ_LCD_SYSTEM IRQ_DISPCON2
93
90/* S5P6450 EINT feature will be added */ 94/* S5P6450 EINT feature will be added */
91 95
92/* 96/*
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h
index 95c91257c7ca..4d3ac8a3709d 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -47,6 +47,8 @@
47 47
48#define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 48#define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
49 49
50#define S5P64X0_PA_FB 0xEE000000
51
50#define S5P64X0_PA_I2S 0xF2000000 52#define S5P64X0_PA_I2S 0xF2000000
51#define S5P6450_PA_I2S1 0xF2800000 53#define S5P6450_PA_I2S1 0xF2800000
52#define S5P6450_PA_I2S2 0xF2900000 54#define S5P6450_PA_I2S2 0xF2900000
@@ -64,6 +66,7 @@
64#define S3C_PA_IIC1 S5P6440_PA_IIC1 66#define S3C_PA_IIC1 S5P6440_PA_IIC1
65#define S3C_PA_RTC S5P64X0_PA_RTC 67#define S3C_PA_RTC S5P64X0_PA_RTC
66#define S3C_PA_WDT S5P64X0_PA_WDT 68#define S3C_PA_WDT S5P64X0_PA_WDT
69#define S3C_PA_FB S5P64X0_PA_FB
67 70
68#define S5P_PA_CHIPID S5P64X0_PA_CHIPID 71#define S5P_PA_CHIPID S5P64X0_PA_CHIPID
69#define S5P_PA_SROMC S5P64X0_PA_SROMC 72#define S5P_PA_SROMC S5P64X0_PA_SROMC
@@ -85,5 +88,6 @@
85#define S5P_PA_UART5 S5P6450_PA_UART(5) 88#define S5P_PA_UART5 S5P6450_PA_UART(5)
86 89
87#define S5P_SZ_UART SZ_256 90#define S5P_SZ_UART SZ_256
91#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
88 92
89#endif /* __ASM_ARCH_MAP_H */ 93#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/pm-core.h b/arch/arm/mach-s5p64x0/include/mach/pm-core.h
new file mode 100644
index 000000000000..e52f7545d3aa
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/include/mach/pm-core.h
@@ -0,0 +1,117 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/pm-core.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - PM core support for arch/arm/plat-samsung/pm.c
7 *
8 * Based on PM core support for S3C64XX by Ben Dooks
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <mach/regs-gpio.h>
16
17static inline void s3c_pm_debug_init_uart(void)
18{
19 u32 tmp = __raw_readl(S5P64X0_CLK_GATE_PCLK);
20
21 /*
22 * As a note, since the S5P64X0 UARTs generally have multiple
23 * clock sources, we simply enable PCLK at the moment and hope
24 * that the resume settings for the UART are suitable for the
25 * use with PCLK.
26 */
27 tmp |= S5P64X0_CLK_GATE_PCLK_UART0;
28 tmp |= S5P64X0_CLK_GATE_PCLK_UART1;
29 tmp |= S5P64X0_CLK_GATE_PCLK_UART2;
30 tmp |= S5P64X0_CLK_GATE_PCLK_UART3;
31
32 __raw_writel(tmp, S5P64X0_CLK_GATE_PCLK);
33 udelay(10);
34}
35
36static inline void s3c_pm_arch_prepare_irqs(void)
37{
38 /* VIC should have already been taken care of */
39
40 /* clear any pending EINT0 interrupts */
41 __raw_writel(__raw_readl(S5P64X0_EINT0PEND), S5P64X0_EINT0PEND);
42}
43
44static inline void s3c_pm_arch_stop_clocks(void) { }
45static inline void s3c_pm_arch_show_resume_irqs(void) { }
46
47/*
48 * make these defines, we currently do not have any need to change
49 * the IRQ wake controls depending on the CPU we are running on
50 */
51#define s3c_irqwake_eintallow ((1 << 16) - 1)
52#define s3c_irqwake_intallow (~0)
53
54static inline void s3c_pm_arch_update_uart(void __iomem *regs,
55 struct pm_uart_save *save)
56{
57 u32 ucon = __raw_readl(regs + S3C2410_UCON);
58 u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK;
59 u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK;
60 u32 new_ucon;
61 u32 delta;
62
63 /*
64 * S5P64X0 UART blocks only support level interrupts, so ensure that
65 * when we restore unused UART blocks we force the level interrupt
66 * settings.
67 */
68 save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
69
70 /*
71 * We have a constraint on changing the clock type of the UART
72 * between UCLKx and PCLK, so ensure that when we restore UCON
73 * that the CLK field is correctly modified if the bootloader
74 * has changed anything.
75 */
76 if (ucon_clk != save_clk) {
77 new_ucon = save->ucon;
78 delta = ucon_clk ^ save_clk;
79
80 /*
81 * change from UCLKx => wrong PCLK,
82 * either UCLK can be tested for by a bit-test
83 * with UCLK0
84 */
85 if (ucon_clk & S3C6400_UCON_UCLK0 &&
86 !(save_clk & S3C6400_UCON_UCLK0) &&
87 delta & S3C6400_UCON_PCLK2) {
88 new_ucon &= ~S3C6400_UCON_UCLK0;
89 } else if (delta == S3C6400_UCON_PCLK2) {
90 /*
91 * as a precaution, don't change from
92 * PCLK2 => PCLK or vice-versa
93 */
94 new_ucon ^= S3C6400_UCON_PCLK2;
95 }
96
97 S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
98 ucon, new_ucon, save->ucon);
99 save->ucon = new_ucon;
100 }
101}
102
103static inline void s3c_pm_restored_gpios(void)
104{
105 /* ensure sleep mode has been cleared from the system */
106 __raw_writel(0, S5P64X0_SLPEN);
107}
108
109static inline void samsung_pm_saved_gpios(void)
110{
111 /*
112 * turn on the sleep mode and keep it there, as it seems that during
113 * suspend the xCON registers get re-set and thus you can end up with
114 * problems between going to sleep and resuming.
115 */
116 __raw_writel(S5P64X0_SLPEN_USE_xSLP, S5P64X0_SLPEN);
117}
diff --git a/arch/arm/mach-s5p64x0/include/mach/pwm-clock.h b/arch/arm/mach-s5p64x0/include/mach/pwm-clock.h
deleted file mode 100644
index 19fff8b701c0..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/pwm-clock.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/pwm-clock.h
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/
10 *
11 * S5P64X0 - pwm clock and timer support
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16*/
17
18#ifndef __ASM_ARCH_PWMCLK_H
19#define __ASM_ARCH_PWMCLK_H __FILE__
20
21/**
22 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
23 * @tcfg: The timer TCFG1 register bits shifted down to 0.
24 *
25 * Return true if the given configuration from TCFG1 is a TCLK instead
26 * any of the TDIV clocks.
27 */
28static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
29{
30 return 0;
31}
32
33/**
34 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
35 * @tcfg1: The tcfg1 setting, shifted down.
36 *
37 * Get the divisor value for the given tcfg1 setting. We assume the
38 * caller has already checked to see if this is not a TCLK source.
39 */
40static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
41{
42 return 1 << tcfg1;
43}
44
45/**
46 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
47 *
48 * Return true if we have a /1 in the tdiv setting.
49 */
50static inline unsigned int pwm_tdiv_has_div1(void)
51{
52 return 1;
53}
54
55/**
56 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
57 * @div: The divisor to calculate the bit information for.
58 *
59 * Turn a divisor into the necessary bit field for TCFG1.
60 */
61static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
62{
63 return ilog2(div);
64}
65
66#define S3C_TCFG1_MUX_TCLK 0
67
68#endif /* __ASM_ARCH_PWMCLK_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-clock.h b/arch/arm/mach-s5p64x0/include/mach/regs-clock.h
index a133f22fa155..bd91112c813c 100644
--- a/arch/arm/mach-s5p64x0/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5p64x0/include/mach/regs-clock.h
@@ -41,17 +41,50 @@
41#define S5P6450_DPLL_CON S5P_CLKREG(0x50) 41#define S5P6450_DPLL_CON S5P_CLKREG(0x50)
42#define S5P6450_DPLL_CON_K S5P_CLKREG(0x54) 42#define S5P6450_DPLL_CON_K S5P_CLKREG(0x54)
43 43
44#define S5P64X0_AHB_CON0 S5P_CLKREG(0x100)
44#define S5P64X0_CLK_SRC1 S5P_CLKREG(0x10C) 45#define S5P64X0_CLK_SRC1 S5P_CLKREG(0x10C)
45 46
46#define S5P64X0_SYS_ID S5P_CLKREG(0x118) 47#define S5P64X0_SYS_ID S5P_CLKREG(0x118)
47#define S5P64X0_SYS_OTHERS S5P_CLKREG(0x11C) 48#define S5P64X0_SYS_OTHERS S5P_CLKREG(0x11C)
48 49
49#define S5P64X0_PWR_CFG S5P_CLKREG(0x804) 50#define S5P64X0_PWR_CFG S5P_CLKREG(0x804)
51#define S5P64X0_EINT_WAKEUP_MASK S5P_CLKREG(0x808)
52#define S5P64X0_SLEEP_CFG S5P_CLKREG(0x818)
53#define S5P64X0_PWR_STABLE S5P_CLKREG(0x828)
54
50#define S5P64X0_OTHERS S5P_CLKREG(0x900) 55#define S5P64X0_OTHERS S5P_CLKREG(0x900)
56#define S5P64X0_WAKEUP_STAT S5P_CLKREG(0x908)
57
58#define S5P64X0_INFORM0 S5P_CLKREG(0xA00)
51 59
52#define S5P64X0_CLKDIV0_HCLK_SHIFT (8) 60#define S5P64X0_CLKDIV0_HCLK_SHIFT (8)
53#define S5P64X0_CLKDIV0_HCLK_MASK (0xF << S5P64X0_CLKDIV0_HCLK_SHIFT) 61#define S5P64X0_CLKDIV0_HCLK_MASK (0xF << S5P64X0_CLKDIV0_HCLK_SHIFT)
54 62
63/* HCLK GATE Registers */
64#define S5P64X0_CLK_GATE_HCLK1_FIMGVG (1 << 2)
65#define S5P64X0_CLK_GATE_SCLK1_FIMGVG (1 << 2)
66
67/* PCLK GATE Registers */
68#define S5P64X0_CLK_GATE_PCLK_UART3 (1 << 4)
69#define S5P64X0_CLK_GATE_PCLK_UART2 (1 << 3)
70#define S5P64X0_CLK_GATE_PCLK_UART1 (1 << 2)
71#define S5P64X0_CLK_GATE_PCLK_UART0 (1 << 1)
72
73#define S5P64X0_PWR_CFG_MMC1_DISABLE (1 << 15)
74#define S5P64X0_PWR_CFG_MMC0_DISABLE (1 << 14)
75#define S5P64X0_PWR_CFG_RTC_TICK_DISABLE (1 << 11)
76#define S5P64X0_PWR_CFG_RTC_ALRM_DISABLE (1 << 10)
77#define S5P64X0_PWR_CFG_WFI_MASK (3 << 5)
78#define S5P64X0_PWR_CFG_WFI_SLEEP (3 << 5)
79
80#define S5P64X0_SLEEP_CFG_OSC_EN (1 << 0)
81
82#define S5P64X0_PWR_STABLE_PWR_CNT_VAL4 (4 << 0)
83
84#define S5P6450_OTHERS_DISABLE_INT (1 << 31)
85#define S5P64X0_OTHERS_RET_UART (1 << 26)
86#define S5P64X0_OTHERS_RET_MMC1 (1 << 25)
87#define S5P64X0_OTHERS_RET_MMC0 (1 << 24)
55#define S5P64X0_OTHERS_USB_SIG_MASK (1 << 16) 88#define S5P64X0_OTHERS_USB_SIG_MASK (1 << 16)
56 89
57/* Compatibility defines */ 90/* Compatibility defines */
diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
index 6ce254729f3b..cfdfa4fdadf2 100644
--- a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
@@ -34,14 +34,35 @@
34#define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180) 34#define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180)
35#define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) 35#define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300)
36 36
37#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0)
38#define S5P64X0_SPCON0_LCD_SEL_MASK (0x3 << 0)
39#define S5P64X0_SPCON0_LCD_SEL_RGB (0x1 << 0)
40#define S5P64X0_SPCON1 (S5P_VA_GPIO + 0x2B0)
41
42#define S5P64X0_MEM0CONSLP0 (S5P_VA_GPIO + 0x1C0)
43#define S5P64X0_MEM0CONSLP1 (S5P_VA_GPIO + 0x1C4)
44#define S5P64X0_MEM0DRVCON (S5P_VA_GPIO + 0x1D0)
45#define S5P64X0_MEM1DRVCON (S5P_VA_GPIO + 0x1D4)
46
47#define S5P64X0_EINT12CON (S5P_VA_GPIO + 0x200)
48#define S5P64X0_EINT12FLTCON (S5P_VA_GPIO + 0x220)
49#define S5P64X0_EINT12MASK (S5P_VA_GPIO + 0x240)
50
37/* External interrupt control registers for group0 */ 51/* External interrupt control registers for group0 */
38 52
39#define EINT0CON0_OFFSET (0x900) 53#define EINT0CON0_OFFSET (0x900)
54#define EINT0FLTCON0_OFFSET (0x910)
55#define EINT0FLTCON1_OFFSET (0x914)
40#define EINT0MASK_OFFSET (0x920) 56#define EINT0MASK_OFFSET (0x920)
41#define EINT0PEND_OFFSET (0x924) 57#define EINT0PEND_OFFSET (0x924)
42 58
43#define S5P64X0_EINT0CON0 (S5P_VA_GPIO + EINT0CON0_OFFSET) 59#define S5P64X0_EINT0CON0 (S5P_VA_GPIO + EINT0CON0_OFFSET)
60#define S5P64X0_EINT0FLTCON0 (S5P_VA_GPIO + EINT0FLTCON0_OFFSET)
61#define S5P64X0_EINT0FLTCON1 (S5P_VA_GPIO + EINT0FLTCON1_OFFSET)
44#define S5P64X0_EINT0MASK (S5P_VA_GPIO + EINT0MASK_OFFSET) 62#define S5P64X0_EINT0MASK (S5P_VA_GPIO + EINT0MASK_OFFSET)
45#define S5P64X0_EINT0PEND (S5P_VA_GPIO + EINT0PEND_OFFSET) 63#define S5P64X0_EINT0PEND (S5P_VA_GPIO + EINT0PEND_OFFSET)
46 64
65#define S5P64X0_SLPEN (S5P_VA_GPIO + 0x930)
66#define S5P64X0_SLPEN_USE_xSLP (1 << 0)
67
47#endif /* __ASM_ARCH_REGS_GPIO_H */ 68#endif /* __ASM_ARCH_REGS_GPIO_H */
diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c
index 494e1a8f6f6d..275dc74f4a7b 100644
--- a/arch/arm/mach-s5p64x0/irq-eint.c
+++ b/arch/arm/mach-s5p64x0/irq-eint.c
@@ -20,6 +20,7 @@
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/regs-irqtype.h> 21#include <plat/regs-irqtype.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23#include <plat/pm.h>
23 24
24#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
25#include <mach/regs-clock.h> 26#include <mach/regs-clock.h>
@@ -134,6 +135,7 @@ static int s5p64x0_alloc_gc(void)
134 ct->chip.irq_mask = irq_gc_mask_set_bit; 135 ct->chip.irq_mask = irq_gc_mask_set_bit;
135 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 136 ct->chip.irq_unmask = irq_gc_mask_clr_bit;
136 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type; 137 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type;
138 ct->chip.irq_set_wake = s3c_irqext_wake;
137 ct->regs.ack = EINT0PEND_OFFSET; 139 ct->regs.ack = EINT0PEND_OFFSET;
138 ct->regs.mask = EINT0MASK_OFFSET; 140 ct->regs.mask = EINT0MASK_OFFSET;
139 irq_setup_generic_chip(gc, IRQ_MSK(16), IRQ_GC_INIT_MASK_CACHE, 141 irq_setup_generic_chip(gc, IRQ_MSK(16), IRQ_GC_INIT_MASK_CACHE,
diff --git a/arch/arm/mach-s5p64x0/irq-pm.c b/arch/arm/mach-s5p64x0/irq-pm.c
new file mode 100644
index 000000000000..3e6f2456ee9d
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/irq-pm.c
@@ -0,0 +1,92 @@
1/* linux/arch/arm/mach-s5p64x0/irq-pm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - Interrupt handling Power Management
7 *
8 * Based on arch/arm/mach-s3c64xx/irq-pm.c by Ben Dooks
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/syscore_ops.h>
16#include <linux/serial_core.h>
17#include <linux/io.h>
18
19#include <plat/regs-serial.h>
20#include <plat/pm.h>
21
22#include <mach/regs-gpio.h>
23
24static struct sleep_save irq_save[] = {
25 SAVE_ITEM(S5P64X0_EINT0CON0),
26 SAVE_ITEM(S5P64X0_EINT0FLTCON0),
27 SAVE_ITEM(S5P64X0_EINT0FLTCON1),
28 SAVE_ITEM(S5P64X0_EINT0MASK),
29};
30
31static struct irq_grp_save {
32 u32 con;
33 u32 fltcon;
34 u32 mask;
35} eint_grp_save[4];
36
37static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
38
39static int s5p64x0_irq_pm_suspend(void)
40{
41 struct irq_grp_save *grp = eint_grp_save;
42 int i;
43
44 S3C_PMDBG("%s: suspending IRQs\n", __func__);
45
46 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
47
48 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
49 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
50
51 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
52 grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4));
53 grp->mask = __raw_readl(S5P64X0_EINT12MASK + (i * 4));
54 grp->fltcon = __raw_readl(S5P64X0_EINT12FLTCON + (i * 4));
55 }
56
57 return 0;
58}
59
60static void s5p64x0_irq_pm_resume(void)
61{
62 struct irq_grp_save *grp = eint_grp_save;
63 int i;
64
65 S3C_PMDBG("%s: resuming IRQs\n", __func__);
66
67 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
68
69 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
70 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
71
72 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
73 __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4));
74 __raw_writel(grp->mask, S5P64X0_EINT12MASK + (i * 4));
75 __raw_writel(grp->fltcon, S5P64X0_EINT12FLTCON + (i * 4));
76 }
77
78 S3C_PMDBG("%s: IRQ configuration restored\n", __func__);
79}
80
81static struct syscore_ops s5p64x0_irq_syscore_ops = {
82 .suspend = s5p64x0_irq_pm_suspend,
83 .resume = s5p64x0_irq_pm_resume,
84};
85
86static int __init s5p64x0_syscore_init(void)
87{
88 register_syscore_ops(&s5p64x0_irq_syscore_ops);
89
90 return 0;
91}
92core_initcall(s5p64x0_syscore_init);
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 88857f5a49f7..4a1250cd1356 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -23,6 +23,9 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/fb.h>
27
28#include <video/platform_lcd.h>
26 29
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -47,6 +50,8 @@
47#include <plat/ts.h> 50#include <plat/ts.h>
48#include <plat/s5p-time.h> 51#include <plat/s5p-time.h>
49#include <plat/backlight.h> 52#include <plat/backlight.h>
53#include <plat/fb.h>
54#include <plat/regs-fb.h>
50 55
51#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 56#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 57 S3C2410_UCON_RXILEVEL | \
@@ -92,6 +97,59 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
92 }, 97 },
93}; 98};
94 99
100/* Frame Buffer */
101static struct s3c_fb_pd_win smdk6440_fb_win0 = {
102 .win_mode = {
103 .left_margin = 8,
104 .right_margin = 13,
105 .upper_margin = 7,
106 .lower_margin = 5,
107 .hsync_len = 3,
108 .vsync_len = 1,
109 .xres = 800,
110 .yres = 480,
111 },
112 .max_bpp = 32,
113 .default_bpp = 24,
114};
115
116static struct s3c_fb_platdata smdk6440_lcd_pdata __initdata = {
117 .win[0] = &smdk6440_fb_win0,
118 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
119 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
120 .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
121};
122
123/* LCD power controller */
124static void smdk6440_lte480_reset_power(struct plat_lcd_data *pd,
125 unsigned int power)
126{
127 int err;
128
129 if (power) {
130 err = gpio_request(S5P6440_GPN(5), "GPN");
131 if (err) {
132 printk(KERN_ERR "failed to request GPN for lcd reset\n");
133 return;
134 }
135
136 gpio_direction_output(S5P6440_GPN(5), 1);
137 gpio_set_value(S5P6440_GPN(5), 0);
138 gpio_set_value(S5P6440_GPN(5), 1);
139 gpio_free(S5P6440_GPN(5));
140 }
141}
142
143static struct plat_lcd_data smdk6440_lcd_power_data = {
144 .set_power = smdk6440_lte480_reset_power,
145};
146
147static struct platform_device smdk6440_lcd_lte480wv = {
148 .name = "platform-lcd",
149 .dev.parent = &s3c_device_fb.dev,
150 .dev.platform_data = &smdk6440_lcd_power_data,
151};
152
95static struct platform_device *smdk6440_devices[] __initdata = { 153static struct platform_device *smdk6440_devices[] __initdata = {
96 &s3c_device_adc, 154 &s3c_device_adc,
97 &s3c_device_rtc, 155 &s3c_device_rtc,
@@ -101,6 +159,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
101 &s3c_device_wdt, 159 &s3c_device_wdt,
102 &samsung_asoc_dma, 160 &samsung_asoc_dma,
103 &s5p6440_device_iis, 161 &s5p6440_device_iis,
162 &s3c_device_fb,
163 &smdk6440_lcd_lte480wv,
104}; 164};
105 165
106static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 166static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -147,6 +207,17 @@ static void __init smdk6440_map_io(void)
147 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 207 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
148} 208}
149 209
210static void s5p6440_set_lcd_interface(void)
211{
212 unsigned int cfg;
213
214 /* select TFT LCD type (RGB I/F) */
215 cfg = __raw_readl(S5P64X0_SPCON0);
216 cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
217 cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
218 __raw_writel(cfg, S5P64X0_SPCON0);
219}
220
150static void __init smdk6440_machine_init(void) 221static void __init smdk6440_machine_init(void)
151{ 222{
152 s3c24xx_ts_set_platdata(NULL); 223 s3c24xx_ts_set_platdata(NULL);
@@ -160,6 +231,9 @@ static void __init smdk6440_machine_init(void)
160 231
161 samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data); 232 samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
162 233
234 s5p6440_set_lcd_interface();
235 s3c_fb_set_platdata(&smdk6440_lcd_pdata);
236
163 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); 237 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
164} 238}
165 239
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index e1b277b94610..0ab129ecf009 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -23,6 +23,9 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/fb.h>
27
28#include <video/platform_lcd.h>
26 29
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -47,6 +50,8 @@
47#include <plat/ts.h> 50#include <plat/ts.h>
48#include <plat/s5p-time.h> 51#include <plat/s5p-time.h>
49#include <plat/backlight.h> 52#include <plat/backlight.h>
53#include <plat/fb.h>
54#include <plat/regs-fb.h>
50 55
51#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 56#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 57 S3C2410_UCON_RXILEVEL | \
@@ -110,6 +115,59 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
110#endif 115#endif
111}; 116};
112 117
118/* Frame Buffer */
119static struct s3c_fb_pd_win smdk6450_fb_win0 = {
120 .win_mode = {
121 .left_margin = 8,
122 .right_margin = 13,
123 .upper_margin = 7,
124 .lower_margin = 5,
125 .hsync_len = 3,
126 .vsync_len = 1,
127 .xres = 800,
128 .yres = 480,
129 },
130 .max_bpp = 32,
131 .default_bpp = 24,
132};
133
134static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata = {
135 .win[0] = &smdk6450_fb_win0,
136 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
137 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
138 .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
139};
140
141/* LCD power controller */
142static void smdk6450_lte480_reset_power(struct plat_lcd_data *pd,
143 unsigned int power)
144{
145 int err;
146
147 if (power) {
148 err = gpio_request(S5P6450_GPN(5), "GPN");
149 if (err) {
150 printk(KERN_ERR "failed to request GPN for lcd reset\n");
151 return;
152 }
153
154 gpio_direction_output(S5P6450_GPN(5), 1);
155 gpio_set_value(S5P6450_GPN(5), 0);
156 gpio_set_value(S5P6450_GPN(5), 1);
157 gpio_free(S5P6450_GPN(5));
158 }
159}
160
161static struct plat_lcd_data smdk6450_lcd_power_data = {
162 .set_power = smdk6450_lte480_reset_power,
163};
164
165static struct platform_device smdk6450_lcd_lte480wv = {
166 .name = "platform-lcd",
167 .dev.parent = &s3c_device_fb.dev,
168 .dev.platform_data = &smdk6450_lcd_power_data,
169};
170
113static struct platform_device *smdk6450_devices[] __initdata = { 171static struct platform_device *smdk6450_devices[] __initdata = {
114 &s3c_device_adc, 172 &s3c_device_adc,
115 &s3c_device_rtc, 173 &s3c_device_rtc,
@@ -119,6 +177,9 @@ static struct platform_device *smdk6450_devices[] __initdata = {
119 &s3c_device_wdt, 177 &s3c_device_wdt,
120 &samsung_asoc_dma, 178 &samsung_asoc_dma,
121 &s5p6450_device_iis0, 179 &s5p6450_device_iis0,
180 &s3c_device_fb,
181 &smdk6450_lcd_lte480wv,
182
122 /* s5p6450_device_spi0 will be added */ 183 /* s5p6450_device_spi0 will be added */
123}; 184};
124 185
@@ -166,6 +227,17 @@ static void __init smdk6450_map_io(void)
166 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 227 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
167} 228}
168 229
230static void s5p6450_set_lcd_interface(void)
231{
232 unsigned int cfg;
233
234 /* select TFT LCD type (RGB I/F) */
235 cfg = __raw_readl(S5P64X0_SPCON0);
236 cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
237 cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
238 __raw_writel(cfg, S5P64X0_SPCON0);
239}
240
169static void __init smdk6450_machine_init(void) 241static void __init smdk6450_machine_init(void)
170{ 242{
171 s3c24xx_ts_set_platdata(NULL); 243 s3c24xx_ts_set_platdata(NULL);
@@ -179,6 +251,9 @@ static void __init smdk6450_machine_init(void)
179 251
180 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); 252 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
181 253
254 s5p6450_set_lcd_interface();
255 s3c_fb_set_platdata(&smdk6450_lcd_pdata);
256
182 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); 257 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
183} 258}
184 259
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c
new file mode 100644
index 000000000000..69927243d25f
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/pm.c
@@ -0,0 +1,204 @@
1/* linux/arch/arm/mach-s5p64x0/pm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 Power Management Support
7 *
8 * Based on arch/arm/mach-s3c64xx/pm.c by Ben Dooks
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/suspend.h>
16#include <linux/syscore_ops.h>
17#include <linux/io.h>
18
19#include <plat/cpu.h>
20#include <plat/pm.h>
21#include <plat/regs-timer.h>
22#include <plat/wakeup-mask.h>
23
24#include <mach/regs-clock.h>
25#include <mach/regs-gpio.h>
26
27static struct sleep_save s5p64x0_core_save[] = {
28 SAVE_ITEM(S5P64X0_APLL_CON),
29 SAVE_ITEM(S5P64X0_MPLL_CON),
30 SAVE_ITEM(S5P64X0_EPLL_CON),
31 SAVE_ITEM(S5P64X0_EPLL_CON_K),
32 SAVE_ITEM(S5P64X0_CLK_SRC0),
33 SAVE_ITEM(S5P64X0_CLK_SRC1),
34 SAVE_ITEM(S5P64X0_CLK_DIV0),
35 SAVE_ITEM(S5P64X0_CLK_DIV1),
36 SAVE_ITEM(S5P64X0_CLK_DIV2),
37 SAVE_ITEM(S5P64X0_CLK_DIV3),
38 SAVE_ITEM(S5P64X0_CLK_GATE_MEM0),
39 SAVE_ITEM(S5P64X0_CLK_GATE_HCLK1),
40 SAVE_ITEM(S5P64X0_CLK_GATE_SCLK1),
41};
42
43static struct sleep_save s5p64x0_misc_save[] = {
44 SAVE_ITEM(S5P64X0_AHB_CON0),
45 SAVE_ITEM(S5P64X0_SPCON0),
46 SAVE_ITEM(S5P64X0_SPCON1),
47 SAVE_ITEM(S5P64X0_MEM0CONSLP0),
48 SAVE_ITEM(S5P64X0_MEM0CONSLP1),
49 SAVE_ITEM(S5P64X0_MEM0DRVCON),
50 SAVE_ITEM(S5P64X0_MEM1DRVCON),
51
52 SAVE_ITEM(S3C64XX_TINT_CSTAT),
53};
54
55/* DPLL is present only in S5P6450 */
56static struct sleep_save s5p6450_core_save[] = {
57 SAVE_ITEM(S5P6450_DPLL_CON),
58 SAVE_ITEM(S5P6450_DPLL_CON_K),
59};
60
61void s3c_pm_configure_extint(void)
62{
63 __raw_writel(s3c_irqwake_eintmask, S5P64X0_EINT_WAKEUP_MASK);
64}
65
66void s3c_pm_restore_core(void)
67{
68 __raw_writel(0, S5P64X0_EINT_WAKEUP_MASK);
69
70 s3c_pm_do_restore_core(s5p64x0_core_save,
71 ARRAY_SIZE(s5p64x0_core_save));
72
73 if (soc_is_s5p6450())
74 s3c_pm_do_restore_core(s5p6450_core_save,
75 ARRAY_SIZE(s5p6450_core_save));
76
77 s3c_pm_do_restore(s5p64x0_misc_save, ARRAY_SIZE(s5p64x0_misc_save));
78}
79
80void s3c_pm_save_core(void)
81{
82 s3c_pm_do_save(s5p64x0_misc_save, ARRAY_SIZE(s5p64x0_misc_save));
83
84 if (soc_is_s5p6450())
85 s3c_pm_do_save(s5p6450_core_save,
86 ARRAY_SIZE(s5p6450_core_save));
87
88 s3c_pm_do_save(s5p64x0_core_save, ARRAY_SIZE(s5p64x0_core_save));
89}
90
91static int s5p64x0_cpu_suspend(unsigned long arg)
92{
93 unsigned long tmp = 0;
94
95 /*
96 * Issue the standby signal into the pm unit. Note, we
97 * issue a write-buffer drain just in case.
98 */
99 asm("b 1f\n\t"
100 ".align 5\n\t"
101 "1:\n\t"
102 "mcr p15, 0, %0, c7, c10, 5\n\t"
103 "mcr p15, 0, %0, c7, c10, 4\n\t"
104 "mcr p15, 0, %0, c7, c0, 4" : : "r" (tmp));
105
106 /* we should never get past here */
107 panic("sleep resumed to originator?");
108}
109
110/* mapping of interrupts to parts of the wakeup mask */
111static struct samsung_wakeup_mask s5p64x0_wake_irqs[] = {
112 { .irq = IRQ_RTC_ALARM, .bit = S5P64X0_PWR_CFG_RTC_ALRM_DISABLE, },
113 { .irq = IRQ_RTC_TIC, .bit = S5P64X0_PWR_CFG_RTC_TICK_DISABLE, },
114 { .irq = IRQ_HSMMC0, .bit = S5P64X0_PWR_CFG_MMC0_DISABLE, },
115 { .irq = IRQ_HSMMC1, .bit = S5P64X0_PWR_CFG_MMC1_DISABLE, },
116};
117
118static void s5p64x0_pm_prepare(void)
119{
120 u32 tmp;
121
122 samsung_sync_wakemask(S5P64X0_PWR_CFG,
123 s5p64x0_wake_irqs, ARRAY_SIZE(s5p64x0_wake_irqs));
124
125 /* store the resume address in INFORM0 register */
126 __raw_writel(virt_to_phys(s3c_cpu_resume), S5P64X0_INFORM0);
127
128 /* setup clock gating for FIMGVG block */
129 __raw_writel((__raw_readl(S5P64X0_CLK_GATE_HCLK1) | \
130 (S5P64X0_CLK_GATE_HCLK1_FIMGVG)), S5P64X0_CLK_GATE_HCLK1);
131 __raw_writel((__raw_readl(S5P64X0_CLK_GATE_SCLK1) | \
132 (S5P64X0_CLK_GATE_SCLK1_FIMGVG)), S5P64X0_CLK_GATE_SCLK1);
133
134 /* Configure the stabilization counter with wait time required */
135 __raw_writel(S5P64X0_PWR_STABLE_PWR_CNT_VAL4, S5P64X0_PWR_STABLE);
136
137 /* set WFI to SLEEP mode configuration */
138 tmp = __raw_readl(S5P64X0_SLEEP_CFG);
139 tmp &= ~(S5P64X0_SLEEP_CFG_OSC_EN);
140 __raw_writel(tmp, S5P64X0_SLEEP_CFG);
141
142 tmp = __raw_readl(S5P64X0_PWR_CFG);
143 tmp &= ~(S5P64X0_PWR_CFG_WFI_MASK);
144 tmp |= S5P64X0_PWR_CFG_WFI_SLEEP;
145 __raw_writel(tmp, S5P64X0_PWR_CFG);
146
147 /*
148 * set OTHERS register to disable interrupt before going to
149 * sleep. This bit is present only in S5P6450, it is reserved
150 * in S5P6440.
151 */
152 if (soc_is_s5p6450()) {
153 tmp = __raw_readl(S5P64X0_OTHERS);
154 tmp |= S5P6450_OTHERS_DISABLE_INT;
155 __raw_writel(tmp, S5P64X0_OTHERS);
156 }
157
158 /* ensure previous wakeup state is cleared before sleeping */
159 __raw_writel(__raw_readl(S5P64X0_WAKEUP_STAT), S5P64X0_WAKEUP_STAT);
160
161}
162
163static int s5p64x0_pm_add(struct sys_device *sysdev)
164{
165 pm_cpu_prep = s5p64x0_pm_prepare;
166 pm_cpu_sleep = s5p64x0_cpu_suspend;
167 pm_uart_udivslot = 1;
168
169 return 0;
170}
171
172static struct sysdev_driver s5p64x0_pm_driver = {
173 .add = s5p64x0_pm_add,
174};
175
176static __init int s5p64x0_pm_drvinit(void)
177{
178 s3c_pm_init();
179
180 return sysdev_driver_register(&s5p64x0_sysclass, &s5p64x0_pm_driver);
181}
182arch_initcall(s5p64x0_pm_drvinit);
183
184static void s5p64x0_pm_resume(void)
185{
186 u32 tmp;
187
188 tmp = __raw_readl(S5P64X0_OTHERS);
189 tmp |= (S5P64X0_OTHERS_RET_MMC0 | S5P64X0_OTHERS_RET_MMC1 | \
190 S5P64X0_OTHERS_RET_UART);
191 __raw_writel(tmp , S5P64X0_OTHERS);
192}
193
194static struct syscore_ops s5p64x0_pm_syscore_ops = {
195 .resume = s5p64x0_pm_resume,
196};
197
198static __init int s5p64x0_pm_syscore_init(void)
199{
200 register_syscore_ops(&s5p64x0_pm_syscore_ops);
201
202 return 0;
203}
204arch_initcall(s5p64x0_pm_syscore_init);
diff --git a/arch/arm/mach-s5p64x0/setup-fb-24bpp.c b/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
new file mode 100644
index 000000000000..f346ee4af54d
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
@@ -0,0 +1,29 @@
1/* linux/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Base S5P64X0 GPIO setup information for LCD framebuffer
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/fb.h>
14#include <linux/gpio.h>
15
16#include <plat/cpu.h>
17#include <plat/fb.h>
18#include <plat/gpio-cfg.h>
19
20void s5p64x0_fb_gpio_setup_24bpp(void)
21{
22 if (soc_is_s5p6440()) {
23 s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16, S3C_GPIO_SFN(2));
24 s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12, S3C_GPIO_SFN(2));
25 } else if (soc_is_s5p6450()) {
26 s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16, S3C_GPIO_SFN(2));
27 s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12, S3C_GPIO_SFN(2));
28 }
29}
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
index 6527c05c5fa1..8d47709da713 100644
--- a/arch/arm/mach-s5pc100/clock.c
+++ b/arch/arm/mach-s5pc100/clock.c
@@ -460,13 +460,13 @@ static struct clk init_clocks_off[] = {
460 .ctrlbit = (1 << 2), 460 .ctrlbit = (1 << 2),
461 }, { 461 }, {
462 .name = "dma", 462 .name = "dma",
463 .devname = "s3c-pl330.1", 463 .devname = "dma-pl330.1",
464 .parent = &clk_div_d1_bus.clk, 464 .parent = &clk_div_d1_bus.clk,
465 .enable = s5pc100_d1_0_ctrl, 465 .enable = s5pc100_d1_0_ctrl,
466 .ctrlbit = (1 << 1), 466 .ctrlbit = (1 << 1),
467 }, { 467 }, {
468 .name = "dma", 468 .name = "dma",
469 .devname = "s3c-pl330.0", 469 .devname = "dma-pl330.0",
470 .parent = &clk_div_d1_bus.clk, 470 .parent = &clk_div_d1_bus.clk,
471 .enable = s5pc100_d1_0_ctrl, 471 .enable = s5pc100_d1_0_ctrl,
472 .ctrlbit = (1 << 0), 472 .ctrlbit = (1 << 0),
diff --git a/arch/arm/mach-s5pc100/dma.c b/arch/arm/mach-s5pc100/dma.c
index ef803e92d35d..065a087f5a8b 100644
--- a/arch/arm/mach-s5pc100/dma.c
+++ b/arch/arm/mach-s5pc100/dma.c
@@ -260,6 +260,7 @@ struct amba_device s5pc100_device_pdma1 = {
260static int __init s5pc100_dma_init(void) 260static int __init s5pc100_dma_init(void)
261{ 261{
262 amba_device_register(&s5pc100_device_pdma0, &iomem_resource); 262 amba_device_register(&s5pc100_device_pdma0, &iomem_resource);
263 amba_device_register(&s5pc100_device_pdma1, &iomem_resource);
263 264
264 return 0; 265 return 0;
265} 266}
diff --git a/arch/arm/mach-s5pc100/include/mach/clkdev.h b/arch/arm/mach-s5pc100/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/mach-s5pc100/include/mach/pwm-clock.h b/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
deleted file mode 100644
index b34d2f7aae52..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - pwm clock and timer support
7 *
8 * Based on mach-s3c6400/include/mach/pwm-clock.h
9 */
10
11/**
12 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
13 * @tcfg: The timer TCFG1 register bits shifted down to 0.
14 *
15 * Return true if the given configuration from TCFG1 is a TCLK instead
16 * any of the TDIV clocks.
17 */
18static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
19{
20 return tcfg >= S3C64XX_TCFG1_MUX_TCLK;
21}
22
23/**
24 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
25 * @tcfg1: The tcfg1 setting, shifted down.
26 *
27 * Get the divisor value for the given tcfg1 setting. We assume the
28 * caller has already checked to see if this is not a TCLK source.
29 */
30static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
31{
32 return 1 << tcfg1;
33}
34
35/**
36 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
37 *
38 * Return true if we have a /1 in the tdiv setting.
39 */
40static inline unsigned int pwm_tdiv_has_div1(void)
41{
42 return 1;
43}
44
45/**
46 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
47 * @div: The divisor to calculate the bit information for.
48 *
49 * Turn a divisor into the necessary bit field for TCFG1.
50 */
51static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
52{
53 return ilog2(div);
54}
55
56#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
index be25879bb2ee..6418c6e8a7b7 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci.c
@@ -11,17 +11,7 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#include <linux/kernel.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19
20#include <linux/mmc/card.h>
21#include <linux/mmc/host.h>
22
23#include <plat/regs-sdhci.h>
24#include <plat/sdhci.h>
25 15
26/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 16/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
27 17
@@ -31,35 +21,3 @@ char *s5pc100_hsmmc_clksrcs[4] = {
31 [2] = "sclk_mmc", /* mmc_bus */ 21 [2] = "sclk_mmc", /* mmc_bus */
32 /* [3] = "48m", - note not successfully used yet */ 22 /* [3] = "48m", - note not successfully used yet */
33}; 23};
34
35
36void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 /* don't need to alter anything according to card-type */
44
45 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
46
47 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
48 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
49 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
50 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
51 S3C_SDHCI_CTRL2_ENFBCLKRX |
52 S3C_SDHCI_CTRL2_DFCNT_NONE |
53 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
54
55 if (ios->clock < 25 * 1000000)
56 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
57 S3C_SDHCI_CTRL3_FCSEL2 |
58 S3C_SDHCI_CTRL3_FCSEL1 |
59 S3C_SDHCI_CTRL3_FCSEL0);
60 else
61 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
62
63 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
64 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
65}
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index e3ebe96923c8..646057ab2e4c 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -14,6 +14,8 @@ config CPU_S5PV210
14 select SAMSUNG_DMADEV 14 select SAMSUNG_DMADEV
15 select S5P_EXT_INT 15 select S5P_EXT_INT
16 select S5P_HRT 16 select S5P_HRT
17 select S5P_PM if PM
18 select S5P_SLEEP if PM
17 help 19 help
18 Enable S5PV210 CPU support 20 Enable S5PV210 CPU support
19 21
@@ -93,11 +95,13 @@ config MACH_GONI
93 select S3C_DEV_USB_HSOTG 95 select S3C_DEV_USB_HSOTG
94 select S5P_DEV_ONENAND 96 select S5P_DEV_ONENAND
95 select SAMSUNG_DEV_KEYPAD 97 select SAMSUNG_DEV_KEYPAD
98 select S5P_DEV_TV
96 select S5PV210_SETUP_FB_24BPP 99 select S5PV210_SETUP_FB_24BPP
97 select S5PV210_SETUP_I2C1 100 select S5PV210_SETUP_I2C1
98 select S5PV210_SETUP_I2C2 101 select S5PV210_SETUP_I2C2
99 select S5PV210_SETUP_KEYPAD 102 select S5PV210_SETUP_KEYPAD
100 select S5PV210_SETUP_SDHCI 103 select S5PV210_SETUP_SDHCI
104 select S5PV210_SETUP_FIMC
101 help 105 help
102 Machine support for Samsung GONI board 106 Machine support for Samsung GONI board
103 S5PC110(MCP) is one of package option of S5PV210 107 S5PC110(MCP) is one of package option of S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index ef7e4668d670..009fbe53df96 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -14,7 +14,7 @@ obj- :=
14 14
15obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o 15obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o dma.o
16obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o 16obj-$(CONFIG_CPU_S5PV210) += setup-i2c0.o
17obj-$(CONFIG_PM) += pm.o sleep.o 17obj-$(CONFIG_PM) += pm.o
18 18
19# machine support 19# machine support
20 20
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 1ab34000cc7e..4c5ac7a69e9e 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -174,6 +174,16 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable)
174 return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable); 174 return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable);
175} 175}
176 176
177static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
178{
179 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
180}
181
182static int exynos4_clk_dac_ctrl(struct clk *clk, int enable)
183{
184 return s5p_gatectrl(S5P_DAC_PHY_CONTROL, clk, enable);
185}
186
177static struct clk clk_sclk_hdmi27m = { 187static struct clk clk_sclk_hdmi27m = {
178 .name = "sclk_hdmi27m", 188 .name = "sclk_hdmi27m",
179 .rate = 27000000, 189 .rate = 27000000,
@@ -295,13 +305,13 @@ static struct clk_ops clk_fout_apll_ops = {
295static struct clk init_clocks_off[] = { 305static struct clk init_clocks_off[] = {
296 { 306 {
297 .name = "dma", 307 .name = "dma",
298 .devname = "s3c-pl330.0", 308 .devname = "dma-pl330.0",
299 .parent = &clk_hclk_psys.clk, 309 .parent = &clk_hclk_psys.clk,
300 .enable = s5pv210_clk_ip0_ctrl, 310 .enable = s5pv210_clk_ip0_ctrl,
301 .ctrlbit = (1 << 3), 311 .ctrlbit = (1 << 3),
302 }, { 312 }, {
303 .name = "dma", 313 .name = "dma",
304 .devname = "s3c-pl330.1", 314 .devname = "dma-pl330.1",
305 .parent = &clk_hclk_psys.clk, 315 .parent = &clk_hclk_psys.clk,
306 .enable = s5pv210_clk_ip0_ctrl, 316 .enable = s5pv210_clk_ip0_ctrl,
307 .ctrlbit = (1 << 4), 317 .ctrlbit = (1 << 4),
@@ -335,6 +345,40 @@ static struct clk init_clocks_off[] = {
335 .enable = s5pv210_clk_ip0_ctrl, 345 .enable = s5pv210_clk_ip0_ctrl,
336 .ctrlbit = (1 << 16), 346 .ctrlbit = (1 << 16),
337 }, { 347 }, {
348 .name = "dac",
349 .devname = "s5p-sdo",
350 .parent = &clk_hclk_dsys.clk,
351 .enable = s5pv210_clk_ip1_ctrl,
352 .ctrlbit = (1 << 10),
353 }, {
354 .name = "mixer",
355 .devname = "s5p-mixer",
356 .parent = &clk_hclk_dsys.clk,
357 .enable = s5pv210_clk_ip1_ctrl,
358 .ctrlbit = (1 << 9),
359 }, {
360 .name = "vp",
361 .devname = "s5p-mixer",
362 .parent = &clk_hclk_dsys.clk,
363 .enable = s5pv210_clk_ip1_ctrl,
364 .ctrlbit = (1 << 8),
365 }, {
366 .name = "hdmi",
367 .devname = "s5pv210-hdmi",
368 .parent = &clk_hclk_dsys.clk,
369 .enable = s5pv210_clk_ip1_ctrl,
370 .ctrlbit = (1 << 11),
371 }, {
372 .name = "hdmiphy",
373 .devname = "s5pv210-hdmi",
374 .enable = exynos4_clk_hdmiphy_ctrl,
375 .ctrlbit = (1 << 0),
376 }, {
377 .name = "dacphy",
378 .devname = "s5p-sdo",
379 .enable = exynos4_clk_dac_ctrl,
380 .ctrlbit = (1 << 0),
381 }, {
338 .name = "otg", 382 .name = "otg",
339 .parent = &clk_hclk_psys.clk, 383 .parent = &clk_hclk_psys.clk,
340 .enable = s5pv210_clk_ip1_ctrl, 384 .enable = s5pv210_clk_ip1_ctrl,
@@ -412,6 +456,12 @@ static struct clk init_clocks_off[] = {
412 .enable = s5pv210_clk_ip3_ctrl, 456 .enable = s5pv210_clk_ip3_ctrl,
413 .ctrlbit = (1<<9), 457 .ctrlbit = (1<<9),
414 }, { 458 }, {
459 .name = "i2c",
460 .devname = "s3c2440-hdmiphy-i2c",
461 .parent = &clk_pclk_psys.clk,
462 .enable = s5pv210_clk_ip3_ctrl,
463 .ctrlbit = (1 << 11),
464 }, {
415 .name = "spi", 465 .name = "spi",
416 .devname = "s3c64xx-spi.0", 466 .devname = "s3c64xx-spi.0",
417 .parent = &clk_pclk_psys.clk, 467 .parent = &clk_pclk_psys.clk,
@@ -599,6 +649,23 @@ static struct clksrc_sources clkset_sclk_mixer = {
599 .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), 649 .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list),
600}; 650};
601 651
652static struct clksrc_clk clk_sclk_mixer = {
653 .clk = {
654 .name = "sclk_mixer",
655 .enable = s5pv210_clk_mask0_ctrl,
656 .ctrlbit = (1 << 1),
657 },
658 .sources = &clkset_sclk_mixer,
659 .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 },
660};
661
662static struct clksrc_clk *sclk_tv[] = {
663 &clk_sclk_dac,
664 &clk_sclk_pixel,
665 &clk_sclk_hdmi,
666 &clk_sclk_mixer,
667};
668
602static struct clk *clkset_sclk_audio0_list[] = { 669static struct clk *clkset_sclk_audio0_list[] = {
603 [0] = &clk_ext_xtal_mux, 670 [0] = &clk_ext_xtal_mux,
604 [1] = &clk_pcmcdclk0, 671 [1] = &clk_pcmcdclk0,
@@ -782,14 +849,6 @@ static struct clksrc_clk clksrcs[] = {
782 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, 849 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 },
783 }, { 850 }, {
784 .clk = { 851 .clk = {
785 .name = "sclk_mixer",
786 .enable = s5pv210_clk_mask0_ctrl,
787 .ctrlbit = (1 << 1),
788 },
789 .sources = &clkset_sclk_mixer,
790 .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 },
791 }, {
792 .clk = {
793 .name = "sclk_fimc", 852 .name = "sclk_fimc",
794 .devname = "s5pv210-fimc.0", 853 .devname = "s5pv210-fimc.0",
795 .enable = s5pv210_clk_mask1_ctrl, 854 .enable = s5pv210_clk_mask1_ctrl,
@@ -978,9 +1037,6 @@ static struct clksrc_clk *sysclks[] = {
978 &clk_pclk_psys, 1037 &clk_pclk_psys,
979 &clk_vpllsrc, 1038 &clk_vpllsrc,
980 &clk_sclk_vpll, 1039 &clk_sclk_vpll,
981 &clk_sclk_dac,
982 &clk_sclk_pixel,
983 &clk_sclk_hdmi,
984 &clk_mout_dmc0, 1040 &clk_mout_dmc0,
985 &clk_sclk_dmc0, 1041 &clk_sclk_dmc0,
986 &clk_sclk_audio0, 1042 &clk_sclk_audio0,
@@ -1065,6 +1121,61 @@ static struct clk_ops s5pv210_epll_ops = {
1065 .get_rate = s5p_epll_get_rate, 1121 .get_rate = s5p_epll_get_rate,
1066}; 1122};
1067 1123
1124static u32 vpll_div[][5] = {
1125 { 54000000, 3, 53, 3, 0 },
1126 { 108000000, 3, 53, 2, 0 },
1127};
1128
1129static unsigned long s5pv210_vpll_get_rate(struct clk *clk)
1130{
1131 return clk->rate;
1132}
1133
1134static int s5pv210_vpll_set_rate(struct clk *clk, unsigned long rate)
1135{
1136 unsigned int vpll_con;
1137 unsigned int i;
1138
1139 /* Return if nothing changed */
1140 if (clk->rate == rate)
1141 return 0;
1142
1143 vpll_con = __raw_readl(S5P_VPLL_CON);
1144 vpll_con &= ~(0x1 << 27 | \
1145 PLL90XX_MDIV_MASK << PLL90XX_MDIV_SHIFT | \
1146 PLL90XX_PDIV_MASK << PLL90XX_PDIV_SHIFT | \
1147 PLL90XX_SDIV_MASK << PLL90XX_SDIV_SHIFT);
1148
1149 for (i = 0; i < ARRAY_SIZE(vpll_div); i++) {
1150 if (vpll_div[i][0] == rate) {
1151 vpll_con |= vpll_div[i][1] << PLL90XX_PDIV_SHIFT;
1152 vpll_con |= vpll_div[i][2] << PLL90XX_MDIV_SHIFT;
1153 vpll_con |= vpll_div[i][3] << PLL90XX_SDIV_SHIFT;
1154 vpll_con |= vpll_div[i][4] << 27;
1155 break;
1156 }
1157 }
1158
1159 if (i == ARRAY_SIZE(vpll_div)) {
1160 printk(KERN_ERR "%s: Invalid Clock VPLL Frequency\n",
1161 __func__);
1162 return -EINVAL;
1163 }
1164
1165 __raw_writel(vpll_con, S5P_VPLL_CON);
1166
1167 /* Wait for VPLL lock */
1168 while (!(__raw_readl(S5P_VPLL_CON) & (1 << PLL90XX_LOCKED_SHIFT)))
1169 continue;
1170
1171 clk->rate = rate;
1172 return 0;
1173}
1174static struct clk_ops s5pv210_vpll_ops = {
1175 .get_rate = s5pv210_vpll_get_rate,
1176 .set_rate = s5pv210_vpll_set_rate,
1177};
1178
1068void __init_or_cpufreq s5pv210_setup_clocks(void) 1179void __init_or_cpufreq s5pv210_setup_clocks(void)
1069{ 1180{
1070 struct clk *xtal_clk; 1181 struct clk *xtal_clk;
@@ -1113,6 +1224,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
1113 clk_fout_apll.ops = &clk_fout_apll_ops; 1224 clk_fout_apll.ops = &clk_fout_apll_ops;
1114 clk_fout_mpll.rate = mpll; 1225 clk_fout_mpll.rate = mpll;
1115 clk_fout_epll.rate = epll; 1226 clk_fout_epll.rate = epll;
1227 clk_fout_vpll.ops = &s5pv210_vpll_ops;
1116 clk_fout_vpll.rate = vpll; 1228 clk_fout_vpll.rate = vpll;
1117 1229
1118 printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", 1230 printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
@@ -1158,6 +1270,9 @@ void __init s5pv210_register_clocks(void)
1158 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1270 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
1159 s3c_register_clksrc(sysclks[ptr], 1); 1271 s3c_register_clksrc(sysclks[ptr], 1);
1160 1272
1273 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++)
1274 s3c_register_clksrc(sclk_tv[ptr], 1);
1275
1161 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1276 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
1162 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1277 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
1163 1278
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 91145720822c..84ec74633232 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -42,6 +42,7 @@
42#include <plat/keypad-core.h> 42#include <plat/keypad-core.h>
43#include <plat/sdhci.h> 43#include <plat/sdhci.h>
44#include <plat/reset.h> 44#include <plat/reset.h>
45#include <plat/tv-core.h>
45 46
46/* Initial IO mappings */ 47/* Initial IO mappings */
47 48
@@ -145,6 +146,9 @@ void __init s5pv210_map_io(void)
145 146
146 /* Use s5pv210-keypad instead of samsung-keypad */ 147 /* Use s5pv210-keypad instead of samsung-keypad */
147 samsung_keypad_setname("s5pv210-keypad"); 148 samsung_keypad_setname("s5pv210-keypad");
149
150 /* setup TV devices */
151 s5p_hdmi_setname("s5pv210-hdmi");
148} 152}
149 153
150void __init s5pv210_init_clocks(int xtal) 154void __init s5pv210_init_clocks(int xtal)
diff --git a/arch/arm/mach-s5pv210/dma.c b/arch/arm/mach-s5pv210/dma.c
index f79d0b06cbf9..86b749c18b77 100644
--- a/arch/arm/mach-s5pv210/dma.c
+++ b/arch/arm/mach-s5pv210/dma.c
@@ -254,6 +254,7 @@ struct amba_device s5pv210_device_pdma1 = {
254static int __init s5pv210_dma_init(void) 254static int __init s5pv210_dma_init(void)
255{ 255{
256 amba_device_register(&s5pv210_device_pdma0, &iomem_resource); 256 amba_device_register(&s5pv210_device_pdma0, &iomem_resource);
257 amba_device_register(&s5pv210_device_pdma1, &iomem_resource);
257 258
258 return 0; 259 return 0;
259} 260}
diff --git a/arch/arm/mach-s5pv210/include/mach/clkdev.h b/arch/arm/mach-s5pv210/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h
index b9f9ec33384d..5e0de3a31f3d 100644
--- a/arch/arm/mach-s5pv210/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -56,7 +56,7 @@
56#define IRQ_SPI2 S5P_IRQ_VIC1(17) 56#define IRQ_SPI2 S5P_IRQ_VIC1(17)
57#define IRQ_IRDA S5P_IRQ_VIC1(18) 57#define IRQ_IRDA S5P_IRQ_VIC1(18)
58#define IRQ_IIC2 S5P_IRQ_VIC1(19) 58#define IRQ_IIC2 S5P_IRQ_VIC1(19)
59#define IRQ_IIC3 S5P_IRQ_VIC1(20) 59#define IRQ_IIC_HDMIPHY S5P_IRQ_VIC1(20)
60#define IRQ_HSIRX S5P_IRQ_VIC1(21) 60#define IRQ_HSIRX S5P_IRQ_VIC1(21)
61#define IRQ_HSITX S5P_IRQ_VIC1(22) 61#define IRQ_HSITX S5P_IRQ_VIC1(22)
62#define IRQ_UHOST S5P_IRQ_VIC1(23) 62#define IRQ_UHOST S5P_IRQ_VIC1(23)
@@ -86,7 +86,7 @@
86#define IRQ_HDMI S5P_IRQ_VIC2(12) 86#define IRQ_HDMI S5P_IRQ_VIC2(12)
87#define IRQ_IIC1 S5P_IRQ_VIC2(13) 87#define IRQ_IIC1 S5P_IRQ_VIC2(13)
88#define IRQ_MFC S5P_IRQ_VIC2(14) 88#define IRQ_MFC S5P_IRQ_VIC2(14)
89#define IRQ_TVENC S5P_IRQ_VIC2(15) 89#define IRQ_SDO S5P_IRQ_VIC2(15)
90#define IRQ_I2S0 S5P_IRQ_VIC2(16) 90#define IRQ_I2S0 S5P_IRQ_VIC2(16)
91#define IRQ_I2S1 S5P_IRQ_VIC2(17) 91#define IRQ_I2S1 S5P_IRQ_VIC2(17)
92#define IRQ_I2S2 S5P_IRQ_VIC2(18) 92#define IRQ_I2S2 S5P_IRQ_VIC2(18)
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index aac343c180b2..7ff609f1568b 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -90,6 +90,12 @@
90#define S5PV210_PA_FIMC1 0xFB300000 90#define S5PV210_PA_FIMC1 0xFB300000
91#define S5PV210_PA_FIMC2 0xFB400000 91#define S5PV210_PA_FIMC2 0xFB400000
92 92
93#define S5PV210_PA_SDO 0xF9000000
94#define S5PV210_PA_VP 0xF9100000
95#define S5PV210_PA_MIXER 0xF9200000
96#define S5PV210_PA_HDMI 0xFA100000
97#define S5PV210_PA_IIC_HDMIPHY 0xFA900000
98
93/* Compatibiltiy Defines */ 99/* Compatibiltiy Defines */
94 100
95#define S3C_PA_FB S5PV210_PA_FB 101#define S3C_PA_FB S5PV210_PA_FB
@@ -110,6 +116,13 @@
110#define S5P_PA_FIMC2 S5PV210_PA_FIMC2 116#define S5P_PA_FIMC2 S5PV210_PA_FIMC2
111#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS 117#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS
112#define S5P_PA_MFC S5PV210_PA_MFC 118#define S5P_PA_MFC S5PV210_PA_MFC
119#define S5P_PA_IIC_HDMIPHY S5PV210_PA_IIC_HDMIPHY
120
121#define S5P_PA_SDO S5PV210_PA_SDO
122#define S5P_PA_VP S5PV210_PA_VP
123#define S5P_PA_MIXER S5PV210_PA_MIXER
124#define S5P_PA_HDMI S5PV210_PA_HDMI
125
113#define S5P_PA_ONENAND S5PC110_PA_ONENAND 126#define S5P_PA_ONENAND S5PC110_PA_ONENAND
114#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA 127#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA
115#define S5P_PA_SDRAM S5PV210_PA_SDRAM 128#define S5P_PA_SDRAM S5PV210_PA_SDRAM
diff --git a/arch/arm/mach-s5pv210/include/mach/pm-core.h b/arch/arm/mach-s5pv210/include/mach/pm-core.h
index 3e22109e1b7b..eba8aea63ed8 100644
--- a/arch/arm/mach-s5pv210/include/mach/pm-core.h
+++ b/arch/arm/mach-s5pv210/include/mach/pm-core.h
@@ -43,4 +43,4 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
43} 43}
44 44
45static inline void s3c_pm_restored_gpios(void) { } 45static inline void s3c_pm_restored_gpios(void) { }
46static inline void s3c_pm_saved_gpios(void) { } 46static inline void samsung_pm_saved_gpios(void) { }
diff --git a/arch/arm/mach-s5pv210/include/mach/pwm-clock.h b/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
deleted file mode 100644
index f8a9f1b330e0..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/
10 *
11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
12 *
13 * S5PV210 - pwm clock and timer support
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18*/
19
20#ifndef __ASM_ARCH_PWMCLK_H
21#define __ASM_ARCH_PWMCLK_H __FILE__
22
23/**
24 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
25 * @tcfg: The timer TCFG1 register bits shifted down to 0.
26 *
27 * Return true if the given configuration from TCFG1 is a TCLK instead
28 * any of the TDIV clocks.
29 */
30static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
31{
32 return tcfg == S3C64XX_TCFG1_MUX_TCLK;
33}
34
35/**
36 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
37 * @tcfg1: The tcfg1 setting, shifted down.
38 *
39 * Get the divisor value for the given tcfg1 setting. We assume the
40 * caller has already checked to see if this is not a TCLK source.
41 */
42static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
43{
44 return 1 << tcfg1;
45}
46
47/**
48 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
49 *
50 * Return true if we have a /1 in the tdiv setting.
51 */
52static inline unsigned int pwm_tdiv_has_div1(void)
53{
54 return 1;
55}
56
57/**
58 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
59 * @div: The divisor to calculate the bit information for.
60 *
61 * Turn a divisor into the necessary bit field for TCFG1.
62 */
63static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
64{
65 return ilog2(div);
66}
67
68#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK
69
70#endif /* __ASM_ARCH_PWMCLK_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 78925c516346..032de66fb8be 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -144,8 +144,9 @@
144 144
145#define S5P_OTHERS S5P_CLKREG(0xE000) 145#define S5P_OTHERS S5P_CLKREG(0xE000)
146#define S5P_OM_STAT S5P_CLKREG(0xE100) 146#define S5P_OM_STAT S5P_CLKREG(0xE100)
147#define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804)
147#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) 148#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C)
148#define S5P_DAC_CONTROL S5P_CLKREG(0xE810) 149#define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810)
149#define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814) 150#define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814)
150#define S5P_MIPI_DPHY_ENABLE (1 << 0) 151#define S5P_MIPI_DPHY_ENABLE (1 << 0)
151#define S5P_MIPI_DPHY_SRESETN (1 << 1) 152#define S5P_MIPI_DPHY_SRESETN (1 << 1)
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 061cc7e4f48c..15edcae448b9 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -48,6 +48,11 @@
48#include <plat/s5p-time.h> 48#include <plat/s5p-time.h>
49#include <plat/mfc.h> 49#include <plat/mfc.h>
50#include <plat/regs-fb-v4.h> 50#include <plat/regs-fb-v4.h>
51#include <plat/camport.h>
52
53#include <media/v4l2-mediabus.h>
54#include <media/s5p_fimc.h>
55#include <media/noon010pc30.h>
51 56
52/* Following are default values for UCON, ULCON and UFCON UART registers */ 57/* Following are default values for UCON, ULCON and UFCON UART registers */
53#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 58#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -272,6 +277,14 @@ static void __init goni_tsp_init(void)
272 i2c2_devs[0].irq = gpio_to_irq(gpio); 277 i2c2_devs[0].irq = gpio_to_irq(gpio);
273} 278}
274 279
280static void goni_camera_init(void)
281{
282 s5pv210_fimc_setup_gpio(S5P_CAMPORT_A);
283
284 /* Set max driver strength on CAM_A_CLKOUT pin. */
285 s5p_gpio_set_drvstr(S5PV210_GPE1(3), S5P_GPIO_DRVSTR_LV4);
286}
287
275/* MAX8998 regulators */ 288/* MAX8998 regulators */
276#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) 289#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
277 290
@@ -285,6 +298,7 @@ static struct regulator_consumer_supply goni_ldo5_consumers[] = {
285 298
286static struct regulator_consumer_supply goni_ldo8_consumers[] = { 299static struct regulator_consumer_supply goni_ldo8_consumers[] = {
287 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), 300 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
301 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
288}; 302};
289 303
290static struct regulator_consumer_supply goni_ldo11_consumers[] = { 304static struct regulator_consumer_supply goni_ldo11_consumers[] = {
@@ -475,6 +489,10 @@ static struct regulator_consumer_supply buck1_consumer =
475static struct regulator_consumer_supply buck2_consumer = 489static struct regulator_consumer_supply buck2_consumer =
476 REGULATOR_SUPPLY("vddint", NULL); 490 REGULATOR_SUPPLY("vddint", NULL);
477 491
492static struct regulator_consumer_supply buck3_consumer =
493 REGULATOR_SUPPLY("vdet", "s5p-sdo");
494
495
478static struct regulator_init_data goni_buck1_data = { 496static struct regulator_init_data goni_buck1_data = {
479 .constraints = { 497 .constraints = {
480 .name = "VARM_1.2V", 498 .name = "VARM_1.2V",
@@ -511,6 +529,8 @@ static struct regulator_init_data goni_buck3_data = {
511 .enabled = 1, 529 .enabled = 1,
512 }, 530 },
513 }, 531 },
532 .num_consumer_supplies = 1,
533 .consumer_supplies = &buck3_consumer,
514}; 534};
515 535
516static struct regulator_init_data goni_buck4_data = { 536static struct regulator_init_data goni_buck4_data = {
@@ -801,6 +821,34 @@ static void goni_setup_sdhci(void)
801 s3c_sdhci2_set_platdata(&goni_hsmmc2_data); 821 s3c_sdhci2_set_platdata(&goni_hsmmc2_data);
802}; 822};
803 823
824static struct noon010pc30_platform_data noon010pc30_pldata = {
825 .clk_rate = 16000000UL,
826 .gpio_nreset = S5PV210_GPB(2), /* CAM_CIF_NRST */
827 .gpio_nstby = S5PV210_GPB(0), /* CAM_CIF_NSTBY */
828};
829
830static struct i2c_board_info noon010pc30_board_info = {
831 I2C_BOARD_INFO("NOON010PC30", 0x60 >> 1),
832 .platform_data = &noon010pc30_pldata,
833};
834
835static struct s5p_fimc_isp_info goni_camera_sensors[] = {
836 {
837 .mux_id = 0,
838 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
839 V4L2_MBUS_VSYNC_ACTIVE_LOW,
840 .bus_type = FIMC_ITU_601,
841 .board_info = &noon010pc30_board_info,
842 .i2c_bus_num = 0,
843 .clk_frequency = 16000000UL,
844 },
845};
846
847struct s5p_platform_fimc goni_fimc_md_platdata __initdata = {
848 .isp_info = goni_camera_sensors,
849 .num_clients = ARRAY_SIZE(goni_camera_sensors),
850};
851
804static struct platform_device *goni_devices[] __initdata = { 852static struct platform_device *goni_devices[] __initdata = {
805 &s3c_device_fb, 853 &s3c_device_fb,
806 &s5p_device_onenand, 854 &s5p_device_onenand,
@@ -812,10 +860,13 @@ static struct platform_device *goni_devices[] __initdata = {
812 &s5p_device_mfc, 860 &s5p_device_mfc,
813 &s5p_device_mfc_l, 861 &s5p_device_mfc_l,
814 &s5p_device_mfc_r, 862 &s5p_device_mfc_r,
863 &s5p_device_mixer,
864 &s5p_device_sdo,
815 &s3c_device_i2c0, 865 &s3c_device_i2c0,
816 &s5p_device_fimc0, 866 &s5p_device_fimc0,
817 &s5p_device_fimc1, 867 &s5p_device_fimc1,
818 &s5p_device_fimc2, 868 &s5p_device_fimc2,
869 &s5p_device_fimc_md,
819 &s3c_device_hsmmc0, 870 &s3c_device_hsmmc0,
820 &s3c_device_hsmmc1, 871 &s3c_device_hsmmc1,
821 &s3c_device_hsmmc2, 872 &s3c_device_hsmmc2,
@@ -884,6 +935,12 @@ static void __init goni_machine_init(void)
884 /* FB */ 935 /* FB */
885 s3c_fb_set_platdata(&goni_lcd_pdata); 936 s3c_fb_set_platdata(&goni_lcd_pdata);
886 937
938 /* FIMC */
939 s3c_set_platdata(&goni_fimc_md_platdata, sizeof(goni_fimc_md_platdata),
940 &s5p_device_fimc_md);
941
942 goni_camera_init();
943
887 /* SPI */ 944 /* SPI */
888 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); 945 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
889 946
diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c b/arch/arm/mach-s5pv210/setup-sdhci.c
index a83b6c909f6b..6b8ccc4d35fd 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci.c
@@ -10,17 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/kernel.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <linux/mmc/card.h>
20#include <linux/mmc/host.h>
21
22#include <plat/regs-sdhci.h>
23#include <plat/sdhci.h>
24 14
25/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 15/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
26 16
@@ -30,34 +20,3 @@ char *s5pv210_hsmmc_clksrcs[4] = {
30 [2] = "sclk_mmc", /* mmc_bus */ 20 [2] = "sclk_mmc", /* mmc_bus */
31 /* [3] = NULL, - reserved */ 21 /* [3] = NULL, - reserved */
32}; 22};
33
34void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
35 void __iomem *r,
36 struct mmc_ios *ios,
37 struct mmc_card *card)
38{
39 u32 ctrl2, ctrl3;
40
41 /* don't need to alter anything according to card-type */
42
43 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
44
45 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
46 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
47 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
48 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
49 S3C_SDHCI_CTRL2_ENFBCLKRX |
50 S3C_SDHCI_CTRL2_DFCNT_NONE |
51 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
52
53 if (ios->clock < 25 * 1000000)
54 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
55 S3C_SDHCI_CTRL3_FCSEL2 |
56 S3C_SDHCI_CTRL3_FCSEL1 |
57 S3C_SDHCI_CTRL3_FCSEL0);
58 else
59 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
60
61 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
62 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
63}
diff --git a/arch/arm/mach-s5pv210/sleep.S b/arch/arm/mach-s5pv210/sleep.S
deleted file mode 100644
index e3452ccd4b08..000000000000
--- a/arch/arm/mach-s5pv210/sleep.S
+++ /dev/null
@@ -1,52 +0,0 @@
1/* linux/arch/arm/plat-s5p/sleep.S
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV210 power Manager (Suspend-To-RAM) support
7 * Based on S3C2410 sleep code by:
8 * Ben Dooks, (c) 2004 Simtec Electronics
9 *
10 * Based on PXA/SA1100 sleep code by:
11 * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
12 * Cliff Brake, (c) 2001
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27*/
28
29#include <linux/linkage.h>
30#include <asm/assembler.h>
31#include <asm/memory.h>
32
33 .text
34
35 /* sleep magic, to allow the bootloader to check for an valid
36 * image to resume to. Must be the first word before the
37 * s3c_cpu_resume entry.
38 */
39
40 .word 0x2bedf00d
41
42 /* s3c_cpu_resume
43 *
44 * resume code entry for bootloader to call
45 *
46 * we must put this code here in the data segment as we have no
47 * other way of restoring the stack pointer after sleep, and we
48 * must not write to the code segment (code is read-only)
49 */
50
51ENTRY(s3c_cpu_resume)
52 b cpu_resume
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 8c5b3029b39f..d8973ac46bc4 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -9,7 +9,6 @@ config PLAT_S3C24XX
9 select NO_IOPORT 9 select NO_IOPORT
10 select ARCH_REQUIRE_GPIOLIB 10 select ARCH_REQUIRE_GPIOLIB
11 select S3C_DEV_NAND 11 select S3C_DEV_NAND
12 select S3C_GPIO_CFG_S3C24XX
13 help 12 help
14 Base platform code for any Samsung S3C24XX device 13 Base platform code for any Samsung S3C24XX device
15 14
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 0291bd6e236e..b2b01125de66 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -14,9 +14,7 @@ obj- :=
14 14
15obj-y += cpu.o 15obj-y += cpu.o
16obj-y += irq.o 16obj-y += irq.o
17obj-y += devs.o 17obj-y += dev-uart.o
18obj-y += gpio.o
19obj-y += gpiolib.o
20obj-y += clock.o 18obj-y += clock.o
21obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o 19obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
22 20
diff --git a/arch/arm/plat-s3c24xx/dev-uart.c b/arch/arm/plat-s3c24xx/dev-uart.c
new file mode 100644
index 000000000000..9ab22e662fff
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/dev-uart.c
@@ -0,0 +1,100 @@
1/* linux/arch/arm/plat-s3c24xx/dev-uart.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Base S3C24XX UART resource and platform device definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/serial_core.h>
18#include <linux/platform_device.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22#include <asm/mach/irq.h>
23#include <mach/hardware.h>
24#include <mach/map.h>
25
26#include <plat/devs.h>
27#include <plat/regs-serial.h>
28
29/* Serial port registrations */
30
31static struct resource s3c2410_uart0_resource[] = {
32 [0] = {
33 .start = S3C2410_PA_UART0,
34 .end = S3C2410_PA_UART0 + 0x3fff,
35 .flags = IORESOURCE_MEM,
36 },
37 [1] = {
38 .start = IRQ_S3CUART_RX0,
39 .end = IRQ_S3CUART_ERR0,
40 .flags = IORESOURCE_IRQ,
41 }
42};
43
44static struct resource s3c2410_uart1_resource[] = {
45 [0] = {
46 .start = S3C2410_PA_UART1,
47 .end = S3C2410_PA_UART1 + 0x3fff,
48 .flags = IORESOURCE_MEM,
49 },
50 [1] = {
51 .start = IRQ_S3CUART_RX1,
52 .end = IRQ_S3CUART_ERR1,
53 .flags = IORESOURCE_IRQ,
54 }
55};
56
57static struct resource s3c2410_uart2_resource[] = {
58 [0] = {
59 .start = S3C2410_PA_UART2,
60 .end = S3C2410_PA_UART2 + 0x3fff,
61 .flags = IORESOURCE_MEM,
62 },
63 [1] = {
64 .start = IRQ_S3CUART_RX2,
65 .end = IRQ_S3CUART_ERR2,
66 .flags = IORESOURCE_IRQ,
67 }
68};
69
70static struct resource s3c2410_uart3_resource[] = {
71 [0] = {
72 .start = S3C2443_PA_UART3,
73 .end = S3C2443_PA_UART3 + 0x3fff,
74 .flags = IORESOURCE_MEM,
75 },
76 [1] = {
77 .start = IRQ_S3CUART_RX3,
78 .end = IRQ_S3CUART_ERR3,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
84 [0] = {
85 .resources = s3c2410_uart0_resource,
86 .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource),
87 },
88 [1] = {
89 .resources = s3c2410_uart1_resource,
90 .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource),
91 },
92 [2] = {
93 .resources = s3c2410_uart2_resource,
94 .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource),
95 },
96 [3] = {
97 .resources = s3c2410_uart3_resource,
98 .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource),
99 },
100};
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
deleted file mode 100644
index a76bf2df3333..000000000000
--- a/arch/arm/plat-s3c24xx/devs.c
+++ /dev/null
@@ -1,528 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/devs.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Base S3C24XX platform device definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/list.h>
18#include <linux/timer.h>
19#include <linux/init.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23#include <linux/slab.h>
24#include <linux/string.h>
25#include <linux/dma-mapping.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30#include <mach/fb.h>
31#include <mach/hardware.h>
32#include <mach/dma.h>
33#include <mach/irqs.h>
34#include <asm/irq.h>
35
36#include <plat/regs-serial.h>
37#include <plat/udc.h>
38#include <plat/mci.h>
39
40#include <plat/devs.h>
41#include <plat/cpu.h>
42#include <plat/regs-spi.h>
43#include <plat/ts.h>
44
45/* Serial port registrations */
46
47static struct resource s3c2410_uart0_resource[] = {
48 [0] = {
49 .start = S3C2410_PA_UART0,
50 .end = S3C2410_PA_UART0 + 0x3fff,
51 .flags = IORESOURCE_MEM,
52 },
53 [1] = {
54 .start = IRQ_S3CUART_RX0,
55 .end = IRQ_S3CUART_ERR0,
56 .flags = IORESOURCE_IRQ,
57 }
58};
59
60static struct resource s3c2410_uart1_resource[] = {
61 [0] = {
62 .start = S3C2410_PA_UART1,
63 .end = S3C2410_PA_UART1 + 0x3fff,
64 .flags = IORESOURCE_MEM,
65 },
66 [1] = {
67 .start = IRQ_S3CUART_RX1,
68 .end = IRQ_S3CUART_ERR1,
69 .flags = IORESOURCE_IRQ,
70 }
71};
72
73static struct resource s3c2410_uart2_resource[] = {
74 [0] = {
75 .start = S3C2410_PA_UART2,
76 .end = S3C2410_PA_UART2 + 0x3fff,
77 .flags = IORESOURCE_MEM,
78 },
79 [1] = {
80 .start = IRQ_S3CUART_RX2,
81 .end = IRQ_S3CUART_ERR2,
82 .flags = IORESOURCE_IRQ,
83 }
84};
85
86static struct resource s3c2410_uart3_resource[] = {
87 [0] = {
88 .start = S3C2443_PA_UART3,
89 .end = S3C2443_PA_UART3 + 0x3fff,
90 .flags = IORESOURCE_MEM,
91 },
92 [1] = {
93 .start = IRQ_S3CUART_RX3,
94 .end = IRQ_S3CUART_ERR3,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
100 [0] = {
101 .resources = s3c2410_uart0_resource,
102 .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource),
103 },
104 [1] = {
105 .resources = s3c2410_uart1_resource,
106 .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource),
107 },
108 [2] = {
109 .resources = s3c2410_uart2_resource,
110 .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource),
111 },
112 [3] = {
113 .resources = s3c2410_uart3_resource,
114 .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource),
115 },
116};
117
118/* LCD Controller */
119
120static struct resource s3c_lcd_resource[] = {
121 [0] = {
122 .start = S3C24XX_PA_LCD,
123 .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
124 .flags = IORESOURCE_MEM,
125 },
126 [1] = {
127 .start = IRQ_LCD,
128 .end = IRQ_LCD,
129 .flags = IORESOURCE_IRQ,
130 }
131
132};
133
134static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
135
136struct platform_device s3c_device_lcd = {
137 .name = "s3c2410-lcd",
138 .id = -1,
139 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
140 .resource = s3c_lcd_resource,
141 .dev = {
142 .dma_mask = &s3c_device_lcd_dmamask,
143 .coherent_dma_mask = 0xffffffffUL
144 }
145};
146
147EXPORT_SYMBOL(s3c_device_lcd);
148
149void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
150{
151 struct s3c2410fb_mach_info *npd;
152
153 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
154 if (npd) {
155 npd->displays = kmemdup(pd->displays,
156 sizeof(struct s3c2410fb_display) * npd->num_displays,
157 GFP_KERNEL);
158 if (!npd->displays)
159 printk(KERN_ERR "no memory for LCD display data\n");
160 } else {
161 printk(KERN_ERR "no memory for LCD platform data\n");
162 }
163}
164
165/* Touchscreen */
166
167static struct resource s3c_ts_resource[] = {
168 [0] = {
169 .start = S3C24XX_PA_ADC,
170 .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
171 .flags = IORESOURCE_MEM,
172 },
173 [1] = {
174 .start = IRQ_TC,
175 .end = IRQ_TC,
176 .flags = IORESOURCE_IRQ,
177 },
178
179};
180
181struct platform_device s3c_device_ts = {
182 .name = "s3c2410-ts",
183 .id = -1,
184 .dev.parent = &s3c_device_adc.dev,
185 .num_resources = ARRAY_SIZE(s3c_ts_resource),
186 .resource = s3c_ts_resource,
187};
188EXPORT_SYMBOL(s3c_device_ts);
189
190void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
191{
192 s3c_set_platdata(hard_s3c2410ts_info,
193 sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);
194}
195
196/* USB Device (Gadget)*/
197
198static struct resource s3c_usbgadget_resource[] = {
199 [0] = {
200 .start = S3C24XX_PA_USBDEV,
201 .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
202 .flags = IORESOURCE_MEM,
203 },
204 [1] = {
205 .start = IRQ_USBD,
206 .end = IRQ_USBD,
207 .flags = IORESOURCE_IRQ,
208 }
209
210};
211
212struct platform_device s3c_device_usbgadget = {
213 .name = "s3c2410-usbgadget",
214 .id = -1,
215 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
216 .resource = s3c_usbgadget_resource,
217};
218
219EXPORT_SYMBOL(s3c_device_usbgadget);
220
221void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
222{
223 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
224}
225
226/* USB High Speed 2.0 Device (Gadget) */
227static struct resource s3c_hsudc_resource[] = {
228 [0] = {
229 .start = S3C2416_PA_HSUDC,
230 .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1,
231 .flags = IORESOURCE_MEM,
232 },
233 [1] = {
234 .start = IRQ_USBD,
235 .end = IRQ_USBD,
236 .flags = IORESOURCE_IRQ,
237 }
238};
239
240static u64 s3c_hsudc_dmamask = DMA_BIT_MASK(32);
241
242struct platform_device s3c_device_usb_hsudc = {
243 .name = "s3c-hsudc",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(s3c_hsudc_resource),
246 .resource = s3c_hsudc_resource,
247 .dev = {
248 .dma_mask = &s3c_hsudc_dmamask,
249 .coherent_dma_mask = DMA_BIT_MASK(32),
250 },
251};
252
253void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
254{
255 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
256}
257
258/* IIS */
259
260static struct resource s3c_iis_resource[] = {
261 [0] = {
262 .start = S3C24XX_PA_IIS,
263 .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1,
264 .flags = IORESOURCE_MEM,
265 }
266};
267
268static u64 s3c_device_iis_dmamask = 0xffffffffUL;
269
270struct platform_device s3c_device_iis = {
271 .name = "s3c24xx-iis",
272 .id = -1,
273 .num_resources = ARRAY_SIZE(s3c_iis_resource),
274 .resource = s3c_iis_resource,
275 .dev = {
276 .dma_mask = &s3c_device_iis_dmamask,
277 .coherent_dma_mask = 0xffffffffUL
278 }
279};
280
281EXPORT_SYMBOL(s3c_device_iis);
282
283/* RTC */
284
285static struct resource s3c_rtc_resource[] = {
286 [0] = {
287 .start = S3C24XX_PA_RTC,
288 .end = S3C24XX_PA_RTC + 0xff,
289 .flags = IORESOURCE_MEM,
290 },
291 [1] = {
292 .start = IRQ_RTC,
293 .end = IRQ_RTC,
294 .flags = IORESOURCE_IRQ,
295 },
296 [2] = {
297 .start = IRQ_TICK,
298 .end = IRQ_TICK,
299 .flags = IORESOURCE_IRQ
300 }
301};
302
303struct platform_device s3c_device_rtc = {
304 .name = "s3c2410-rtc",
305 .id = -1,
306 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
307 .resource = s3c_rtc_resource,
308};
309
310EXPORT_SYMBOL(s3c_device_rtc);
311
312/* ADC */
313
314static struct resource s3c_adc_resource[] = {
315 [0] = {
316 .start = S3C24XX_PA_ADC,
317 .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
318 .flags = IORESOURCE_MEM,
319 },
320 [1] = {
321 .start = IRQ_TC,
322 .end = IRQ_TC,
323 .flags = IORESOURCE_IRQ,
324 },
325 [2] = {
326 .start = IRQ_ADC,
327 .end = IRQ_ADC,
328 .flags = IORESOURCE_IRQ,
329 }
330
331};
332
333struct platform_device s3c_device_adc = {
334 .name = "s3c24xx-adc",
335 .id = -1,
336 .num_resources = ARRAY_SIZE(s3c_adc_resource),
337 .resource = s3c_adc_resource,
338};
339
340/* SDI */
341
342static struct resource s3c_sdi_resource[] = {
343 [0] = {
344 .start = S3C24XX_PA_SDI,
345 .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1,
346 .flags = IORESOURCE_MEM,
347 },
348 [1] = {
349 .start = IRQ_SDI,
350 .end = IRQ_SDI,
351 .flags = IORESOURCE_IRQ,
352 }
353
354};
355
356struct platform_device s3c_device_sdi = {
357 .name = "s3c2410-sdi",
358 .id = -1,
359 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
360 .resource = s3c_sdi_resource,
361};
362
363EXPORT_SYMBOL(s3c_device_sdi);
364
365void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
366{
367 s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
368 &s3c_device_sdi);
369}
370
371
372/* SPI (0) */
373
374static struct resource s3c_spi0_resource[] = {
375 [0] = {
376 .start = S3C24XX_PA_SPI,
377 .end = S3C24XX_PA_SPI + 0x1f,
378 .flags = IORESOURCE_MEM,
379 },
380 [1] = {
381 .start = IRQ_SPI0,
382 .end = IRQ_SPI0,
383 .flags = IORESOURCE_IRQ,
384 }
385
386};
387
388static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
389
390struct platform_device s3c_device_spi0 = {
391 .name = "s3c2410-spi",
392 .id = 0,
393 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
394 .resource = s3c_spi0_resource,
395 .dev = {
396 .dma_mask = &s3c_device_spi0_dmamask,
397 .coherent_dma_mask = 0xffffffffUL
398 }
399};
400
401EXPORT_SYMBOL(s3c_device_spi0);
402
403/* SPI (1) */
404
405static struct resource s3c_spi1_resource[] = {
406 [0] = {
407 .start = S3C24XX_PA_SPI + S3C2410_SPI1,
408 .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f,
409 .flags = IORESOURCE_MEM,
410 },
411 [1] = {
412 .start = IRQ_SPI1,
413 .end = IRQ_SPI1,
414 .flags = IORESOURCE_IRQ,
415 }
416
417};
418
419static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
420
421struct platform_device s3c_device_spi1 = {
422 .name = "s3c2410-spi",
423 .id = 1,
424 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
425 .resource = s3c_spi1_resource,
426 .dev = {
427 .dma_mask = &s3c_device_spi1_dmamask,
428 .coherent_dma_mask = 0xffffffffUL
429 }
430};
431
432EXPORT_SYMBOL(s3c_device_spi1);
433
434#ifdef CONFIG_CPU_S3C2440
435
436/* Camif Controller */
437
438static struct resource s3c_camif_resource[] = {
439 [0] = {
440 .start = S3C2440_PA_CAMIF,
441 .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
442 .flags = IORESOURCE_MEM,
443 },
444 [1] = {
445 .start = IRQ_CAM,
446 .end = IRQ_CAM,
447 .flags = IORESOURCE_IRQ,
448 }
449
450};
451
452static u64 s3c_device_camif_dmamask = 0xffffffffUL;
453
454struct platform_device s3c_device_camif = {
455 .name = "s3c2440-camif",
456 .id = -1,
457 .num_resources = ARRAY_SIZE(s3c_camif_resource),
458 .resource = s3c_camif_resource,
459 .dev = {
460 .dma_mask = &s3c_device_camif_dmamask,
461 .coherent_dma_mask = 0xffffffffUL
462 }
463};
464
465EXPORT_SYMBOL(s3c_device_camif);
466
467/* AC97 */
468
469static struct resource s3c_ac97_resource[] = {
470 [0] = {
471 .start = S3C2440_PA_AC97,
472 .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1,
473 .flags = IORESOURCE_MEM,
474 },
475 [1] = {
476 .start = IRQ_S3C244x_AC97,
477 .end = IRQ_S3C244x_AC97,
478 .flags = IORESOURCE_IRQ,
479 },
480 [2] = {
481 .name = "PCM out",
482 .start = DMACH_PCM_OUT,
483 .end = DMACH_PCM_OUT,
484 .flags = IORESOURCE_DMA,
485 },
486 [3] = {
487 .name = "PCM in",
488 .start = DMACH_PCM_IN,
489 .end = DMACH_PCM_IN,
490 .flags = IORESOURCE_DMA,
491 },
492 [4] = {
493 .name = "Mic in",
494 .start = DMACH_MIC_IN,
495 .end = DMACH_MIC_IN,
496 .flags = IORESOURCE_DMA,
497 },
498};
499
500static u64 s3c_device_audio_dmamask = 0xffffffffUL;
501
502struct platform_device s3c_device_ac97 = {
503 .name = "samsung-ac97",
504 .id = -1,
505 .num_resources = ARRAY_SIZE(s3c_ac97_resource),
506 .resource = s3c_ac97_resource,
507 .dev = {
508 .dma_mask = &s3c_device_audio_dmamask,
509 .coherent_dma_mask = 0xffffffffUL
510 }
511};
512
513EXPORT_SYMBOL(s3c_device_ac97);
514
515/* ASoC I2S */
516
517struct platform_device s3c2412_device_iis = {
518 .name = "s3c2412-iis",
519 .id = -1,
520 .dev = {
521 .dma_mask = &s3c_device_audio_dmamask,
522 .coherent_dma_mask = 0xffffffffUL
523 }
524};
525
526EXPORT_SYMBOL(s3c2412_device_iis);
527
528#endif // CONFIG_CPU_S32440
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c
deleted file mode 100644
index 2f3d7c089dfa..000000000000
--- a/arch/arm/plat-s3c24xx/gpio.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/gpio.c
2 *
3 * Copyright (c) 2004-2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C24XX GPIO support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <linux/kernel.h>
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/interrupt.h>
27#include <linux/ioport.h>
28#include <linux/gpio.h>
29#include <linux/io.h>
30
31#include <mach/hardware.h>
32#include <mach/gpio-fns.h>
33#include <asm/irq.h>
34
35#include <mach/regs-gpio.h>
36
37#include <plat/gpio-core.h>
38
39/* gpiolib wrappers until these are totally eliminated */
40
41void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
42{
43 int ret;
44
45 WARN_ON(to); /* should be none of these left */
46
47 if (!to) {
48 /* if pull is enabled, try first with up, and if that
49 * fails, try using down */
50
51 ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP);
52 if (ret)
53 s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN);
54 } else {
55 s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE);
56 }
57}
58EXPORT_SYMBOL(s3c2410_gpio_pullup);
59
60void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
61{
62 /* do this via gpiolib until all users removed */
63
64 gpio_request(pin, "temporary");
65 gpio_set_value(pin, to);
66 gpio_free(pin);
67}
68
69EXPORT_SYMBOL(s3c2410_gpio_setpin);
70
71unsigned int s3c2410_gpio_getpin(unsigned int pin)
72{
73 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
74 unsigned long offs = pin - chip->chip.base;
75
76 return __raw_readl(chip->base + 0x04) & (1<< offs);
77}
78
79EXPORT_SYMBOL(s3c2410_gpio_getpin);
80
81unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
82{
83 unsigned long flags;
84 unsigned long misccr;
85
86 local_irq_save(flags);
87 misccr = __raw_readl(S3C24XX_MISCCR);
88 misccr &= ~clear;
89 misccr ^= change;
90 __raw_writel(misccr, S3C24XX_MISCCR);
91 local_irq_restore(flags);
92
93 return misccr;
94}
95
96EXPORT_SYMBOL(s3c2410_modify_misccr);
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
deleted file mode 100644
index 243b6411050d..000000000000
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ /dev/null
@@ -1,229 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/gpiolib.c
2 *
3 * Copyright (c) 2008-2010 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX GPIOlib support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12*/
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/sysdev.h>
19#include <linux/ioport.h>
20#include <linux/io.h>
21#include <linux/gpio.h>
22
23#include <plat/gpio-core.h>
24#include <plat/gpio-cfg.h>
25#include <plat/gpio-cfg-helpers.h>
26#include <mach/hardware.h>
27#include <asm/irq.h>
28#include <plat/pm.h>
29
30#include <mach/regs-gpio.h>
31
32static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset)
33{
34 return -EINVAL;
35}
36
37static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip,
38 unsigned offset, int value)
39{
40 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
41 void __iomem *base = ourchip->base;
42 unsigned long flags;
43 unsigned long dat;
44 unsigned long con;
45
46 local_irq_save(flags);
47
48 con = __raw_readl(base + 0x00);
49 dat = __raw_readl(base + 0x04);
50
51 dat &= ~(1 << offset);
52 if (value)
53 dat |= 1 << offset;
54
55 __raw_writel(dat, base + 0x04);
56
57 con &= ~(1 << offset);
58
59 __raw_writel(con, base + 0x00);
60 __raw_writel(dat, base + 0x04);
61
62 local_irq_restore(flags);
63 return 0;
64}
65
66static int s3c24xx_gpiolib_bankf_toirq(struct gpio_chip *chip, unsigned offset)
67{
68 if (offset < 4)
69 return IRQ_EINT0 + offset;
70
71 if (offset < 8)
72 return IRQ_EINT4 + offset - 4;
73
74 return -EINVAL;
75}
76
77static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = {
78 .set_config = s3c_gpio_setcfg_s3c24xx_a,
79 .get_config = s3c_gpio_getcfg_s3c24xx_a,
80};
81
82struct s3c_gpio_cfg s3c24xx_gpiocfg_default = {
83 .set_config = s3c_gpio_setcfg_s3c24xx,
84 .get_config = s3c_gpio_getcfg_s3c24xx,
85};
86
87struct s3c_gpio_chip s3c24xx_gpios[] = {
88 [0] = {
89 .base = S3C2410_GPACON,
90 .pm = __gpio_pm(&s3c_gpio_pm_1bit),
91 .config = &s3c24xx_gpiocfg_banka,
92 .chip = {
93 .base = S3C2410_GPA(0),
94 .owner = THIS_MODULE,
95 .label = "GPIOA",
96 .ngpio = 24,
97 .direction_input = s3c24xx_gpiolib_banka_input,
98 .direction_output = s3c24xx_gpiolib_banka_output,
99 },
100 },
101 [1] = {
102 .base = S3C2410_GPBCON,
103 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
104 .chip = {
105 .base = S3C2410_GPB(0),
106 .owner = THIS_MODULE,
107 .label = "GPIOB",
108 .ngpio = 16,
109 },
110 },
111 [2] = {
112 .base = S3C2410_GPCCON,
113 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
114 .chip = {
115 .base = S3C2410_GPC(0),
116 .owner = THIS_MODULE,
117 .label = "GPIOC",
118 .ngpio = 16,
119 },
120 },
121 [3] = {
122 .base = S3C2410_GPDCON,
123 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
124 .chip = {
125 .base = S3C2410_GPD(0),
126 .owner = THIS_MODULE,
127 .label = "GPIOD",
128 .ngpio = 16,
129 },
130 },
131 [4] = {
132 .base = S3C2410_GPECON,
133 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
134 .chip = {
135 .base = S3C2410_GPE(0),
136 .label = "GPIOE",
137 .owner = THIS_MODULE,
138 .ngpio = 16,
139 },
140 },
141 [5] = {
142 .base = S3C2410_GPFCON,
143 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
144 .chip = {
145 .base = S3C2410_GPF(0),
146 .owner = THIS_MODULE,
147 .label = "GPIOF",
148 .ngpio = 8,
149 .to_irq = s3c24xx_gpiolib_bankf_toirq,
150 },
151 },
152 [6] = {
153 .base = S3C2410_GPGCON,
154 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
155 .irq_base = IRQ_EINT8,
156 .chip = {
157 .base = S3C2410_GPG(0),
158 .owner = THIS_MODULE,
159 .label = "GPIOG",
160 .ngpio = 16,
161 .to_irq = samsung_gpiolib_to_irq,
162 },
163 }, {
164 .base = S3C2410_GPHCON,
165 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
166 .chip = {
167 .base = S3C2410_GPH(0),
168 .owner = THIS_MODULE,
169 .label = "GPIOH",
170 .ngpio = 11,
171 },
172 },
173 /* GPIOS for the S3C2443 and later devices. */
174 {
175 .base = S3C2440_GPJCON,
176 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
177 .chip = {
178 .base = S3C2410_GPJ(0),
179 .owner = THIS_MODULE,
180 .label = "GPIOJ",
181 .ngpio = 16,
182 },
183 }, {
184 .base = S3C2443_GPKCON,
185 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
186 .chip = {
187 .base = S3C2410_GPK(0),
188 .owner = THIS_MODULE,
189 .label = "GPIOK",
190 .ngpio = 16,
191 },
192 }, {
193 .base = S3C2443_GPLCON,
194 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
195 .chip = {
196 .base = S3C2410_GPL(0),
197 .owner = THIS_MODULE,
198 .label = "GPIOL",
199 .ngpio = 15,
200 },
201 }, {
202 .base = S3C2443_GPMCON,
203 .pm = __gpio_pm(&s3c_gpio_pm_2bit),
204 .chip = {
205 .base = S3C2410_GPM(0),
206 .owner = THIS_MODULE,
207 .label = "GPIOM",
208 .ngpio = 2,
209 },
210 },
211};
212
213
214static __init int s3c24xx_gpiolib_init(void)
215{
216 struct s3c_gpio_chip *chip = s3c24xx_gpios;
217 int gpn;
218
219 for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) {
220 if (!chip->config)
221 chip->config = &s3c24xx_gpiocfg_default;
222
223 s3c_gpiolib_add(chip);
224 }
225
226 return 0;
227}
228
229core_initcall(s3c24xx_gpiolib_init);
diff --git a/arch/arm/plat-s3c24xx/include/mach/clkdev.h b/arch/arm/plat-s3c24xx/include/mach/clkdev.h
deleted file mode 100644
index 7dffa83d23ff..000000000000
--- a/arch/arm/plat-s3c24xx/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H__
2#define __MACH_CLKDEV_H__
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do {} while (0)
6
7#endif
diff --git a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h b/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
deleted file mode 100644
index a087de21bc20..000000000000
--- a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C24xx - pwm clock and timer support
8 */
9
10/**
11 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
12 * @cfg: The timer TCFG1 register bits shifted down to 0.
13 *
14 * Return true if the given configuration from TCFG1 is a TCLK instead
15 * any of the TDIV clocks.
16 */
17static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
18{
19 return tcfg == S3C2410_TCFG1_MUX_TCLK;
20}
21
22/**
23 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
24 * @tcfg1: The tcfg1 setting, shifted down.
25 *
26 * Get the divisor value for the given tcfg1 setting. We assume the
27 * caller has already checked to see if this is not a TCLK source.
28 */
29static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
30{
31 return 1 << (1 + tcfg1);
32}
33
34/**
35 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
36 *
37 * Return true if we have a /1 in the tdiv setting.
38 */
39static inline unsigned int pwm_tdiv_has_div1(void)
40{
41 return 0;
42}
43
44/**
45 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
46 * @div: The divisor to calculate the bit information for.
47 *
48 * Turn a divisor into the necessary bit field for TCFG1.
49 */
50static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
51{
52 return ilog2(div) - 1;
53}
54
55#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK
diff --git a/arch/arm/plat-s3c24xx/include/plat/pll.h b/arch/arm/plat-s3c24xx/include/plat/pll.h
deleted file mode 100644
index 005729a1077a..000000000000
--- a/arch/arm/plat-s3c24xx/include/plat/pll.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/include/plat/pll.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C24xx - common pll registers and code
8 */
9
10#define S3C24XX_PLLCON_MDIVSHIFT 12
11#define S3C24XX_PLLCON_PDIVSHIFT 4
12#define S3C24XX_PLLCON_SDIVSHIFT 0
13#define S3C24XX_PLLCON_MDIVMASK ((1<<(1+(19-12)))-1)
14#define S3C24XX_PLLCON_PDIVMASK ((1<<5)-1)
15#define S3C24XX_PLLCON_SDIVMASK 3
16
17#include <asm/div64.h>
18
19static inline unsigned int
20s3c24xx_get_pll(unsigned int pllval, unsigned int baseclk)
21{
22 unsigned int mdiv, pdiv, sdiv;
23 uint64_t fvco;
24
25 mdiv = pllval >> S3C24XX_PLLCON_MDIVSHIFT;
26 pdiv = pllval >> S3C24XX_PLLCON_PDIVSHIFT;
27 sdiv = pllval >> S3C24XX_PLLCON_SDIVSHIFT;
28
29 mdiv &= S3C24XX_PLLCON_MDIVMASK;
30 pdiv &= S3C24XX_PLLCON_PDIVMASK;
31 sdiv &= S3C24XX_PLLCON_SDIVMASK;
32
33 fvco = (uint64_t)baseclk * (mdiv + 8);
34 do_div(fvco, (pdiv + 2) << sdiv);
35
36 return (unsigned int)fvco;
37}
38
39#define S3C2416_PLL_M_SHIFT (14)
40#define S3C2416_PLL_P_SHIFT (5)
41#define S3C2416_PLL_S_MASK (7)
42#define S3C2416_PLL_M_MASK ((1 << 10) - 1)
43#define S3C2416_PLL_P_MASK (63)
44
45static inline unsigned int
46s3c2416_get_pll(unsigned int pllval, unsigned int baseclk)
47{
48 unsigned int m, p, s;
49 uint64_t fvco;
50
51 m = pllval >> S3C2416_PLL_M_SHIFT;
52 p = pllval >> S3C2416_PLL_P_SHIFT;
53
54 s = pllval & S3C2416_PLL_S_MASK;
55 m &= S3C2416_PLL_M_MASK;
56 p &= S3C2416_PLL_P_MASK;
57
58 fvco = (uint64_t)baseclk * m;
59 do_div(fvco, (p << s));
60
61 return (unsigned int)fvco;
62}
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-iis.h b/arch/arm/plat-s3c24xx/include/plat/regs-iis.h
deleted file mode 100644
index cc44e0e931e9..000000000000
--- a/arch/arm/plat-s3c24xx/include/plat/regs-iis.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-iis.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * S3C2410 IIS register definition
11*/
12
13#ifndef __ASM_ARCH_REGS_IIS_H
14#define __ASM_ARCH_REGS_IIS_H
15
16#define S3C2410_IISCON (0x00)
17
18#define S3C2410_IISCON_LRINDEX (1<<8)
19#define S3C2410_IISCON_TXFIFORDY (1<<7)
20#define S3C2410_IISCON_RXFIFORDY (1<<6)
21#define S3C2410_IISCON_TXDMAEN (1<<5)
22#define S3C2410_IISCON_RXDMAEN (1<<4)
23#define S3C2410_IISCON_TXIDLE (1<<3)
24#define S3C2410_IISCON_RXIDLE (1<<2)
25#define S3C2410_IISCON_PSCEN (1<<1)
26#define S3C2410_IISCON_IISEN (1<<0)
27
28#define S3C2410_IISMOD (0x04)
29
30#define S3C2440_IISMOD_MPLL (1<<9)
31#define S3C2410_IISMOD_SLAVE (1<<8)
32#define S3C2410_IISMOD_NOXFER (0<<6)
33#define S3C2410_IISMOD_RXMODE (1<<6)
34#define S3C2410_IISMOD_TXMODE (2<<6)
35#define S3C2410_IISMOD_TXRXMODE (3<<6)
36#define S3C2410_IISMOD_LR_LLOW (0<<5)
37#define S3C2410_IISMOD_LR_RLOW (1<<5)
38#define S3C2410_IISMOD_IIS (0<<4)
39#define S3C2410_IISMOD_MSB (1<<4)
40#define S3C2410_IISMOD_8BIT (0<<3)
41#define S3C2410_IISMOD_16BIT (1<<3)
42#define S3C2410_IISMOD_BITMASK (1<<3)
43#define S3C2410_IISMOD_256FS (0<<2)
44#define S3C2410_IISMOD_384FS (1<<2)
45#define S3C2410_IISMOD_16FS (0<<0)
46#define S3C2410_IISMOD_32FS (1<<0)
47#define S3C2410_IISMOD_48FS (2<<0)
48#define S3C2410_IISMOD_FS_MASK (3<<0)
49
50#define S3C2410_IISPSR (0x08)
51#define S3C2410_IISPSR_INTMASK (31<<5)
52#define S3C2410_IISPSR_INTSHIFT (5)
53#define S3C2410_IISPSR_EXTMASK (31<<0)
54#define S3C2410_IISPSR_EXTSHFIT (0)
55
56#define S3C2410_IISFCON (0x0c)
57
58#define S3C2410_IISFCON_TXDMA (1<<15)
59#define S3C2410_IISFCON_RXDMA (1<<14)
60#define S3C2410_IISFCON_TXENABLE (1<<13)
61#define S3C2410_IISFCON_RXENABLE (1<<12)
62#define S3C2410_IISFCON_TXMASK (0x3f << 6)
63#define S3C2410_IISFCON_TXSHIFT (6)
64#define S3C2410_IISFCON_RXMASK (0x3f)
65#define S3C2410_IISFCON_RXSHIFT (0)
66
67#define S3C2410_IISFIFO (0x10)
68#endif /* __ASM_ARCH_REGS_IIS_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-spi.h b/arch/arm/plat-s3c24xx/include/plat/regs-spi.h
deleted file mode 100644
index 892e2f680fca..000000000000
--- a/arch/arm/plat-s3c24xx/include/plat/regs-spi.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-spi.h
2 *
3 * Copyright (c) 2004 Fetron GmbH
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C2410 SPI register definition
10*/
11
12#ifndef __ASM_ARCH_REGS_SPI_H
13#define __ASM_ARCH_REGS_SPI_H
14
15#define S3C2410_SPI1 (0x20)
16#define S3C2412_SPI1 (0x100)
17
18#define S3C2410_SPCON (0x00)
19
20#define S3C2412_SPCON_RXFIFO_RB2 (0<<14)
21#define S3C2412_SPCON_RXFIFO_RB4 (1<<14)
22#define S3C2412_SPCON_RXFIFO_RB12 (2<<14)
23#define S3C2412_SPCON_RXFIFO_RB14 (3<<14)
24#define S3C2412_SPCON_TXFIFO_RB2 (0<<12)
25#define S3C2412_SPCON_TXFIFO_RB4 (1<<12)
26#define S3C2412_SPCON_TXFIFO_RB12 (2<<12)
27#define S3C2412_SPCON_TXFIFO_RB14 (3<<12)
28#define S3C2412_SPCON_RXFIFO_RESET (1<<11) /* RxFIFO reset */
29#define S3C2412_SPCON_TXFIFO_RESET (1<<10) /* TxFIFO reset */
30#define S3C2412_SPCON_RXFIFO_EN (1<<9) /* RxFIFO Enable */
31#define S3C2412_SPCON_TXFIFO_EN (1<<8) /* TxFIFO Enable */
32
33#define S3C2412_SPCON_DIRC_RX (1<<7)
34
35#define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */
36#define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */
37#define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */
38#define S3C2410_SPCON_ENSCK (1<<4) /* Enable SCK */
39#define S3C2410_SPCON_MSTR (1<<3) /* Master/Slave select
40 0: slave, 1: master */
41#define S3C2410_SPCON_CPOL_HIGH (1<<2) /* Clock polarity select */
42#define S3C2410_SPCON_CPOL_LOW (0<<2) /* Clock polarity select */
43
44#define S3C2410_SPCON_CPHA_FMTB (1<<1) /* Clock Phase Select */
45#define S3C2410_SPCON_CPHA_FMTA (0<<1) /* Clock Phase Select */
46
47#define S3C2410_SPCON_TAGD (1<<0) /* Tx auto garbage data mode */
48
49
50#define S3C2410_SPSTA (0x04)
51
52#define S3C2412_SPSTA_RXFIFO_AE (1<<11)
53#define S3C2412_SPSTA_TXFIFO_AE (1<<10)
54#define S3C2412_SPSTA_RXFIFO_ERROR (1<<9)
55#define S3C2412_SPSTA_TXFIFO_ERROR (1<<8)
56#define S3C2412_SPSTA_RXFIFO_FIFO (1<<7)
57#define S3C2412_SPSTA_RXFIFO_EMPTY (1<<6)
58#define S3C2412_SPSTA_TXFIFO_NFULL (1<<5)
59#define S3C2412_SPSTA_TXFIFO_EMPTY (1<<4)
60
61#define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */
62#define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */
63#define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */
64#define S3C2412_SPSTA_READY_ORG (1<<3)
65
66#define S3C2410_SPPIN (0x08)
67
68#define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */
69#define S3C2410_SPPIN_RESERVED (1<<1)
70#define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */
71
72#define S3C2410_SPPRE (0x0C)
73#define S3C2410_SPTDAT (0x10)
74#define S3C2410_SPRDAT (0x14)
75
76#define S3C2412_TXFIFO (0x18)
77#define S3C2412_RXFIFO (0x18)
78#define S3C2412_SPFIC (0x24)
79
80
81#endif /* __ASM_ARCH_REGS_SPI_H */
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index 59552c0ea5fb..07a4c81587ac 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
@@ -205,9 +205,64 @@ static struct clksrc_clk clksrc_clks[] = {
205 }, 205 },
206}; 206};
207 207
208static struct clk clk_i2s_ext = {
209 .name = "i2s-ext",
210};
211
212/* i2s_eplldiv
213 *
214 * This clock is the output from the I2S divisor of ESYSCLK, and is separate
215 * from the mux that comes after it (cannot merge into one single clock)
216*/
217
218static struct clksrc_clk clk_i2s_eplldiv = {
219 .clk = {
220 .name = "i2s-eplldiv",
221 .parent = &clk_esysclk.clk,
222 },
223 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, },
224};
225
226/* i2s-ref
227 *
228 * i2s bus reference clock, selectable from external, esysclk or epllref
229 *
230 * Note, this used to be two clocks, but was compressed into one.
231*/
232
233static struct clk *clk_i2s_srclist[] = {
234 [0] = &clk_i2s_eplldiv.clk,
235 [1] = &clk_i2s_ext,
236 [2] = &clk_epllref.clk,
237 [3] = &clk_epllref.clk,
238};
239
240static struct clksrc_clk clk_i2s = {
241 .clk = {
242 .name = "i2s-if",
243 .ctrlbit = S3C2443_SCLKCON_I2SCLK,
244 .enable = s3c2443_clkcon_enable_s,
245
246 },
247 .sources = &(struct clksrc_sources) {
248 .sources = clk_i2s_srclist,
249 .nr_sources = ARRAY_SIZE(clk_i2s_srclist),
250 },
251 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 },
252};
208 253
209static struct clk init_clocks_off[] = { 254static struct clk init_clocks_off[] = {
210 { 255 {
256 .name = "iis",
257 .parent = &clk_p,
258 .enable = s3c2443_clkcon_enable_p,
259 .ctrlbit = S3C2443_PCLKCON_IIS,
260 }, {
261 .name = "hsspi",
262 .parent = &clk_p,
263 .enable = s3c2443_clkcon_enable_p,
264 .ctrlbit = S3C2443_PCLKCON_HSSPI,
265 }, {
211 .name = "adc", 266 .name = "adc",
212 .parent = &clk_p, 267 .parent = &clk_p,
213 .enable = s3c2443_clkcon_enable_p, 268 .enable = s3c2443_clkcon_enable_p,
@@ -406,6 +461,8 @@ static struct clk *clks[] __initdata = {
406}; 461};
407 462
408static struct clksrc_clk *clksrcs[] __initdata = { 463static struct clksrc_clk *clksrcs[] __initdata = {
464 &clk_i2s_eplldiv,
465 &clk_i2s,
409 &clk_usb_bus_host, 466 &clk_usb_bus_host,
410 &clk_epllref, 467 &clk_epllref,
411 &clk_esysclk, 468 &clk_esysclk,
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 9a197e55f669..ab16e5568c4c 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -16,9 +16,6 @@ config PLAT_S5P
16 select S3C_GPIO_TRACK 16 select S3C_GPIO_TRACK
17 select S5P_GPIO_DRVSTR 17 select S5P_GPIO_DRVSTR
18 select SAMSUNG_GPIOLIB_4BIT 18 select SAMSUNG_GPIOLIB_4BIT
19 select S3C_GPIO_CFG_S3C64XX
20 select S3C_GPIO_PULL_UPDOWN
21 select S3C_GPIO_CFG_S3C24XX
22 select PLAT_SAMSUNG 19 select PLAT_SAMSUNG
23 select SAMSUNG_CLKSRC 20 select SAMSUNG_CLKSRC
24 select SAMSUNG_IRQ_VIC_TIMER 21 select SAMSUNG_IRQ_VIC_TIMER
@@ -42,6 +39,12 @@ config S5P_HRT
42 help 39 help
43 Use the High Resolution timer support 40 Use the High Resolution timer support
44 41
42config S5P_PM
43 bool
44 help
45 Common code for power management support on S5P and newer SoCs
46 Note: Do not select this for S5P6440 and S5P6450.
47
45comment "System MMU" 48comment "System MMU"
46 49
47config S5P_SYSTEM_MMU 50config S5P_SYSTEM_MMU
@@ -50,6 +53,12 @@ config S5P_SYSTEM_MMU
50 help 53 help
51 Say Y here if you want to enable System MMU 54 Say Y here if you want to enable System MMU
52 55
56config S5P_SLEEP
57 bool
58 help
59 Internal config node to apply common S5P sleep management code.
60 Can be selected by S5P and newer SoCs with similar sleep procedure.
61
53config S5P_DEV_FIMC0 62config S5P_DEV_FIMC0
54 bool 63 bool
55 help 64 help
@@ -75,6 +84,11 @@ config S5P_DEV_FIMD0
75 help 84 help
76 Compile in platform device definitions for FIMD controller 0 85 Compile in platform device definitions for FIMD controller 0
77 86
87config S5P_DEV_I2C_HDMIPHY
88 bool
89 help
90 Compile in platform device definitions for I2C HDMIPHY controller
91
78config S5P_DEV_MFC 92config S5P_DEV_MFC
79 bool 93 bool
80 help 94 help
@@ -95,6 +109,11 @@ config S5P_DEV_CSIS1
95 help 109 help
96 Compile in platform device definitions for MIPI-CSIS channel 1 110 Compile in platform device definitions for MIPI-CSIS channel 1
97 111
112config S5P_DEV_TV
113 bool
114 help
115 Compile in platform device definition for TV interface
116
98config S5P_DEV_USB_EHCI 117config S5P_DEV_USB_EHCI
99 bool 118 bool
100 help 119 help
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 4b53e04eeca4..876344038b8d 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -12,7 +12,6 @@ obj- :=
12 12
13# Core files 13# Core files
14 14
15obj-y += dev-pmu.o
16obj-y += dev-uart.o 15obj-y += dev-uart.o
17obj-y += cpu.o 16obj-y += cpu.o
18obj-y += clock.o 17obj-y += clock.o
@@ -20,19 +19,10 @@ obj-y += irq.o
20obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o 19obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o
21obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o 20obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o
22obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o 21obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o
23obj-$(CONFIG_PM) += pm.o 22obj-$(CONFIG_S5P_PM) += pm.o irq-pm.o
24obj-$(CONFIG_PM) += irq-pm.o 23obj-$(CONFIG_S5P_SLEEP) += sleep.o
25obj-$(CONFIG_S5P_HRT) += s5p-time.o 24obj-$(CONFIG_S5P_HRT) += s5p-time.o
26 25
27# devices 26# devices
28obj-$(CONFIG_S5P_DEV_MFC) += dev-mfc.o 27obj-$(CONFIG_S5P_DEV_MFC) += dev-mfc.o
29obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
30obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
31obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
32obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o
33obj-$(CONFIG_S5P_DEV_FIMD0) += dev-fimd0.o
34obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
35obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o
36obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o
37obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o
38obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o 28obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o
diff --git a/arch/arm/plat-s5p/dev-csis0.c b/arch/arm/plat-s5p/dev-csis0.c
deleted file mode 100644
index e3aabef5e347..000000000000
--- a/arch/arm/plat-s5p/dev-csis0.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series device definition for MIPI-CSIS channel 0
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/interrupt.h>
13#include <linux/platform_device.h>
14#include <mach/map.h>
15
16static struct resource s5p_mipi_csis0_resource[] = {
17 [0] = {
18 .start = S5P_PA_MIPI_CSIS0,
19 .end = S5P_PA_MIPI_CSIS0 + SZ_4K - 1,
20 .flags = IORESOURCE_MEM,
21 },
22 [1] = {
23 .start = IRQ_MIPI_CSIS0,
24 .end = IRQ_MIPI_CSIS0,
25 .flags = IORESOURCE_IRQ,
26 }
27};
28
29struct platform_device s5p_device_mipi_csis0 = {
30 .name = "s5p-mipi-csis",
31 .id = 0,
32 .num_resources = ARRAY_SIZE(s5p_mipi_csis0_resource),
33 .resource = s5p_mipi_csis0_resource,
34};
diff --git a/arch/arm/plat-s5p/dev-csis1.c b/arch/arm/plat-s5p/dev-csis1.c
deleted file mode 100644
index 08b91b580207..000000000000
--- a/arch/arm/plat-s5p/dev-csis1.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series device definition for MIPI-CSIS channel 1
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/interrupt.h>
13#include <linux/platform_device.h>
14#include <mach/map.h>
15
16static struct resource s5p_mipi_csis1_resource[] = {
17 [0] = {
18 .start = S5P_PA_MIPI_CSIS1,
19 .end = S5P_PA_MIPI_CSIS1 + SZ_4K - 1,
20 .flags = IORESOURCE_MEM,
21 },
22 [1] = {
23 .start = IRQ_MIPI_CSIS1,
24 .end = IRQ_MIPI_CSIS1,
25 .flags = IORESOURCE_IRQ,
26 },
27};
28
29struct platform_device s5p_device_mipi_csis1 = {
30 .name = "s5p-mipi-csis",
31 .id = 1,
32 .num_resources = ARRAY_SIZE(s5p_mipi_csis1_resource),
33 .resource = s5p_mipi_csis1_resource,
34};
diff --git a/arch/arm/plat-s5p/dev-ehci.c b/arch/arm/plat-s5p/dev-ehci.c
deleted file mode 100644
index 94080fff9e9b..000000000000
--- a/arch/arm/plat-s5p/dev-ehci.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 */
11
12#include <linux/platform_device.h>
13#include <mach/irqs.h>
14#include <mach/map.h>
15#include <plat/devs.h>
16#include <plat/ehci.h>
17#include <plat/usb-phy.h>
18
19/* USB EHCI Host Controller registration */
20static struct resource s5p_ehci_resource[] = {
21 [0] = {
22 .start = S5P_PA_EHCI,
23 .end = S5P_PA_EHCI + SZ_256 - 1,
24 .flags = IORESOURCE_MEM,
25 },
26 [1] = {
27 .start = IRQ_USB_HOST,
28 .end = IRQ_USB_HOST,
29 .flags = IORESOURCE_IRQ,
30 }
31};
32
33static u64 s5p_device_ehci_dmamask = 0xffffffffUL;
34
35struct platform_device s5p_device_ehci = {
36 .name = "s5p-ehci",
37 .id = -1,
38 .num_resources = ARRAY_SIZE(s5p_ehci_resource),
39 .resource = s5p_ehci_resource,
40 .dev = {
41 .dma_mask = &s5p_device_ehci_dmamask,
42 .coherent_dma_mask = 0xffffffffUL
43 }
44};
45
46void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
47{
48 struct s5p_ehci_platdata *npd;
49
50 npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
51 &s5p_device_ehci);
52
53 if (!npd->phy_init)
54 npd->phy_init = s5p_usb_phy_init;
55 if (!npd->phy_exit)
56 npd->phy_exit = s5p_usb_phy_exit;
57}
diff --git a/arch/arm/plat-s5p/dev-fimc0.c b/arch/arm/plat-s5p/dev-fimc0.c
deleted file mode 100644
index 608770fc1531..000000000000
--- a/arch/arm/plat-s5p/dev-fimc0.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-fimc0.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC0 resource and device definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc0_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC0,
22 .end = S5P_PA_FIMC0 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC0,
27 .end = IRQ_FIMC0,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc0_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc0 = {
35 .name = "s5p-fimc",
36 .id = 0,
37 .num_resources = ARRAY_SIZE(s5p_fimc0_resource),
38 .resource = s5p_fimc0_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc0_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/dev-fimc1.c b/arch/arm/plat-s5p/dev-fimc1.c
deleted file mode 100644
index 76e3a97a87d3..000000000000
--- a/arch/arm/plat-s5p/dev-fimc1.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-fimc1.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC1 resource and device definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc1_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC1,
22 .end = S5P_PA_FIMC1 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC1,
27 .end = IRQ_FIMC1,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc1_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc1 = {
35 .name = "s5p-fimc",
36 .id = 1,
37 .num_resources = ARRAY_SIZE(s5p_fimc1_resource),
38 .resource = s5p_fimc1_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc1_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/dev-fimc2.c b/arch/arm/plat-s5p/dev-fimc2.c
deleted file mode 100644
index 24d29816fa2c..000000000000
--- a/arch/arm/plat-s5p/dev-fimc2.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-fimc2.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC2 resource and device definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc2_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC2,
22 .end = S5P_PA_FIMC2 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC2,
27 .end = IRQ_FIMC2,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc2_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc2 = {
35 .name = "s5p-fimc",
36 .id = 2,
37 .num_resources = ARRAY_SIZE(s5p_fimc2_resource),
38 .resource = s5p_fimc2_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc2_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/dev-fimc3.c b/arch/arm/plat-s5p/dev-fimc3.c
deleted file mode 100644
index ef31beca386c..000000000000
--- a/arch/arm/plat-s5p/dev-fimc3.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-fimc3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC3 resource and device definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc3_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC3,
22 .end = S5P_PA_FIMC3 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC3,
27 .end = IRQ_FIMC3,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc3_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc3 = {
35 .name = "s5p-fimc",
36 .id = 3,
37 .num_resources = ARRAY_SIZE(s5p_fimc3_resource),
38 .resource = s5p_fimc3_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc3_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/dev-fimd0.c b/arch/arm/plat-s5p/dev-fimd0.c
deleted file mode 100644
index f728bb5abcef..000000000000
--- a/arch/arm/plat-s5p/dev-fimd0.c
+++ /dev/null
@@ -1,67 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-fimd0.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Core file for Samsung Display Controller (FIMD) driver
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/platform_device.h>
16#include <linux/fb.h>
17#include <linux/gfp.h>
18#include <linux/dma-mapping.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/fb.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s5p_fimd0_resource[] = {
28 [0] = {
29 .start = S5P_PA_FIMD0,
30 .end = S5P_PA_FIMD0 + SZ_32K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_FIMD0_VSYNC,
35 .end = IRQ_FIMD0_VSYNC,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = IRQ_FIMD0_FIFO,
40 .end = IRQ_FIMD0_FIFO,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = IRQ_FIMD0_SYSTEM,
45 .end = IRQ_FIMD0_SYSTEM,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50static u64 fimd0_dmamask = DMA_BIT_MASK(32);
51
52struct platform_device s5p_device_fimd0 = {
53 .name = "s5p-fb",
54 .id = 0,
55 .num_resources = ARRAY_SIZE(s5p_fimd0_resource),
56 .resource = s5p_fimd0_resource,
57 .dev = {
58 .dma_mask = &fimd0_dmamask,
59 .coherent_dma_mask = DMA_BIT_MASK(32),
60 },
61};
62
63void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
64{
65 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
66 &s5p_device_fimd0);
67}
diff --git a/arch/arm/plat-s5p/dev-mfc.c b/arch/arm/plat-s5p/dev-mfc.c
index 94226a0010f7..a30d36b7f61b 100644
--- a/arch/arm/plat-s5p/dev-mfc.c
+++ b/arch/arm/plat-s5p/dev-mfc.c
@@ -22,56 +22,6 @@
22#include <plat/irqs.h> 22#include <plat/irqs.h>
23#include <plat/mfc.h> 23#include <plat/mfc.h>
24 24
25static struct resource s5p_mfc_resource[] = {
26 [0] = {
27 .start = S5P_PA_MFC,
28 .end = S5P_PA_MFC + SZ_64K - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_MFC,
33 .end = IRQ_MFC,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38struct platform_device s5p_device_mfc = {
39 .name = "s5p-mfc",
40 .id = -1,
41 .num_resources = ARRAY_SIZE(s5p_mfc_resource),
42 .resource = s5p_mfc_resource,
43};
44
45/*
46 * MFC hardware has 2 memory interfaces which are modelled as two separate
47 * platform devices to let dma-mapping distinguish between them.
48 *
49 * MFC parent device (s5p_device_mfc) must be registered before memory
50 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
51 */
52
53static u64 s5p_mfc_dma_mask = DMA_BIT_MASK(32);
54
55struct platform_device s5p_device_mfc_l = {
56 .name = "s5p-mfc-l",
57 .id = -1,
58 .dev = {
59 .parent = &s5p_device_mfc.dev,
60 .dma_mask = &s5p_mfc_dma_mask,
61 .coherent_dma_mask = DMA_BIT_MASK(32),
62 },
63};
64
65struct platform_device s5p_device_mfc_r = {
66 .name = "s5p-mfc-r",
67 .id = -1,
68 .dev = {
69 .parent = &s5p_device_mfc.dev,
70 .dma_mask = &s5p_mfc_dma_mask,
71 .coherent_dma_mask = DMA_BIT_MASK(32),
72 },
73};
74
75struct s5p_mfc_reserved_mem { 25struct s5p_mfc_reserved_mem {
76 phys_addr_t base; 26 phys_addr_t base;
77 unsigned long size; 27 unsigned long size;
diff --git a/arch/arm/plat-s5p/dev-onenand.c b/arch/arm/plat-s5p/dev-onenand.c
deleted file mode 100644
index 20336c8f2479..000000000000
--- a/arch/arm/plat-s5p/dev-onenand.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/* linux/arch/arm/plat-s5p/dev-onenand.c
2 *
3 * Copyright 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2008-2010 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com>
8 *
9 * S5P series device definition for OneNAND devices
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22static struct resource s5p_onenand_resources[] = {
23 [0] = {
24 .start = S5P_PA_ONENAND,
25 .end = S5P_PA_ONENAND + SZ_128K - 1,
26 .flags = IORESOURCE_MEM,
27 },
28 [1] = {
29 .start = S5P_PA_ONENAND_DMA,
30 .end = S5P_PA_ONENAND_DMA + SZ_8K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [2] = {
34 .start = IRQ_ONENAND_AUDI,
35 .end = IRQ_ONENAND_AUDI,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s5p_device_onenand = {
41 .name = "s5pc110-onenand",
42 .id = -1,
43 .num_resources = ARRAY_SIZE(s5p_onenand_resources),
44 .resource = s5p_onenand_resources,
45};
diff --git a/arch/arm/plat-s5p/dev-pmu.c b/arch/arm/plat-s5p/dev-pmu.c
deleted file mode 100644
index a08576da72b0..000000000000
--- a/arch/arm/plat-s5p/dev-pmu.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * linux/arch/arm/plat-s5p/dev-pmu.c
3 *
4 * Copyright (C) 2010 Samsung Electronics Co.Ltd
5 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#include <linux/platform_device.h>
15#include <asm/pmu.h>
16#include <mach/irqs.h>
17
18static struct resource s5p_pmu_resource = {
19 .start = IRQ_PMU,
20 .end = IRQ_PMU,
21 .flags = IORESOURCE_IRQ,
22};
23
24struct platform_device s5p_device_pmu = {
25 .name = "arm-pmu",
26 .id = ARM_PMU_DEVICE_CPU,
27 .num_resources = 1,
28 .resource = &s5p_pmu_resource,
29};
30
31static int __init s5p_pmu_init(void)
32{
33 platform_device_register(&s5p_device_pmu);
34 return 0;
35}
36arch_initcall(s5p_pmu_init);
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c
index c65eb791d1bb..1fdfaa4599ce 100644
--- a/arch/arm/plat-s5p/irq-gpioint.c
+++ b/arch/arm/plat-s5p/irq-gpioint.c
@@ -37,7 +37,7 @@ struct s5p_gpioint_bank {
37 int start; 37 int start;
38 int nr_groups; 38 int nr_groups;
39 int irq; 39 int irq;
40 struct s3c_gpio_chip **chips; 40 struct samsung_gpio_chip **chips;
41 void (*handler)(unsigned int, struct irq_desc *); 41 void (*handler)(unsigned int, struct irq_desc *);
42}; 42};
43 43
@@ -87,7 +87,7 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
87 chained_irq_enter(chip, desc); 87 chained_irq_enter(chip, desc);
88 88
89 for (group = 0; group < bank->nr_groups; group++) { 89 for (group = 0; group < bank->nr_groups; group++) {
90 struct s3c_gpio_chip *chip = bank->chips[group]; 90 struct samsung_gpio_chip *chip = bank->chips[group];
91 if (!chip) 91 if (!chip)
92 continue; 92 continue;
93 93
@@ -110,7 +110,7 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
110 chained_irq_exit(chip, desc); 110 chained_irq_exit(chip, desc);
111} 111}
112 112
113static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) 113static __init int s5p_gpioint_add(struct samsung_gpio_chip *chip)
114{ 114{
115 static int used_gpioint_groups = 0; 115 static int used_gpioint_groups = 0;
116 int group = chip->group; 116 int group = chip->group;
@@ -131,7 +131,7 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
131 return -EINVAL; 131 return -EINVAL;
132 132
133 if (!bank->handler) { 133 if (!bank->handler) {
134 bank->chips = kzalloc(sizeof(struct s3c_gpio_chip *) * 134 bank->chips = kzalloc(sizeof(struct samsung_gpio_chip *) *
135 bank->nr_groups, GFP_KERNEL); 135 bank->nr_groups, GFP_KERNEL);
136 if (!bank->chips) 136 if (!bank->chips)
137 return -ENOMEM; 137 return -ENOMEM;
@@ -174,7 +174,7 @@ static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
174 174
175int __init s5p_register_gpio_interrupt(int pin) 175int __init s5p_register_gpio_interrupt(int pin)
176{ 176{
177 struct s3c_gpio_chip *my_chip = s3c_gpiolib_getchip(pin); 177 struct samsung_gpio_chip *my_chip = samsung_gpiolib_getchip(pin);
178 int offset, group; 178 int offset, group;
179 int ret; 179 int ret;
180 180
diff --git a/arch/arm/mach-exynos4/sleep.S b/arch/arm/plat-s5p/sleep.S
index 0984078f1eba..0fd591bfc9fd 100644
--- a/arch/arm/mach-exynos4/sleep.S
+++ b/arch/arm/plat-s5p/sleep.S
@@ -1,15 +1,11 @@
1/* linux/arch/arm/mach-exynos4/sleep.S 1/* linux/arch/arm/plat-s5p/sleep.S
2 * 2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * EXYNOS4210 power Manager (Suspend-To-RAM) support 6 * Common S5P Sleep Code
7 * Based on S3C2410 sleep code by: 7 * Based on S3C64XX sleep code by:
8 * Ben Dooks, (c) 2004 Simtec Electronics 8 * Ben Dooks, (c) 2008 Simtec Electronics
9 *
10 * Based on PXA/SA1100 sleep code by:
11 * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
12 * Cliff Brake, (c) 2001
13 * 9 *
14 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
@@ -28,7 +24,6 @@
28 24
29#include <linux/linkage.h> 25#include <linux/linkage.h>
30#include <asm/assembler.h> 26#include <asm/assembler.h>
31#include <asm/memory.h>
32 27
33 .text 28 .text
34 29
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 7a96198e3a78..313eb26cfa62 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -74,39 +74,12 @@ config SAMSUNG_GPIOLIB_4BIT
74 configuration. GPIOlib shall be compiled only for S3C64XX and S5P 74 configuration. GPIOlib shall be compiled only for S3C64XX and S5P
75 series of processors. 75 series of processors.
76 76
77config S3C_GPIO_CFG_S3C24XX
78 bool
79 help
80 Internal configuration to enable S3C24XX style GPIO configuration
81 functions.
82
83config S3C_GPIO_CFG_S3C64XX 77config S3C_GPIO_CFG_S3C64XX
84 bool 78 bool
85 help 79 help
86 Internal configuration to enable S3C64XX style GPIO configuration 80 Internal configuration to enable S3C64XX style GPIO configuration
87 functions. 81 functions.
88 82
89config S3C_GPIO_PULL_UPDOWN
90 bool
91 help
92 Internal configuration to enable the correct GPIO pull helper
93
94config S3C_GPIO_PULL_S3C2443
95 bool
96 select S3C_GPIO_PULL_UPDOWN
97 help
98 Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO
99
100config S3C_GPIO_PULL_DOWN
101 bool
102 help
103 Internal configuration to enable the correct GPIO pull helper
104
105config S3C_GPIO_PULL_UP
106 bool
107 help
108 Internal configuration to enable the correct GPIO pull helper
109
110config S5P_GPIO_DRVSTR 83config S5P_GPIO_DRVSTR
111 bool 84 bool
112 help 85 help
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 3dd5dbad55c6..6012366f33cb 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -1,4 +1,4 @@
1# arch/arm/plat-s3c64xx/Makefile 1# arch/arm/plat-samsung/Makefile
2# 2#
3# Copyright 2009 Simtec Electronics 3# Copyright 2009 Simtec Electronics
4# 4#
@@ -15,9 +15,6 @@ obj-y += init.o cpu.o
15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o 15obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o
16obj-y += clock.o 16obj-y += clock.o
17obj-y += pwm-clock.o 17obj-y += pwm-clock.o
18obj-y += gpio.o
19obj-y += gpio-config.o
20obj-y += dev-asocdma.o
21 18
22obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o 19obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
23 20
@@ -31,33 +28,9 @@ obj-$(CONFIG_S3C_ADC) += adc.o
31 28
32obj-y += platformdata.o 29obj-y += platformdata.o
33 30
34obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 31obj-y += devs.o
35obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
36obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
37obj-$(CONFIG_S3C_DEV_HSMMC3) += dev-hsmmc3.o
38obj-$(CONFIG_S3C_DEV_HWMON) += dev-hwmon.o
39obj-y += dev-i2c0.o
40obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
41obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o
42obj-$(CONFIG_S3C_DEV_I2C3) += dev-i2c3.o
43obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.o
44obj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o
45obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o
46obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o
47obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
48obj-y += dev-uart.o 32obj-y += dev-uart.o
49obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 33
50obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
51obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
52obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
53obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
54obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o
55
56obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
57obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o
58obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o
59obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o
60obj-$(CONFIG_SAMSUNG_DEV_PWM) += dev-pwm.o
61obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o 34obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o
62 35
63# DMA support 36# DMA support
diff --git a/arch/arm/plat-samsung/dev-adc.c b/arch/arm/plat-samsung/dev-adc.c
deleted file mode 100644
index 9d903d4095ed..000000000000
--- a/arch/arm/plat-samsung/dev-adc.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-adc.c
2 *
3 * Copyright 2010 Maurus Cuelenaere
4 *
5 * S3C64xx series device definition for ADC device
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18
19#include <plat/adc.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23static struct resource s3c_adc_resource[] = {
24 [0] = {
25 .start = SAMSUNG_PA_ADC,
26 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 [1] = {
30 .start = IRQ_TC,
31 .end = IRQ_TC,
32 .flags = IORESOURCE_IRQ,
33 },
34 [2] = {
35 .start = IRQ_ADC,
36 .end = IRQ_ADC,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_adc = {
42 .name = "samsung-adc",
43 .id = -1,
44 .num_resources = ARRAY_SIZE(s3c_adc_resource),
45 .resource = s3c_adc_resource,
46};
diff --git a/arch/arm/plat-samsung/dev-asocdma.c b/arch/arm/plat-samsung/dev-asocdma.c
deleted file mode 100644
index 97e35d3c064d..000000000000
--- a/arch/arm/plat-samsung/dev-asocdma.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-asocdma.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13#include <plat/devs.h>
14
15static u64 audio_dmamask = DMA_BIT_MASK(32);
16
17struct platform_device samsung_asoc_dma = {
18 .name = "samsung-audio",
19 .id = -1,
20 .dev = {
21 .dma_mask = &audio_dmamask,
22 .coherent_dma_mask = DMA_BIT_MASK(32),
23 }
24};
25EXPORT_SYMBOL(samsung_asoc_dma);
26
27struct platform_device samsung_asoc_idma = {
28 .name = "samsung-idma",
29 .id = -1,
30 .dev = {
31 .dma_mask = &audio_dmamask,
32 .coherent_dma_mask = DMA_BIT_MASK(32),
33 }
34};
35EXPORT_SYMBOL(samsung_asoc_idma);
diff --git a/arch/arm/plat-samsung/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
deleted file mode 100644
index 49a1362fd25b..000000000000
--- a/arch/arm/plat-samsung/dev-fb.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-fb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for framebuffer device
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18#include <linux/gfp.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/fb.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_fb_resource[] = {
28 [0] = {
29 .start = S3C_PA_FB,
30 .end = S3C_PA_FB + SZ_16K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_LCD_VSYNC,
35 .end = IRQ_LCD_VSYNC,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = IRQ_LCD_FIFO,
40 .end = IRQ_LCD_FIFO,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = IRQ_LCD_SYSTEM,
45 .end = IRQ_LCD_SYSTEM,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50struct platform_device s3c_device_fb = {
51 .name = "s3c-fb",
52 .id = -1,
53 .num_resources = ARRAY_SIZE(s3c_fb_resource),
54 .resource = s3c_fb_resource,
55 .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
56 .dev.coherent_dma_mask = 0xffffffffUL,
57};
58
59void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
60{
61 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
62 &s3c_device_fb);
63}
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
deleted file mode 100644
index 06825c4276de..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC0,
28 .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC0,
33 .end = IRQ_HSMMC0,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
45};
46
47struct platform_device s3c_device_hsmmc0 = {
48 .name = "s3c-sdhci",
49 .id = 0,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
51 .resource = s3c_hsmmc_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc0_def_platdata,
56 },
57};
58
59void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
deleted file mode 100644
index 4524ef440010..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc1.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for hsmmc device 1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mmc/host.h>
17
18#include <mach/map.h>
19#include <plat/sdhci.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23#define S3C_SZ_HSMMC (0x1000)
24
25static struct resource s3c_hsmmc1_resource[] = {
26 [0] = {
27 .start = S3C_PA_HSMMC1,
28 .end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_HSMMC1,
33 .end = IRQ_HSMMC1,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_hsmmc1_dmamask = 0xffffffffUL;
39
40struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
45};
46
47struct platform_device s3c_device_hsmmc1 = {
48 .name = "s3c-sdhci",
49 .id = 1,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
51 .resource = s3c_hsmmc1_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc1_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc1_def_platdata,
56 },
57};
58
59void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
deleted file mode 100644
index 9cede9615e48..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
2 *
3 * Copyright (c) 2009 Samsung Electronics
4 * Copyright (c) 2009 Maurus Cuelenaere
5 *
6 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
7 * original file Copyright (c) 2008 Simtec Electronics
8 *
9 * S3C series device definition for hsmmc device 2
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18#include <linux/mmc/host.h>
19
20#include <mach/map.h>
21#include <plat/sdhci.h>
22#include <plat/devs.h>
23
24#define S3C_SZ_HSMMC (0x1000)
25
26static struct resource s3c_hsmmc2_resource[] = {
27 [0] = {
28 .start = S3C_PA_HSMMC2,
29 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_HSMMC2,
34 .end = IRQ_HSMMC2,
35 .flags = IORESOURCE_IRQ,
36 }
37};
38
39static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
40
41struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
46};
47
48struct platform_device s3c_device_hsmmc2 = {
49 .name = "s3c-sdhci",
50 .id = 2,
51 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
52 .resource = s3c_hsmmc2_resource,
53 .dev = {
54 .dma_mask = &s3c_device_hsmmc2_dmamask,
55 .coherent_dma_mask = 0xffffffffUL,
56 .platform_data = &s3c_hsmmc2_def_platdata,
57 },
58};
59
60void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
61{
62 s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
63}
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
deleted file mode 100644
index 0358ef4a8f66..000000000000
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ /dev/null
@@ -1,66 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-hsmmc3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2008 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 * http://armlinux.simtec.co.uk/
9 *
10 * Based on arch/arm/plat-samsung/dev-hsmmc1.c
11 *
12 * Samsung device definition for hsmmc device 3
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17*/
18
19#include <linux/kernel.h>
20#include <linux/platform_device.h>
21#include <linux/mmc/host.h>
22
23#include <mach/map.h>
24#include <plat/sdhci.h>
25#include <plat/devs.h>
26
27#define S3C_SZ_HSMMC (0x1000)
28
29static struct resource s3c_hsmmc3_resource[] = {
30 [0] = {
31 .start = S3C_PA_HSMMC3,
32 .end = S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
33 .flags = IORESOURCE_MEM,
34 },
35 [1] = {
36 .start = IRQ_HSMMC3,
37 .end = IRQ_HSMMC3,
38 .flags = IORESOURCE_IRQ,
39 }
40};
41
42static u64 s3c_device_hsmmc3_dmamask = 0xffffffffUL;
43
44struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
45 .max_width = 4,
46 .host_caps = (MMC_CAP_4_BIT_DATA |
47 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
48 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
49};
50
51struct platform_device s3c_device_hsmmc3 = {
52 .name = "s3c-sdhci",
53 .id = 3,
54 .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
55 .resource = s3c_hsmmc3_resource,
56 .dev = {
57 .dma_mask = &s3c_device_hsmmc3_dmamask,
58 .coherent_dma_mask = 0xffffffffUL,
59 .platform_data = &s3c_hsmmc3_def_platdata,
60 },
61};
62
63void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
64{
65 s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
66}
diff --git a/arch/arm/plat-samsung/dev-hwmon.c b/arch/arm/plat-samsung/dev-hwmon.c
deleted file mode 100644
index c91a79ce8f39..000000000000
--- a/arch/arm/plat-samsung/dev-hwmon.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-hwmon.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * Adapted for HWMON by Maurus Cuelenaere
8 *
9 * Samsung series device definition for HWMON
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18
19#include <plat/devs.h>
20#include <plat/hwmon.h>
21
22struct platform_device s3c_device_hwmon = {
23 .name = "s3c-hwmon",
24 .id = -1,
25 .dev.parent = &s3c_device_adc.dev,
26};
27
28void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
29{
30 s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
31 &s3c_device_hwmon);
32}
diff --git a/arch/arm/plat-samsung/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c
deleted file mode 100644
index f8251f5098bd..000000000000
--- a/arch/arm/plat-samsung/dev-i2c0.c
+++ /dev/null
@@ -1,70 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 0
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/regs-iic.h>
23#include <plat/iic.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_i2c_resource[] = {
28 [0] = {
29 .start = S3C_PA_IIC,
30 .end = S3C_PA_IIC + SZ_4K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_IIC,
35 .end = IRQ_IIC,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s3c_device_i2c0 = {
41 .name = "s3c2410-i2c",
42#ifdef CONFIG_S3C_DEV_I2C1
43 .id = 0,
44#else
45 .id = -1,
46#endif
47 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
48 .resource = s3c_i2c_resource,
49};
50
51struct s3c2410_platform_i2c default_i2c_data __initdata = {
52 .flags = 0,
53 .slave_addr = 0x10,
54 .frequency = 100*1000,
55 .sda_delay = 100,
56};
57
58void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
59{
60 struct s3c2410_platform_i2c *npd;
61
62 if (!pd)
63 pd = &default_i2c_data;
64
65 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
66 &s3c_device_i2c0);
67
68 if (!npd->cfg_gpio)
69 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
70}
diff --git a/arch/arm/plat-samsung/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c
deleted file mode 100644
index 3b7c7bec1cf9..000000000000
--- a/arch/arm/plat-samsung/dev-i2c1.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.c
2 *
3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for i2c device 1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/regs-iic.h>
23#include <plat/iic.h>
24#include <plat/devs.h>
25#include <plat/cpu.h>
26
27static struct resource s3c_i2c_resource[] = {
28 [0] = {
29 .start = S3C_PA_IIC1,
30 .end = S3C_PA_IIC1 + SZ_4K - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_IIC1,
35 .end = IRQ_IIC1,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s3c_device_i2c1 = {
41 .name = "s3c2410-i2c",
42 .id = 1,
43 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
44 .resource = s3c_i2c_resource,
45};
46
47void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
48{
49 struct s3c2410_platform_i2c *npd;
50
51 if (!pd) {
52 pd = &default_i2c_data;
53 pd->bus_num = 1;
54 }
55
56 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
57 &s3c_device_i2c1);
58
59 if (!npd->cfg_gpio)
60 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
61}
diff --git a/arch/arm/plat-samsung/dev-i2c2.c b/arch/arm/plat-samsung/dev-i2c2.c
deleted file mode 100644
index 07e9fd0b1b8b..000000000000
--- a/arch/arm/plat-samsung/dev-i2c2.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-i2c2.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S3C series device definition for i2c device 2
7 *
8 * Based on plat-samsung/dev-i2c0.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/gfp.h>
16#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/regs-iic.h>
24#include <plat/iic.h>
25#include <plat/devs.h>
26#include <plat/cpu.h>
27
28static struct resource s3c_i2c_resource[] = {
29 [0] = {
30 .start = S3C_PA_IIC2,
31 .end = S3C_PA_IIC2 + SZ_4K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = IRQ_IIC2,
36 .end = IRQ_IIC2,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_i2c2 = {
42 .name = "s3c2410-i2c",
43 .id = 2,
44 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
45 .resource = s3c_i2c_resource,
46};
47
48void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
49{
50 struct s3c2410_platform_i2c *npd;
51
52 if (!pd) {
53 pd = &default_i2c_data;
54 pd->bus_num = 2;
55 }
56
57 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
58 &s3c_device_i2c2);
59
60 if (!npd->cfg_gpio)
61 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
62}
diff --git a/arch/arm/plat-samsung/dev-i2c3.c b/arch/arm/plat-samsung/dev-i2c3.c
deleted file mode 100644
index d48efa93c6e7..000000000000
--- a/arch/arm/plat-samsung/dev-i2c3.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC3,
29 .end = S3C_PA_IIC3 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC3,
34 .end = IRQ_IIC3,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c3 = {
40 .name = "s3c2440-i2c",
41 .id = 3,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 3;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c3);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c3_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c4.c b/arch/arm/plat-samsung/dev-i2c4.c
deleted file mode 100644
index 07e26444efe6..000000000000
--- a/arch/arm/plat-samsung/dev-i2c4.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c4.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC4,
29 .end = S3C_PA_IIC4 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC4,
34 .end = IRQ_IIC4,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c4 = {
40 .name = "s3c2440-i2c",
41 .id = 4,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 4;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c4);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c4_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c5.c b/arch/arm/plat-samsung/dev-i2c5.c
deleted file mode 100644
index f49655784563..000000000000
--- a/arch/arm/plat-samsung/dev-i2c5.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 3
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC5,
29 .end = S3C_PA_IIC5 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC5,
34 .end = IRQ_IIC5,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c5 = {
40 .name = "s3c2440-i2c",
41 .id = 5,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 5;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c5);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c5_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c6.c b/arch/arm/plat-samsung/dev-i2c6.c
deleted file mode 100644
index 141d799944e2..000000000000
--- a/arch/arm/plat-samsung/dev-i2c6.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c6.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 6
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC6,
29 .end = S3C_PA_IIC6 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC6,
34 .end = IRQ_IIC6,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c6 = {
40 .name = "s3c2440-i2c",
41 .id = 6,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 6;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c6);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c6_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-i2c7.c b/arch/arm/plat-samsung/dev-i2c7.c
deleted file mode 100644
index 9dddcd1665b5..000000000000
--- a/arch/arm/plat-samsung/dev-i2c7.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-i2c7.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P series device definition for i2c device 7
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/gfp.h>
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/regs-iic.h>
22#include <plat/iic.h>
23#include <plat/devs.h>
24#include <plat/cpu.h>
25
26static struct resource s3c_i2c_resource[] = {
27 [0] = {
28 .start = S3C_PA_IIC7,
29 .end = S3C_PA_IIC7 + SZ_4K - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_IIC7,
34 .end = IRQ_IIC7,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_i2c7 = {
40 .name = "s3c2440-i2c",
41 .id = 7,
42 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
43 .resource = s3c_i2c_resource,
44};
45
46void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
47{
48 struct s3c2410_platform_i2c *npd;
49
50 if (!pd) {
51 pd = &default_i2c_data;
52 pd->bus_num = 7;
53 }
54
55 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
56 &s3c_device_i2c7);
57
58 if (!npd->cfg_gpio)
59 npd->cfg_gpio = s3c_i2c7_cfg_gpio;
60}
diff --git a/arch/arm/plat-samsung/dev-ide.c b/arch/arm/plat-samsung/dev-ide.c
deleted file mode 100644
index b497982795a7..000000000000
--- a/arch/arm/plat-samsung/dev-ide.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-ide.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CF-ATA device definition.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/platform_device.h>
16
17#include <mach/map.h>
18#include <plat/ata.h>
19#include <plat/devs.h>
20
21static struct resource s3c_cfcon_resource[] = {
22 [0] = {
23 .start = SAMSUNG_PA_CFCON,
24 .end = SAMSUNG_PA_CFCON + SZ_16K - 1,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_CFCON,
29 .end = IRQ_CFCON,
30 .flags = IORESOURCE_IRQ,
31 },
32};
33
34struct platform_device s3c_device_cfcon = {
35 .id = 0,
36 .num_resources = ARRAY_SIZE(s3c_cfcon_resource),
37 .resource = s3c_cfcon_resource,
38};
39
40void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
41{
42 s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
43 &s3c_device_cfcon);
44}
diff --git a/arch/arm/plat-samsung/dev-keypad.c b/arch/arm/plat-samsung/dev-keypad.c
deleted file mode 100644
index 677c2d731b65..000000000000
--- a/arch/arm/plat-samsung/dev-keypad.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * linux/arch/arm/plat-samsung/dev-keypad.c
3 *
4 * Copyright (C) 2010 Samsung Electronics Co.Ltd
5 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#include <linux/platform_device.h>
15#include <mach/irqs.h>
16#include <mach/map.h>
17#include <plat/cpu.h>
18#include <plat/devs.h>
19#include <plat/keypad.h>
20
21static struct resource samsung_keypad_resources[] = {
22 [0] = {
23 .start = SAMSUNG_PA_KEYPAD,
24 .end = SAMSUNG_PA_KEYPAD + 0x20 - 1,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_KEYPAD,
29 .end = IRQ_KEYPAD,
30 .flags = IORESOURCE_IRQ,
31 },
32};
33
34struct platform_device samsung_device_keypad = {
35 .name = "samsung-keypad",
36 .id = -1,
37 .num_resources = ARRAY_SIZE(samsung_keypad_resources),
38 .resource = samsung_keypad_resources,
39};
40
41void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
42{
43 struct samsung_keypad_platdata *npd;
44
45 npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
46 &samsung_device_keypad);
47
48 if (!npd->cfg_gpio)
49 npd->cfg_gpio = samsung_keypad_cfg_gpio;
50}
diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
deleted file mode 100644
index b8e30ec6ac26..000000000000
--- a/arch/arm/plat-samsung/dev-nand.c
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * S3C series device definition for nand device
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <linux/gfp.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12
13#include <linux/mtd/mtd.h>
14#include <linux/mtd/partitions.h>
15
16#include <mach/map.h>
17#include <plat/devs.h>
18#include <plat/nand.h>
19
20static struct resource s3c_nand_resource[] = {
21 [0] = {
22 .start = S3C_PA_NAND,
23 .end = S3C_PA_NAND + SZ_1M,
24 .flags = IORESOURCE_MEM,
25 }
26};
27
28struct platform_device s3c_device_nand = {
29 .name = "s3c2410-nand",
30 .id = -1,
31 .num_resources = ARRAY_SIZE(s3c_nand_resource),
32 .resource = s3c_nand_resource,
33};
34
35EXPORT_SYMBOL(s3c_device_nand);
36
37/**
38 * s3c_nand_copy_set() - copy nand set data
39 * @set: The new structure, directly copied from the old.
40 *
41 * Copy all the fields from the NAND set field from what is probably __initdata
42 * to new kernel memory. The code returns 0 if the copy happened correctly or
43 * an error code for the calling function to display.
44 *
45 * Note, we currently do not try and look to see if we've already copied the
46 * data in a previous set.
47 */
48static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
49{
50 void *ptr;
51 int size;
52
53 size = sizeof(struct mtd_partition) * set->nr_partitions;
54 if (size) {
55 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
56 set->partitions = ptr;
57
58 if (!ptr)
59 return -ENOMEM;
60 }
61
62 if (set->nr_map && set->nr_chips) {
63 size = sizeof(int) * set->nr_chips;
64 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
65 set->nr_map = ptr;
66
67 if (!ptr)
68 return -ENOMEM;
69 }
70
71 if (set->ecc_layout) {
72 ptr = kmemdup(set->ecc_layout,
73 sizeof(struct nand_ecclayout), GFP_KERNEL);
74 set->ecc_layout = ptr;
75
76 if (!ptr)
77 return -ENOMEM;
78 }
79
80 return 0;
81}
82
83void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
84{
85 struct s3c2410_platform_nand *npd;
86 int size;
87 int ret;
88
89 /* note, if we get a failure in allocation, we simply drop out of the
90 * function. If there is so little memory available at initialisation
91 * time then there is little chance the system is going to run.
92 */
93
94 npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
95 &s3c_device_nand);
96 if (!npd)
97 return;
98
99 /* now see if we need to copy any of the nand set data */
100
101 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
102 if (size) {
103 struct s3c2410_nand_set *from = npd->sets;
104 struct s3c2410_nand_set *to;
105 int i;
106
107 to = kmemdup(from, size, GFP_KERNEL);
108 npd->sets = to; /* set, even if we failed */
109
110 if (!to) {
111 printk(KERN_ERR "%s: no memory for sets\n", __func__);
112 return;
113 }
114
115 for (i = 0; i < npd->nr_sets; i++) {
116 ret = s3c_nand_copy_set(to);
117 if (ret) {
118 printk(KERN_ERR "%s: failed to copy set %d\n",
119 __func__, i);
120 return;
121 }
122 to++;
123 }
124 }
125}
diff --git a/arch/arm/plat-samsung/dev-onenand.c b/arch/arm/plat-samsung/dev-onenand.c
deleted file mode 100644
index f54ae71f0cd2..000000000000
--- a/arch/arm/plat-samsung/dev-onenand.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * linux/arch/arm/plat-samsung/dev-onenand.c
3 *
4 * Copyright (c) 2008-2010 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S3C64XX/S5PC100 series device definition for OneNAND devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16
17#include <mach/irqs.h>
18#include <mach/map.h>
19
20static struct resource s3c_onenand_resources[] = {
21 [0] = {
22 .start = S3C_PA_ONENAND,
23 .end = S3C_PA_ONENAND + 0x400 - 1,
24 .flags = IORESOURCE_MEM,
25 },
26 [1] = {
27 .start = S3C_PA_ONENAND_BUF,
28 .end = S3C_PA_ONENAND_BUF + S3C_SZ_ONENAND_BUF - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [2] = {
32 .start = IRQ_ONENAND,
33 .end = IRQ_ONENAND,
34 .flags = IORESOURCE_IRQ,
35 },
36};
37
38struct platform_device s3c_device_onenand = {
39 .name = "samsung-onenand",
40 .id = 0,
41 .num_resources = ARRAY_SIZE(s3c_onenand_resources),
42 .resource = s3c_onenand_resources,
43};
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
deleted file mode 100644
index dab47b0e1900..000000000000
--- a/arch/arm/plat-samsung/dev-pwm.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-pwm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2007 Ben Dooks
7 * Copyright (c) 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
9 *
10 * S3C series device definition for the PWM timer
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21
22#include <plat/devs.h>
23
24#define TIMER_RESOURCE_SIZE (1)
25
26#define TIMER_RESOURCE(_tmr, _irq) \
27 (struct resource [TIMER_RESOURCE_SIZE]) { \
28 [0] = { \
29 .start = _irq, \
30 .end = _irq, \
31 .flags = IORESOURCE_IRQ \
32 } \
33 }
34
35#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
36 .name = "s3c24xx-pwm", \
37 .id = _tmr_no, \
38 .num_resources = TIMER_RESOURCE_SIZE, \
39 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
40
41/*
42 * since we already have an static mapping for the timer,
43 * we do not bother setting any IO resource for the base.
44 */
45
46struct platform_device s3c_device_timer[] = {
47 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
48 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
49 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
50 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
51 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
52};
53EXPORT_SYMBOL(s3c_device_timer);
diff --git a/arch/arm/plat-samsung/dev-rtc.c b/arch/arm/plat-samsung/dev-rtc.c
deleted file mode 100644
index bf4e2267333c..000000000000
--- a/arch/arm/plat-samsung/dev-rtc.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-rtc.c
2 *
3 * Copyright 2009 by Maurus Cuelenaere <mcuelenaere@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/string.h>
12#include <linux/platform_device.h>
13
14#include <mach/irqs.h>
15#include <mach/map.h>
16
17#include <plat/devs.h>
18
19static struct resource s3c_rtc_resource[] = {
20 [0] = {
21 .start = S3C_PA_RTC,
22 .end = S3C_PA_RTC + 0xff,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_RTC_ALARM,
27 .end = IRQ_RTC_ALARM,
28 .flags = IORESOURCE_IRQ,
29 },
30 [2] = {
31 .start = IRQ_RTC_TIC,
32 .end = IRQ_RTC_TIC,
33 .flags = IORESOURCE_IRQ
34 }
35};
36
37struct platform_device s3c_device_rtc = {
38 .name = "s3c64xx-rtc",
39 .id = -1,
40 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
41 .resource = s3c_rtc_resource,
42};
43EXPORT_SYMBOL(s3c_device_rtc);
diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c
deleted file mode 100644
index 5f3d46a9bd88..000000000000
--- a/arch/arm/plat-samsung/dev-ts.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/* linux/arch/arm/mach-s3c64xx/dev-ts.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
6 *
7 * Adapted by Maurus Cuelenaere for s3c64xx
8 *
9 * S3C64XX series device definition for touchscreen device
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/string.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21#include <mach/map.h>
22
23#include <plat/devs.h>
24#include <plat/ts.h>
25
26static struct resource s3c_ts_resource[] = {
27 [0] = {
28 .start = SAMSUNG_PA_ADC,
29 .end = SAMSUNG_PA_ADC + SZ_256 - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_TC,
34 .end = IRQ_TC,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39struct platform_device s3c_device_ts = {
40 .name = "s3c64xx-ts",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_ts_resource),
43 .resource = s3c_ts_resource,
44};
45
46static struct s3c2410_ts_mach_info default_ts_data __initdata = {
47 .delay = 10000,
48 .presc = 49,
49 .oversampling_shift = 2,
50};
51
52void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
53{
54 if (!pd)
55 pd = &default_ts_data;
56
57 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
58 &s3c_device_ts);
59}
diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
deleted file mode 100644
index 33a844ab6917..000000000000
--- a/arch/arm/plat-samsung/dev-usb-hsotg.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-usb-hsotg.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB high-speed UDC/OtG block
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/dma-mapping.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/devs.h>
23
24static struct resource s3c_usb_hsotg_resources[] = {
25 [0] = {
26 .start = S3C_PA_USB_HSOTG,
27 .end = S3C_PA_USB_HSOTG + 0x10000 - 1,
28 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = IRQ_OTG,
32 .end = IRQ_OTG,
33 .flags = IORESOURCE_IRQ,
34 },
35};
36
37static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
38
39struct platform_device s3c_device_usb_hsotg = {
40 .name = "s3c-hsotg",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
43 .resource = s3c_usb_hsotg_resources,
44 .dev = {
45 .dma_mask = &s3c_hsotg_dmamask,
46 .coherent_dma_mask = DMA_BIT_MASK(32),
47 },
48};
diff --git a/arch/arm/plat-samsung/dev-usb.c b/arch/arm/plat-samsung/dev-usb.c
deleted file mode 100644
index 33fbaa967700..000000000000
--- a/arch/arm/plat-samsung/dev-usb.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-usb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB host
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/gfp.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/platform_device.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22#include <plat/devs.h>
23#include <plat/usb-control.h>
24
25static struct resource s3c_usb_resource[] = {
26 [0] = {
27 .start = S3C_PA_USBHOST,
28 .end = S3C_PA_USBHOST + 0x100 - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .start = IRQ_USBH,
33 .end = IRQ_USBH,
34 .flags = IORESOURCE_IRQ,
35 }
36};
37
38static u64 s3c_device_usb_dmamask = 0xffffffffUL;
39
40struct platform_device s3c_device_ohci = {
41 .name = "s3c2410-ohci",
42 .id = -1,
43 .num_resources = ARRAY_SIZE(s3c_usb_resource),
44 .resource = s3c_usb_resource,
45 .dev = {
46 .dma_mask = &s3c_device_usb_dmamask,
47 .coherent_dma_mask = 0xffffffffUL
48 }
49};
50
51EXPORT_SYMBOL(s3c_device_ohci);
52
53/**
54 * s3c_ohci_set_platdata - initialise OHCI device platform data
55 * @info: The platform data.
56 *
57 * This call copies the @info passed in and sets the device .platform_data
58 * field to that copy. The @info is copied so that the original can be marked
59 * __initdata.
60 */
61void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
62{
63 s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
64 &s3c_device_ohci);
65}
diff --git a/arch/arm/plat-samsung/dev-wdt.c b/arch/arm/plat-samsung/dev-wdt.c
deleted file mode 100644
index 019b5b8cf14c..000000000000
--- a/arch/arm/plat-samsung/dev-wdt.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/* linux/arch/arm/plat-samsung/dev-wdt.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C series device definition for the watchdog timer
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18
19#include <plat/devs.h>
20
21static struct resource s3c_wdt_resource[] = {
22 [0] = {
23 .start = S3C_PA_WDT,
24 .end = S3C_PA_WDT + SZ_1K,
25 .flags = IORESOURCE_MEM,
26 },
27 [1] = {
28 .start = IRQ_WDT,
29 .end = IRQ_WDT,
30 .flags = IORESOURCE_IRQ,
31 }
32};
33
34struct platform_device s3c_device_wdt = {
35 .name = "s3c2410-wdt",
36 .id = -1,
37 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
38 .resource = s3c_wdt_resource,
39};
40EXPORT_SYMBOL(s3c_device_wdt);
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
new file mode 100644
index 000000000000..4ca8b571f971
--- /dev/null
+++ b/arch/arm/plat-samsung/devs.c
@@ -0,0 +1,1463 @@
1/* linux/arch/arm/plat-samsung/devs.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Base SAMSUNG platform device definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/timer.h>
18#include <linux/init.h>
19#include <linux/serial_core.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/slab.h>
23#include <linux/string.h>
24#include <linux/dma-mapping.h>
25#include <linux/fb.h>
26#include <linux/gfp.h>
27#include <linux/mtd/mtd.h>
28#include <linux/mtd/onenand.h>
29#include <linux/mtd/partitions.h>
30#include <linux/mmc/host.h>
31#include <linux/ioport.h>
32
33#include <asm/irq.h>
34#include <asm/pmu.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37#include <asm/mach/irq.h>
38
39#include <mach/hardware.h>
40#include <mach/dma.h>
41#include <mach/irqs.h>
42#include <mach/map.h>
43
44#include <plat/cpu.h>
45#include <plat/devs.h>
46#include <plat/adc.h>
47#include <plat/ata.h>
48#include <plat/ehci.h>
49#include <plat/fb.h>
50#include <plat/fb-s3c2410.h>
51#include <plat/hwmon.h>
52#include <plat/iic.h>
53#include <plat/keypad.h>
54#include <plat/mci.h>
55#include <plat/nand.h>
56#include <plat/sdhci.h>
57#include <plat/ts.h>
58#include <plat/udc.h>
59#include <plat/usb-control.h>
60#include <plat/usb-phy.h>
61#include <plat/regs-iic.h>
62#include <plat/regs-serial.h>
63#include <plat/regs-spi.h>
64
65static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
66
67/* AC97 */
68#ifdef CONFIG_CPU_S3C2440
69static struct resource s3c_ac97_resource[] = {
70 [0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97),
71 [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97),
72 [2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT, "PCM out"),
73 [3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN, "PCM in"),
74 [4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN, "Mic in"),
75};
76
77struct platform_device s3c_device_ac97 = {
78 .name = "samsung-ac97",
79 .id = -1,
80 .num_resources = ARRAY_SIZE(s3c_ac97_resource),
81 .resource = s3c_ac97_resource,
82 .dev = {
83 .dma_mask = &samsung_device_dma_mask,
84 .coherent_dma_mask = DMA_BIT_MASK(32),
85 }
86};
87#endif /* CONFIG_CPU_S3C2440 */
88
89/* ADC */
90
91#ifdef CONFIG_PLAT_S3C24XX
92static struct resource s3c_adc_resource[] = {
93 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
94 [1] = DEFINE_RES_IRQ(IRQ_TC),
95 [2] = DEFINE_RES_IRQ(IRQ_ADC),
96};
97
98struct platform_device s3c_device_adc = {
99 .name = "s3c24xx-adc",
100 .id = -1,
101 .num_resources = ARRAY_SIZE(s3c_adc_resource),
102 .resource = s3c_adc_resource,
103};
104#endif /* CONFIG_PLAT_S3C24XX */
105
106#if defined(CONFIG_SAMSUNG_DEV_ADC)
107static struct resource s3c_adc_resource[] = {
108 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
109 [1] = DEFINE_RES_IRQ(IRQ_TC),
110 [2] = DEFINE_RES_IRQ(IRQ_ADC),
111};
112
113struct platform_device s3c_device_adc = {
114 .name = "samsung-adc",
115 .id = -1,
116 .num_resources = ARRAY_SIZE(s3c_adc_resource),
117 .resource = s3c_adc_resource,
118};
119#endif /* CONFIG_SAMSUNG_DEV_ADC */
120
121/* Camif Controller */
122
123#ifdef CONFIG_CPU_S3C2440
124static struct resource s3c_camif_resource[] = {
125 [0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF, S3C2440_SZ_CAMIF),
126 [1] = DEFINE_RES_IRQ(IRQ_CAM),
127};
128
129struct platform_device s3c_device_camif = {
130 .name = "s3c2440-camif",
131 .id = -1,
132 .num_resources = ARRAY_SIZE(s3c_camif_resource),
133 .resource = s3c_camif_resource,
134 .dev = {
135 .dma_mask = &samsung_device_dma_mask,
136 .coherent_dma_mask = DMA_BIT_MASK(32),
137 }
138};
139#endif /* CONFIG_CPU_S3C2440 */
140
141/* ASOC DMA */
142
143struct platform_device samsung_asoc_dma = {
144 .name = "samsung-audio",
145 .id = -1,
146 .dev = {
147 .dma_mask = &samsung_device_dma_mask,
148 .coherent_dma_mask = DMA_BIT_MASK(32),
149 }
150};
151
152struct platform_device samsung_asoc_idma = {
153 .name = "samsung-idma",
154 .id = -1,
155 .dev = {
156 .dma_mask = &samsung_device_dma_mask,
157 .coherent_dma_mask = DMA_BIT_MASK(32),
158 }
159};
160
161/* FB */
162
163#ifdef CONFIG_S3C_DEV_FB
164static struct resource s3c_fb_resource[] = {
165 [0] = DEFINE_RES_MEM(S3C_PA_FB, SZ_16K),
166 [1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC),
167 [2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO),
168 [3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM),
169};
170
171struct platform_device s3c_device_fb = {
172 .name = "s3c-fb",
173 .id = -1,
174 .num_resources = ARRAY_SIZE(s3c_fb_resource),
175 .resource = s3c_fb_resource,
176 .dev = {
177 .dma_mask = &samsung_device_dma_mask,
178 .coherent_dma_mask = DMA_BIT_MASK(32),
179 },
180};
181
182void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
183{
184 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
185 &s3c_device_fb);
186}
187#endif /* CONFIG_S3C_DEV_FB */
188
189/* FIMC */
190
191#ifdef CONFIG_S5P_DEV_FIMC0
192static struct resource s5p_fimc0_resource[] = {
193 [0] = DEFINE_RES_MEM(S5P_PA_FIMC0, SZ_4K),
194 [1] = DEFINE_RES_IRQ(IRQ_FIMC0),
195};
196
197struct platform_device s5p_device_fimc0 = {
198 .name = "s5p-fimc",
199 .id = 0,
200 .num_resources = ARRAY_SIZE(s5p_fimc0_resource),
201 .resource = s5p_fimc0_resource,
202 .dev = {
203 .dma_mask = &samsung_device_dma_mask,
204 .coherent_dma_mask = DMA_BIT_MASK(32),
205 },
206};
207
208struct platform_device s5p_device_fimc_md = {
209 .name = "s5p-fimc-md",
210 .id = -1,
211};
212#endif /* CONFIG_S5P_DEV_FIMC0 */
213
214#ifdef CONFIG_S5P_DEV_FIMC1
215static struct resource s5p_fimc1_resource[] = {
216 [0] = DEFINE_RES_MEM(S5P_PA_FIMC1, SZ_4K),
217 [1] = DEFINE_RES_IRQ(IRQ_FIMC1),
218};
219
220struct platform_device s5p_device_fimc1 = {
221 .name = "s5p-fimc",
222 .id = 1,
223 .num_resources = ARRAY_SIZE(s5p_fimc1_resource),
224 .resource = s5p_fimc1_resource,
225 .dev = {
226 .dma_mask = &samsung_device_dma_mask,
227 .coherent_dma_mask = DMA_BIT_MASK(32),
228 },
229};
230#endif /* CONFIG_S5P_DEV_FIMC1 */
231
232#ifdef CONFIG_S5P_DEV_FIMC2
233static struct resource s5p_fimc2_resource[] = {
234 [0] = DEFINE_RES_MEM(S5P_PA_FIMC2, SZ_4K),
235 [1] = DEFINE_RES_IRQ(IRQ_FIMC2),
236};
237
238struct platform_device s5p_device_fimc2 = {
239 .name = "s5p-fimc",
240 .id = 2,
241 .num_resources = ARRAY_SIZE(s5p_fimc2_resource),
242 .resource = s5p_fimc2_resource,
243 .dev = {
244 .dma_mask = &samsung_device_dma_mask,
245 .coherent_dma_mask = DMA_BIT_MASK(32),
246 },
247};
248#endif /* CONFIG_S5P_DEV_FIMC2 */
249
250#ifdef CONFIG_S5P_DEV_FIMC3
251static struct resource s5p_fimc3_resource[] = {
252 [0] = DEFINE_RES_MEM(S5P_PA_FIMC3, SZ_4K),
253 [1] = DEFINE_RES_IRQ(IRQ_FIMC3),
254};
255
256struct platform_device s5p_device_fimc3 = {
257 .name = "s5p-fimc",
258 .id = 3,
259 .num_resources = ARRAY_SIZE(s5p_fimc3_resource),
260 .resource = s5p_fimc3_resource,
261 .dev = {
262 .dma_mask = &samsung_device_dma_mask,
263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 },
265};
266#endif /* CONFIG_S5P_DEV_FIMC3 */
267
268/* FIMD0 */
269
270#ifdef CONFIG_S5P_DEV_FIMD0
271static struct resource s5p_fimd0_resource[] = {
272 [0] = DEFINE_RES_MEM(S5P_PA_FIMD0, SZ_32K),
273 [1] = DEFINE_RES_IRQ(IRQ_FIMD0_VSYNC),
274 [2] = DEFINE_RES_IRQ(IRQ_FIMD0_FIFO),
275 [3] = DEFINE_RES_IRQ(IRQ_FIMD0_SYSTEM),
276};
277
278struct platform_device s5p_device_fimd0 = {
279 .name = "s5p-fb",
280 .id = 0,
281 .num_resources = ARRAY_SIZE(s5p_fimd0_resource),
282 .resource = s5p_fimd0_resource,
283 .dev = {
284 .dma_mask = &samsung_device_dma_mask,
285 .coherent_dma_mask = DMA_BIT_MASK(32),
286 },
287};
288
289void __init s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd)
290{
291 s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
292 &s5p_device_fimd0);
293}
294#endif /* CONFIG_S5P_DEV_FIMD0 */
295
296/* HWMON */
297
298#ifdef CONFIG_S3C_DEV_HWMON
299struct platform_device s3c_device_hwmon = {
300 .name = "s3c-hwmon",
301 .id = -1,
302 .dev.parent = &s3c_device_adc.dev,
303};
304
305void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
306{
307 s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
308 &s3c_device_hwmon);
309}
310#endif /* CONFIG_S3C_DEV_HWMON */
311
312/* HSMMC */
313
314#ifdef CONFIG_S3C_DEV_HSMMC
315static struct resource s3c_hsmmc_resource[] = {
316 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC0, SZ_4K),
317 [1] = DEFINE_RES_IRQ(IRQ_HSMMC0),
318};
319
320struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
321 .max_width = 4,
322 .host_caps = (MMC_CAP_4_BIT_DATA |
323 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
324 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
325};
326
327struct platform_device s3c_device_hsmmc0 = {
328 .name = "s3c-sdhci",
329 .id = 0,
330 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
331 .resource = s3c_hsmmc_resource,
332 .dev = {
333 .dma_mask = &samsung_device_dma_mask,
334 .coherent_dma_mask = DMA_BIT_MASK(32),
335 .platform_data = &s3c_hsmmc0_def_platdata,
336 },
337};
338
339void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
340{
341 s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
342}
343#endif /* CONFIG_S3C_DEV_HSMMC */
344
345#ifdef CONFIG_S3C_DEV_HSMMC1
346static struct resource s3c_hsmmc1_resource[] = {
347 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC1, SZ_4K),
348 [1] = DEFINE_RES_IRQ(IRQ_HSMMC1),
349};
350
351struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
352 .max_width = 4,
353 .host_caps = (MMC_CAP_4_BIT_DATA |
354 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
355 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
356};
357
358struct platform_device s3c_device_hsmmc1 = {
359 .name = "s3c-sdhci",
360 .id = 1,
361 .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
362 .resource = s3c_hsmmc1_resource,
363 .dev = {
364 .dma_mask = &samsung_device_dma_mask,
365 .coherent_dma_mask = DMA_BIT_MASK(32),
366 .platform_data = &s3c_hsmmc1_def_platdata,
367 },
368};
369
370void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
371{
372 s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
373}
374#endif /* CONFIG_S3C_DEV_HSMMC1 */
375
376/* HSMMC2 */
377
378#ifdef CONFIG_S3C_DEV_HSMMC2
379static struct resource s3c_hsmmc2_resource[] = {
380 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC2, SZ_4K),
381 [1] = DEFINE_RES_IRQ(IRQ_HSMMC2),
382};
383
384struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
385 .max_width = 4,
386 .host_caps = (MMC_CAP_4_BIT_DATA |
387 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
388 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
389};
390
391struct platform_device s3c_device_hsmmc2 = {
392 .name = "s3c-sdhci",
393 .id = 2,
394 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
395 .resource = s3c_hsmmc2_resource,
396 .dev = {
397 .dma_mask = &samsung_device_dma_mask,
398 .coherent_dma_mask = DMA_BIT_MASK(32),
399 .platform_data = &s3c_hsmmc2_def_platdata,
400 },
401};
402
403void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
404{
405 s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
406}
407#endif /* CONFIG_S3C_DEV_HSMMC2 */
408
409#ifdef CONFIG_S3C_DEV_HSMMC3
410static struct resource s3c_hsmmc3_resource[] = {
411 [0] = DEFINE_RES_MEM(S3C_PA_HSMMC3, SZ_4K),
412 [1] = DEFINE_RES_IRQ(IRQ_HSMMC3),
413};
414
415struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
416 .max_width = 4,
417 .host_caps = (MMC_CAP_4_BIT_DATA |
418 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
419 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
420};
421
422struct platform_device s3c_device_hsmmc3 = {
423 .name = "s3c-sdhci",
424 .id = 3,
425 .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
426 .resource = s3c_hsmmc3_resource,
427 .dev = {
428 .dma_mask = &samsung_device_dma_mask,
429 .coherent_dma_mask = DMA_BIT_MASK(32),
430 .platform_data = &s3c_hsmmc3_def_platdata,
431 },
432};
433
434void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
435{
436 s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
437}
438#endif /* CONFIG_S3C_DEV_HSMMC3 */
439
440/* I2C */
441
442static struct resource s3c_i2c0_resource[] = {
443 [0] = DEFINE_RES_MEM(S3C_PA_IIC, SZ_4K),
444 [1] = DEFINE_RES_IRQ(IRQ_IIC),
445};
446
447struct platform_device s3c_device_i2c0 = {
448 .name = "s3c2410-i2c",
449#ifdef CONFIG_S3C_DEV_I2C1
450 .id = 0,
451#else
452 .id = -1,
453#endif
454 .num_resources = ARRAY_SIZE(s3c_i2c0_resource),
455 .resource = s3c_i2c0_resource,
456};
457
458struct s3c2410_platform_i2c default_i2c_data __initdata = {
459 .flags = 0,
460 .slave_addr = 0x10,
461 .frequency = 100*1000,
462 .sda_delay = 100,
463};
464
465void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
466{
467 struct s3c2410_platform_i2c *npd;
468
469 if (!pd)
470 pd = &default_i2c_data;
471
472 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
473 &s3c_device_i2c0);
474
475 if (!npd->cfg_gpio)
476 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
477}
478
479#ifdef CONFIG_S3C_DEV_I2C1
480static struct resource s3c_i2c1_resource[] = {
481 [0] = DEFINE_RES_MEM(S3C_PA_IIC1, SZ_4K),
482 [1] = DEFINE_RES_IRQ(IRQ_IIC1),
483};
484
485struct platform_device s3c_device_i2c1 = {
486 .name = "s3c2410-i2c",
487 .id = 1,
488 .num_resources = ARRAY_SIZE(s3c_i2c1_resource),
489 .resource = s3c_i2c1_resource,
490};
491
492void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
493{
494 struct s3c2410_platform_i2c *npd;
495
496 if (!pd) {
497 pd = &default_i2c_data;
498 pd->bus_num = 1;
499 }
500
501 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
502 &s3c_device_i2c1);
503
504 if (!npd->cfg_gpio)
505 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
506}
507#endif /* CONFIG_S3C_DEV_I2C1 */
508
509#ifdef CONFIG_S3C_DEV_I2C2
510static struct resource s3c_i2c2_resource[] = {
511 [0] = DEFINE_RES_MEM(S3C_PA_IIC2, SZ_4K),
512 [1] = DEFINE_RES_IRQ(IRQ_IIC2),
513};
514
515struct platform_device s3c_device_i2c2 = {
516 .name = "s3c2410-i2c",
517 .id = 2,
518 .num_resources = ARRAY_SIZE(s3c_i2c2_resource),
519 .resource = s3c_i2c2_resource,
520};
521
522void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
523{
524 struct s3c2410_platform_i2c *npd;
525
526 if (!pd) {
527 pd = &default_i2c_data;
528 pd->bus_num = 2;
529 }
530
531 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
532 &s3c_device_i2c2);
533
534 if (!npd->cfg_gpio)
535 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
536}
537#endif /* CONFIG_S3C_DEV_I2C2 */
538
539#ifdef CONFIG_S3C_DEV_I2C3
540static struct resource s3c_i2c3_resource[] = {
541 [0] = DEFINE_RES_MEM(S3C_PA_IIC3, SZ_4K),
542 [1] = DEFINE_RES_IRQ(IRQ_IIC3),
543};
544
545struct platform_device s3c_device_i2c3 = {
546 .name = "s3c2440-i2c",
547 .id = 3,
548 .num_resources = ARRAY_SIZE(s3c_i2c3_resource),
549 .resource = s3c_i2c3_resource,
550};
551
552void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
553{
554 struct s3c2410_platform_i2c *npd;
555
556 if (!pd) {
557 pd = &default_i2c_data;
558 pd->bus_num = 3;
559 }
560
561 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
562 &s3c_device_i2c3);
563
564 if (!npd->cfg_gpio)
565 npd->cfg_gpio = s3c_i2c3_cfg_gpio;
566}
567#endif /*CONFIG_S3C_DEV_I2C3 */
568
569#ifdef CONFIG_S3C_DEV_I2C4
570static struct resource s3c_i2c4_resource[] = {
571 [0] = DEFINE_RES_MEM(S3C_PA_IIC4, SZ_4K),
572 [1] = DEFINE_RES_IRQ(IRQ_IIC4),
573};
574
575struct platform_device s3c_device_i2c4 = {
576 .name = "s3c2440-i2c",
577 .id = 4,
578 .num_resources = ARRAY_SIZE(s3c_i2c4_resource),
579 .resource = s3c_i2c4_resource,
580};
581
582void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
583{
584 struct s3c2410_platform_i2c *npd;
585
586 if (!pd) {
587 pd = &default_i2c_data;
588 pd->bus_num = 4;
589 }
590
591 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
592 &s3c_device_i2c4);
593
594 if (!npd->cfg_gpio)
595 npd->cfg_gpio = s3c_i2c4_cfg_gpio;
596}
597#endif /*CONFIG_S3C_DEV_I2C4 */
598
599#ifdef CONFIG_S3C_DEV_I2C5
600static struct resource s3c_i2c5_resource[] = {
601 [0] = DEFINE_RES_MEM(S3C_PA_IIC5, SZ_4K),
602 [1] = DEFINE_RES_IRQ(IRQ_IIC5),
603};
604
605struct platform_device s3c_device_i2c5 = {
606 .name = "s3c2440-i2c",
607 .id = 5,
608 .num_resources = ARRAY_SIZE(s3c_i2c5_resource),
609 .resource = s3c_i2c5_resource,
610};
611
612void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
613{
614 struct s3c2410_platform_i2c *npd;
615
616 if (!pd) {
617 pd = &default_i2c_data;
618 pd->bus_num = 5;
619 }
620
621 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
622 &s3c_device_i2c5);
623
624 if (!npd->cfg_gpio)
625 npd->cfg_gpio = s3c_i2c5_cfg_gpio;
626}
627#endif /*CONFIG_S3C_DEV_I2C5 */
628
629#ifdef CONFIG_S3C_DEV_I2C6
630static struct resource s3c_i2c6_resource[] = {
631 [0] = DEFINE_RES_MEM(S3C_PA_IIC6, SZ_4K),
632 [1] = DEFINE_RES_IRQ(IRQ_IIC6),
633};
634
635struct platform_device s3c_device_i2c6 = {
636 .name = "s3c2440-i2c",
637 .id = 6,
638 .num_resources = ARRAY_SIZE(s3c_i2c6_resource),
639 .resource = s3c_i2c6_resource,
640};
641
642void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
643{
644 struct s3c2410_platform_i2c *npd;
645
646 if (!pd) {
647 pd = &default_i2c_data;
648 pd->bus_num = 6;
649 }
650
651 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
652 &s3c_device_i2c6);
653
654 if (!npd->cfg_gpio)
655 npd->cfg_gpio = s3c_i2c6_cfg_gpio;
656}
657#endif /* CONFIG_S3C_DEV_I2C6 */
658
659#ifdef CONFIG_S3C_DEV_I2C7
660static struct resource s3c_i2c7_resource[] = {
661 [0] = DEFINE_RES_MEM(S3C_PA_IIC7, SZ_4K),
662 [1] = DEFINE_RES_IRQ(IRQ_IIC7),
663};
664
665struct platform_device s3c_device_i2c7 = {
666 .name = "s3c2440-i2c",
667 .id = 7,
668 .num_resources = ARRAY_SIZE(s3c_i2c7_resource),
669 .resource = s3c_i2c7_resource,
670};
671
672void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
673{
674 struct s3c2410_platform_i2c *npd;
675
676 if (!pd) {
677 pd = &default_i2c_data;
678 pd->bus_num = 7;
679 }
680
681 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
682 &s3c_device_i2c7);
683
684 if (!npd->cfg_gpio)
685 npd->cfg_gpio = s3c_i2c7_cfg_gpio;
686}
687#endif /* CONFIG_S3C_DEV_I2C7 */
688
689/* I2C HDMIPHY */
690
691#ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
692static struct resource s5p_i2c_resource[] = {
693 [0] = DEFINE_RES_MEM(S5P_PA_IIC_HDMIPHY, SZ_4K),
694 [1] = DEFINE_RES_IRQ(IRQ_IIC_HDMIPHY),
695};
696
697struct platform_device s5p_device_i2c_hdmiphy = {
698 .name = "s3c2440-hdmiphy-i2c",
699 .id = -1,
700 .num_resources = ARRAY_SIZE(s5p_i2c_resource),
701 .resource = s5p_i2c_resource,
702};
703
704void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
705{
706 struct s3c2410_platform_i2c *npd;
707
708 if (!pd) {
709 pd = &default_i2c_data;
710
711 if (soc_is_exynos4210())
712 pd->bus_num = 8;
713 else if (soc_is_s5pv210())
714 pd->bus_num = 3;
715 else
716 pd->bus_num = 0;
717 }
718
719 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
720 &s5p_device_i2c_hdmiphy);
721}
722#endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
723
724/* I2S */
725
726#ifdef CONFIG_PLAT_S3C24XX
727static struct resource s3c_iis_resource[] = {
728 [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
729};
730
731struct platform_device s3c_device_iis = {
732 .name = "s3c24xx-iis",
733 .id = -1,
734 .num_resources = ARRAY_SIZE(s3c_iis_resource),
735 .resource = s3c_iis_resource,
736 .dev = {
737 .dma_mask = &samsung_device_dma_mask,
738 .coherent_dma_mask = DMA_BIT_MASK(32),
739 }
740};
741#endif /* CONFIG_PLAT_S3C24XX */
742
743#ifdef CONFIG_CPU_S3C2440
744struct platform_device s3c2412_device_iis = {
745 .name = "s3c2412-iis",
746 .id = -1,
747 .dev = {
748 .dma_mask = &samsung_device_dma_mask,
749 .coherent_dma_mask = DMA_BIT_MASK(32),
750 }
751};
752#endif /* CONFIG_CPU_S3C2440 */
753
754/* IDE CFCON */
755
756#ifdef CONFIG_SAMSUNG_DEV_IDE
757static struct resource s3c_cfcon_resource[] = {
758 [0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON, SZ_16K),
759 [1] = DEFINE_RES_IRQ(IRQ_CFCON),
760};
761
762struct platform_device s3c_device_cfcon = {
763 .id = 0,
764 .num_resources = ARRAY_SIZE(s3c_cfcon_resource),
765 .resource = s3c_cfcon_resource,
766};
767
768void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
769{
770 s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
771 &s3c_device_cfcon);
772}
773#endif /* CONFIG_SAMSUNG_DEV_IDE */
774
775/* KEYPAD */
776
777#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
778static struct resource samsung_keypad_resources[] = {
779 [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD, SZ_32),
780 [1] = DEFINE_RES_IRQ(IRQ_KEYPAD),
781};
782
783struct platform_device samsung_device_keypad = {
784 .name = "samsung-keypad",
785 .id = -1,
786 .num_resources = ARRAY_SIZE(samsung_keypad_resources),
787 .resource = samsung_keypad_resources,
788};
789
790void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
791{
792 struct samsung_keypad_platdata *npd;
793
794 npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
795 &samsung_device_keypad);
796
797 if (!npd->cfg_gpio)
798 npd->cfg_gpio = samsung_keypad_cfg_gpio;
799}
800#endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
801
802/* LCD Controller */
803
804#ifdef CONFIG_PLAT_S3C24XX
805static struct resource s3c_lcd_resource[] = {
806 [0] = DEFINE_RES_MEM(S3C24XX_PA_LCD, S3C24XX_SZ_LCD),
807 [1] = DEFINE_RES_IRQ(IRQ_LCD),
808};
809
810struct platform_device s3c_device_lcd = {
811 .name = "s3c2410-lcd",
812 .id = -1,
813 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
814 .resource = s3c_lcd_resource,
815 .dev = {
816 .dma_mask = &samsung_device_dma_mask,
817 .coherent_dma_mask = DMA_BIT_MASK(32),
818 }
819};
820
821void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
822{
823 struct s3c2410fb_mach_info *npd;
824
825 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
826 if (npd) {
827 npd->displays = kmemdup(pd->displays,
828 sizeof(struct s3c2410fb_display) * npd->num_displays,
829 GFP_KERNEL);
830 if (!npd->displays)
831 printk(KERN_ERR "no memory for LCD display data\n");
832 } else {
833 printk(KERN_ERR "no memory for LCD platform data\n");
834 }
835}
836#endif /* CONFIG_PLAT_S3C24XX */
837
838/* MFC */
839
840#ifdef CONFIG_S5P_DEV_MFC
841static struct resource s5p_mfc_resource[] = {
842 [0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K),
843 [1] = DEFINE_RES_IRQ(IRQ_MFC),
844};
845
846struct platform_device s5p_device_mfc = {
847 .name = "s5p-mfc",
848 .id = -1,
849 .num_resources = ARRAY_SIZE(s5p_mfc_resource),
850 .resource = s5p_mfc_resource,
851};
852
853/*
854 * MFC hardware has 2 memory interfaces which are modelled as two separate
855 * platform devices to let dma-mapping distinguish between them.
856 *
857 * MFC parent device (s5p_device_mfc) must be registered before memory
858 * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
859 */
860
861struct platform_device s5p_device_mfc_l = {
862 .name = "s5p-mfc-l",
863 .id = -1,
864 .dev = {
865 .parent = &s5p_device_mfc.dev,
866 .dma_mask = &samsung_device_dma_mask,
867 .coherent_dma_mask = DMA_BIT_MASK(32),
868 },
869};
870
871struct platform_device s5p_device_mfc_r = {
872 .name = "s5p-mfc-r",
873 .id = -1,
874 .dev = {
875 .parent = &s5p_device_mfc.dev,
876 .dma_mask = &samsung_device_dma_mask,
877 .coherent_dma_mask = DMA_BIT_MASK(32),
878 },
879};
880#endif /* CONFIG_S5P_DEV_MFC */
881
882/* MIPI CSIS */
883
884#ifdef CONFIG_S5P_DEV_CSIS0
885static struct resource s5p_mipi_csis0_resource[] = {
886 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS0, SZ_4K),
887 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS0),
888};
889
890struct platform_device s5p_device_mipi_csis0 = {
891 .name = "s5p-mipi-csis",
892 .id = 0,
893 .num_resources = ARRAY_SIZE(s5p_mipi_csis0_resource),
894 .resource = s5p_mipi_csis0_resource,
895};
896#endif /* CONFIG_S5P_DEV_CSIS0 */
897
898#ifdef CONFIG_S5P_DEV_CSIS1
899static struct resource s5p_mipi_csis1_resource[] = {
900 [0] = DEFINE_RES_MEM(S5P_PA_MIPI_CSIS1, SZ_4K),
901 [1] = DEFINE_RES_IRQ(IRQ_MIPI_CSIS1),
902};
903
904struct platform_device s5p_device_mipi_csis1 = {
905 .name = "s5p-mipi-csis",
906 .id = 1,
907 .num_resources = ARRAY_SIZE(s5p_mipi_csis1_resource),
908 .resource = s5p_mipi_csis1_resource,
909};
910#endif
911
912/* NAND */
913
914#ifdef CONFIG_S3C_DEV_NAND
915static struct resource s3c_nand_resource[] = {
916 [0] = DEFINE_RES_MEM(S3C_PA_NAND, SZ_1M),
917};
918
919struct platform_device s3c_device_nand = {
920 .name = "s3c2410-nand",
921 .id = -1,
922 .num_resources = ARRAY_SIZE(s3c_nand_resource),
923 .resource = s3c_nand_resource,
924};
925
926/*
927 * s3c_nand_copy_set() - copy nand set data
928 * @set: The new structure, directly copied from the old.
929 *
930 * Copy all the fields from the NAND set field from what is probably __initdata
931 * to new kernel memory. The code returns 0 if the copy happened correctly or
932 * an error code for the calling function to display.
933 *
934 * Note, we currently do not try and look to see if we've already copied the
935 * data in a previous set.
936 */
937static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
938{
939 void *ptr;
940 int size;
941
942 size = sizeof(struct mtd_partition) * set->nr_partitions;
943 if (size) {
944 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
945 set->partitions = ptr;
946
947 if (!ptr)
948 return -ENOMEM;
949 }
950
951 if (set->nr_map && set->nr_chips) {
952 size = sizeof(int) * set->nr_chips;
953 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
954 set->nr_map = ptr;
955
956 if (!ptr)
957 return -ENOMEM;
958 }
959
960 if (set->ecc_layout) {
961 ptr = kmemdup(set->ecc_layout,
962 sizeof(struct nand_ecclayout), GFP_KERNEL);
963 set->ecc_layout = ptr;
964
965 if (!ptr)
966 return -ENOMEM;
967 }
968
969 return 0;
970}
971
972void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
973{
974 struct s3c2410_platform_nand *npd;
975 int size;
976 int ret;
977
978 /* note, if we get a failure in allocation, we simply drop out of the
979 * function. If there is so little memory available at initialisation
980 * time then there is little chance the system is going to run.
981 */
982
983 npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
984 &s3c_device_nand);
985 if (!npd)
986 return;
987
988 /* now see if we need to copy any of the nand set data */
989
990 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
991 if (size) {
992 struct s3c2410_nand_set *from = npd->sets;
993 struct s3c2410_nand_set *to;
994 int i;
995
996 to = kmemdup(from, size, GFP_KERNEL);
997 npd->sets = to; /* set, even if we failed */
998
999 if (!to) {
1000 printk(KERN_ERR "%s: no memory for sets\n", __func__);
1001 return;
1002 }
1003
1004 for (i = 0; i < npd->nr_sets; i++) {
1005 ret = s3c_nand_copy_set(to);
1006 if (ret) {
1007 printk(KERN_ERR "%s: failed to copy set %d\n",
1008 __func__, i);
1009 return;
1010 }
1011 to++;
1012 }
1013 }
1014}
1015#endif /* CONFIG_S3C_DEV_NAND */
1016
1017/* ONENAND */
1018
1019#ifdef CONFIG_S3C_DEV_ONENAND
1020static struct resource s3c_onenand_resources[] = {
1021 [0] = DEFINE_RES_MEM(S3C_PA_ONENAND, SZ_1K),
1022 [1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF, S3C_SZ_ONENAND_BUF),
1023 [2] = DEFINE_RES_IRQ(IRQ_ONENAND),
1024};
1025
1026struct platform_device s3c_device_onenand = {
1027 .name = "samsung-onenand",
1028 .id = 0,
1029 .num_resources = ARRAY_SIZE(s3c_onenand_resources),
1030 .resource = s3c_onenand_resources,
1031};
1032#endif /* CONFIG_S3C_DEV_ONENAND */
1033
1034#ifdef CONFIG_S3C64XX_DEV_ONENAND1
1035static struct resource s3c64xx_onenand1_resources[] = {
1036 [0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1, SZ_1K),
1037 [1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF, S3C64XX_SZ_ONENAND1_BUF),
1038 [2] = DEFINE_RES_IRQ(IRQ_ONENAND1),
1039};
1040
1041struct platform_device s3c64xx_device_onenand1 = {
1042 .name = "samsung-onenand",
1043 .id = 1,
1044 .num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources),
1045 .resource = s3c64xx_onenand1_resources,
1046};
1047
1048void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
1049{
1050 s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
1051 &s3c64xx_device_onenand1);
1052}
1053#endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
1054
1055#ifdef CONFIG_S5P_DEV_ONENAND
1056static struct resource s5p_onenand_resources[] = {
1057 [0] = DEFINE_RES_MEM(S5P_PA_ONENAND, SZ_128K),
1058 [1] = DEFINE_RES_MEM(S5P_PA_ONENAND_DMA, SZ_8K),
1059 [2] = DEFINE_RES_IRQ(IRQ_ONENAND_AUDI),
1060};
1061
1062struct platform_device s5p_device_onenand = {
1063 .name = "s5pc110-onenand",
1064 .id = -1,
1065 .num_resources = ARRAY_SIZE(s5p_onenand_resources),
1066 .resource = s5p_onenand_resources,
1067};
1068#endif /* CONFIG_S5P_DEV_ONENAND */
1069
1070/* PMU */
1071
1072#ifdef CONFIG_PLAT_S5P
1073static struct resource s5p_pmu_resource[] = {
1074 DEFINE_RES_IRQ(IRQ_PMU)
1075};
1076
1077struct platform_device s5p_device_pmu = {
1078 .name = "arm-pmu",
1079 .id = ARM_PMU_DEVICE_CPU,
1080 .num_resources = ARRAY_SIZE(s5p_pmu_resource),
1081 .resource = s5p_pmu_resource,
1082};
1083
1084static int __init s5p_pmu_init(void)
1085{
1086 platform_device_register(&s5p_device_pmu);
1087 return 0;
1088}
1089arch_initcall(s5p_pmu_init);
1090#endif /* CONFIG_PLAT_S5P */
1091
1092/* PWM Timer */
1093
1094#ifdef CONFIG_SAMSUNG_DEV_PWM
1095
1096#define TIMER_RESOURCE_SIZE (1)
1097
1098#define TIMER_RESOURCE(_tmr, _irq) \
1099 (struct resource [TIMER_RESOURCE_SIZE]) { \
1100 [0] = { \
1101 .start = _irq, \
1102 .end = _irq, \
1103 .flags = IORESOURCE_IRQ \
1104 } \
1105 }
1106
1107#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
1108 .name = "s3c24xx-pwm", \
1109 .id = _tmr_no, \
1110 .num_resources = TIMER_RESOURCE_SIZE, \
1111 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
1112
1113/*
1114 * since we already have an static mapping for the timer,
1115 * we do not bother setting any IO resource for the base.
1116 */
1117
1118struct platform_device s3c_device_timer[] = {
1119 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
1120 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
1121 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
1122 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
1123 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
1124};
1125#endif /* CONFIG_SAMSUNG_DEV_PWM */
1126
1127/* RTC */
1128
1129#ifdef CONFIG_PLAT_S3C24XX
1130static struct resource s3c_rtc_resource[] = {
1131 [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC, SZ_256),
1132 [1] = DEFINE_RES_IRQ(IRQ_RTC),
1133 [2] = DEFINE_RES_IRQ(IRQ_TICK),
1134};
1135
1136struct platform_device s3c_device_rtc = {
1137 .name = "s3c2410-rtc",
1138 .id = -1,
1139 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
1140 .resource = s3c_rtc_resource,
1141};
1142#endif /* CONFIG_PLAT_S3C24XX */
1143
1144#ifdef CONFIG_S3C_DEV_RTC
1145static struct resource s3c_rtc_resource[] = {
1146 [0] = DEFINE_RES_MEM(S3C_PA_RTC, SZ_256),
1147 [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM),
1148 [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC),
1149};
1150
1151struct platform_device s3c_device_rtc = {
1152 .name = "s3c64xx-rtc",
1153 .id = -1,
1154 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
1155 .resource = s3c_rtc_resource,
1156};
1157#endif /* CONFIG_S3C_DEV_RTC */
1158
1159/* SDI */
1160
1161#ifdef CONFIG_PLAT_S3C24XX
1162static struct resource s3c_sdi_resource[] = {
1163 [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI, S3C24XX_SZ_SDI),
1164 [1] = DEFINE_RES_IRQ(IRQ_SDI),
1165};
1166
1167struct platform_device s3c_device_sdi = {
1168 .name = "s3c2410-sdi",
1169 .id = -1,
1170 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
1171 .resource = s3c_sdi_resource,
1172};
1173
1174void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
1175{
1176 s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
1177 &s3c_device_sdi);
1178}
1179#endif /* CONFIG_PLAT_S3C24XX */
1180
1181/* SPI */
1182
1183#ifdef CONFIG_PLAT_S3C24XX
1184static struct resource s3c_spi0_resource[] = {
1185 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI, SZ_32),
1186 [1] = DEFINE_RES_IRQ(IRQ_SPI0),
1187};
1188
1189struct platform_device s3c_device_spi0 = {
1190 .name = "s3c2410-spi",
1191 .id = 0,
1192 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
1193 .resource = s3c_spi0_resource,
1194 .dev = {
1195 .dma_mask = &samsung_device_dma_mask,
1196 .coherent_dma_mask = DMA_BIT_MASK(32),
1197 }
1198};
1199
1200static struct resource s3c_spi1_resource[] = {
1201 [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1, SZ_32),
1202 [1] = DEFINE_RES_IRQ(IRQ_SPI1),
1203};
1204
1205struct platform_device s3c_device_spi1 = {
1206 .name = "s3c2410-spi",
1207 .id = 1,
1208 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
1209 .resource = s3c_spi1_resource,
1210 .dev = {
1211 .dma_mask = &samsung_device_dma_mask,
1212 .coherent_dma_mask = DMA_BIT_MASK(32),
1213 }
1214};
1215#endif /* CONFIG_PLAT_S3C24XX */
1216
1217/* Touchscreen */
1218
1219#ifdef CONFIG_PLAT_S3C24XX
1220static struct resource s3c_ts_resource[] = {
1221 [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
1222 [1] = DEFINE_RES_IRQ(IRQ_TC),
1223};
1224
1225struct platform_device s3c_device_ts = {
1226 .name = "s3c2410-ts",
1227 .id = -1,
1228 .dev.parent = &s3c_device_adc.dev,
1229 .num_resources = ARRAY_SIZE(s3c_ts_resource),
1230 .resource = s3c_ts_resource,
1231};
1232
1233void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
1234{
1235 s3c_set_platdata(hard_s3c2410ts_info,
1236 sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);
1237}
1238#endif /* CONFIG_PLAT_S3C24XX */
1239
1240#ifdef CONFIG_SAMSUNG_DEV_TS
1241static struct resource s3c_ts_resource[] = {
1242 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
1243 [1] = DEFINE_RES_IRQ(IRQ_TC),
1244};
1245
1246static struct s3c2410_ts_mach_info default_ts_data __initdata = {
1247 .delay = 10000,
1248 .presc = 49,
1249 .oversampling_shift = 2,
1250};
1251
1252struct platform_device s3c_device_ts = {
1253 .name = "s3c64xx-ts",
1254 .id = -1,
1255 .num_resources = ARRAY_SIZE(s3c_ts_resource),
1256 .resource = s3c_ts_resource,
1257};
1258
1259void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
1260{
1261 if (!pd)
1262 pd = &default_ts_data;
1263
1264 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
1265 &s3c_device_ts);
1266}
1267#endif /* CONFIG_SAMSUNG_DEV_TS */
1268
1269/* TV */
1270
1271#ifdef CONFIG_S5P_DEV_TV
1272
1273static struct resource s5p_hdmi_resources[] = {
1274 [0] = DEFINE_RES_MEM(S5P_PA_HDMI, SZ_1M),
1275 [1] = DEFINE_RES_IRQ(IRQ_HDMI),
1276};
1277
1278struct platform_device s5p_device_hdmi = {
1279 .name = "s5p-hdmi",
1280 .id = -1,
1281 .num_resources = ARRAY_SIZE(s5p_hdmi_resources),
1282 .resource = s5p_hdmi_resources,
1283};
1284
1285static struct resource s5p_sdo_resources[] = {
1286 [0] = DEFINE_RES_MEM(S5P_PA_SDO, SZ_64K),
1287 [1] = DEFINE_RES_IRQ(IRQ_SDO),
1288};
1289
1290struct platform_device s5p_device_sdo = {
1291 .name = "s5p-sdo",
1292 .id = -1,
1293 .num_resources = ARRAY_SIZE(s5p_sdo_resources),
1294 .resource = s5p_sdo_resources,
1295};
1296
1297static struct resource s5p_mixer_resources[] = {
1298 [0] = DEFINE_RES_MEM_NAMED(S5P_PA_MIXER, SZ_64K, "mxr"),
1299 [1] = DEFINE_RES_MEM_NAMED(S5P_PA_VP, SZ_64K, "vp"),
1300 [2] = DEFINE_RES_IRQ_NAMED(IRQ_MIXER, "irq"),
1301};
1302
1303struct platform_device s5p_device_mixer = {
1304 .name = "s5p-mixer",
1305 .id = -1,
1306 .num_resources = ARRAY_SIZE(s5p_mixer_resources),
1307 .resource = s5p_mixer_resources,
1308 .dev = {
1309 .dma_mask = &samsung_device_dma_mask,
1310 .coherent_dma_mask = DMA_BIT_MASK(32),
1311 }
1312};
1313#endif /* CONFIG_S5P_DEV_TV */
1314
1315/* USB */
1316
1317#ifdef CONFIG_S3C_DEV_USB_HOST
1318static struct resource s3c_usb_resource[] = {
1319 [0] = DEFINE_RES_MEM(S3C_PA_USBHOST, SZ_256),
1320 [1] = DEFINE_RES_IRQ(IRQ_USBH),
1321};
1322
1323struct platform_device s3c_device_ohci = {
1324 .name = "s3c2410-ohci",
1325 .id = -1,
1326 .num_resources = ARRAY_SIZE(s3c_usb_resource),
1327 .resource = s3c_usb_resource,
1328 .dev = {
1329 .dma_mask = &samsung_device_dma_mask,
1330 .coherent_dma_mask = DMA_BIT_MASK(32),
1331 }
1332};
1333
1334/*
1335 * s3c_ohci_set_platdata - initialise OHCI device platform data
1336 * @info: The platform data.
1337 *
1338 * This call copies the @info passed in and sets the device .platform_data
1339 * field to that copy. The @info is copied so that the original can be marked
1340 * __initdata.
1341 */
1342
1343void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
1344{
1345 s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
1346 &s3c_device_ohci);
1347}
1348#endif /* CONFIG_S3C_DEV_USB_HOST */
1349
1350/* USB Device (Gadget) */
1351
1352#ifdef CONFIG_PLAT_S3C24XX
1353static struct resource s3c_usbgadget_resource[] = {
1354 [0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV, S3C24XX_SZ_USBDEV),
1355 [1] = DEFINE_RES_IRQ(IRQ_USBD),
1356};
1357
1358struct platform_device s3c_device_usbgadget = {
1359 .name = "s3c2410-usbgadget",
1360 .id = -1,
1361 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
1362 .resource = s3c_usbgadget_resource,
1363};
1364
1365void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
1366{
1367 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
1368}
1369#endif /* CONFIG_PLAT_S3C24XX */
1370
1371/* USB EHCI Host Controller */
1372
1373#ifdef CONFIG_S5P_DEV_USB_EHCI
1374static struct resource s5p_ehci_resource[] = {
1375 [0] = DEFINE_RES_MEM(S5P_PA_EHCI, SZ_256),
1376 [1] = DEFINE_RES_IRQ(IRQ_USB_HOST),
1377};
1378
1379struct platform_device s5p_device_ehci = {
1380 .name = "s5p-ehci",
1381 .id = -1,
1382 .num_resources = ARRAY_SIZE(s5p_ehci_resource),
1383 .resource = s5p_ehci_resource,
1384 .dev = {
1385 .dma_mask = &samsung_device_dma_mask,
1386 .coherent_dma_mask = DMA_BIT_MASK(32),
1387 }
1388};
1389
1390void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
1391{
1392 struct s5p_ehci_platdata *npd;
1393
1394 npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
1395 &s5p_device_ehci);
1396
1397 if (!npd->phy_init)
1398 npd->phy_init = s5p_usb_phy_init;
1399 if (!npd->phy_exit)
1400 npd->phy_exit = s5p_usb_phy_exit;
1401}
1402#endif /* CONFIG_S5P_DEV_USB_EHCI */
1403
1404/* USB HSOTG */
1405
1406#ifdef CONFIG_S3C_DEV_USB_HSOTG
1407static struct resource s3c_usb_hsotg_resources[] = {
1408 [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG, SZ_16K),
1409 [1] = DEFINE_RES_IRQ(IRQ_OTG),
1410};
1411
1412struct platform_device s3c_device_usb_hsotg = {
1413 .name = "s3c-hsotg",
1414 .id = -1,
1415 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
1416 .resource = s3c_usb_hsotg_resources,
1417 .dev = {
1418 .dma_mask = &samsung_device_dma_mask,
1419 .coherent_dma_mask = DMA_BIT_MASK(32),
1420 },
1421};
1422#endif /* CONFIG_S3C_DEV_USB_HSOTG */
1423
1424/* USB High Spped 2.0 Device (Gadget) */
1425
1426#ifdef CONFIG_PLAT_S3C24XX
1427static struct resource s3c_hsudc_resource[] = {
1428 [0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC, S3C2416_SZ_HSUDC),
1429 [1] = DEFINE_RES_IRQ(IRQ_USBD),
1430};
1431
1432struct platform_device s3c_device_usb_hsudc = {
1433 .name = "s3c-hsudc",
1434 .id = -1,
1435 .num_resources = ARRAY_SIZE(s3c_hsudc_resource),
1436 .resource = s3c_hsudc_resource,
1437 .dev = {
1438 .dma_mask = &samsung_device_dma_mask,
1439 .coherent_dma_mask = DMA_BIT_MASK(32),
1440 },
1441};
1442
1443void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
1444{
1445 s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
1446}
1447#endif /* CONFIG_PLAT_S3C24XX */
1448
1449/* WDT */
1450
1451#ifdef CONFIG_S3C_DEV_WDT
1452static struct resource s3c_wdt_resource[] = {
1453 [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
1454 [1] = DEFINE_RES_IRQ(IRQ_WDT),
1455};
1456
1457struct platform_device s3c_device_wdt = {
1458 .name = "s3c2410-wdt",
1459 .id = -1,
1460 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
1461 .resource = s3c_wdt_resource,
1462};
1463#endif /* CONFIG_S3C_DEV_WDT */
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
deleted file mode 100644
index 1c0b0401594b..000000000000
--- a/arch/arm/plat-samsung/gpio-config.c
+++ /dev/null
@@ -1,431 +0,0 @@
1/* linux/arch/arm/plat-s3c/gpio-config.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008-2010 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C series GPIO configuration core
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/gpio.h>
18#include <linux/io.h>
19
20#include <plat/gpio-core.h>
21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-helpers.h>
23
24int s3c_gpio_cfgpin(unsigned int pin, unsigned int config)
25{
26 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
27 unsigned long flags;
28 int offset;
29 int ret;
30
31 if (!chip)
32 return -EINVAL;
33
34 offset = pin - chip->chip.base;
35
36 s3c_gpio_lock(chip, flags);
37 ret = s3c_gpio_do_setcfg(chip, offset, config);
38 s3c_gpio_unlock(chip, flags);
39
40 return ret;
41}
42EXPORT_SYMBOL(s3c_gpio_cfgpin);
43
44int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
45 unsigned int cfg)
46{
47 int ret;
48
49 for (; nr > 0; nr--, start++) {
50 ret = s3c_gpio_cfgpin(start, cfg);
51 if (ret != 0)
52 return ret;
53 }
54
55 return 0;
56}
57EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin_range);
58
59int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,
60 unsigned int cfg, s3c_gpio_pull_t pull)
61{
62 int ret;
63
64 for (; nr > 0; nr--, start++) {
65 s3c_gpio_setpull(start, pull);
66 ret = s3c_gpio_cfgpin(start, cfg);
67 if (ret != 0)
68 return ret;
69 }
70
71 return 0;
72}
73EXPORT_SYMBOL_GPL(s3c_gpio_cfgall_range);
74
75unsigned s3c_gpio_getcfg(unsigned int pin)
76{
77 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
78 unsigned long flags;
79 unsigned ret = 0;
80 int offset;
81
82 if (chip) {
83 offset = pin - chip->chip.base;
84
85 s3c_gpio_lock(chip, flags);
86 ret = s3c_gpio_do_getcfg(chip, offset);
87 s3c_gpio_unlock(chip, flags);
88 }
89
90 return ret;
91}
92EXPORT_SYMBOL(s3c_gpio_getcfg);
93
94
95int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull)
96{
97 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
98 unsigned long flags;
99 int offset, ret;
100
101 if (!chip)
102 return -EINVAL;
103
104 offset = pin - chip->chip.base;
105
106 s3c_gpio_lock(chip, flags);
107 ret = s3c_gpio_do_setpull(chip, offset, pull);
108 s3c_gpio_unlock(chip, flags);
109
110 return ret;
111}
112EXPORT_SYMBOL(s3c_gpio_setpull);
113
114s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
115{
116 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
117 unsigned long flags;
118 int offset;
119 u32 pup = 0;
120
121 if (chip) {
122 offset = pin - chip->chip.base;
123
124 s3c_gpio_lock(chip, flags);
125 pup = s3c_gpio_do_getpull(chip, offset);
126 s3c_gpio_unlock(chip, flags);
127 }
128
129 return (__force s3c_gpio_pull_t)pup;
130}
131EXPORT_SYMBOL(s3c_gpio_getpull);
132
133#ifdef CONFIG_S3C_GPIO_CFG_S3C24XX
134int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
135 unsigned int off, unsigned int cfg)
136{
137 void __iomem *reg = chip->base;
138 unsigned int shift = off;
139 u32 con;
140
141 if (s3c_gpio_is_cfg_special(cfg)) {
142 cfg &= 0xf;
143
144 /* Map output to 0, and SFN2 to 1 */
145 cfg -= 1;
146 if (cfg > 1)
147 return -EINVAL;
148
149 cfg <<= shift;
150 }
151
152 con = __raw_readl(reg);
153 con &= ~(0x1 << shift);
154 con |= cfg;
155 __raw_writel(con, reg);
156
157 return 0;
158}
159
160unsigned s3c_gpio_getcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
161 unsigned int off)
162{
163 u32 con;
164
165 con = __raw_readl(chip->base);
166 con >>= off;
167 con &= 1;
168 con++;
169
170 return S3C_GPIO_SFN(con);
171}
172
173int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip,
174 unsigned int off, unsigned int cfg)
175{
176 void __iomem *reg = chip->base;
177 unsigned int shift = off * 2;
178 u32 con;
179
180 if (s3c_gpio_is_cfg_special(cfg)) {
181 cfg &= 0xf;
182 if (cfg > 3)
183 return -EINVAL;
184
185 cfg <<= shift;
186 }
187
188 con = __raw_readl(reg);
189 con &= ~(0x3 << shift);
190 con |= cfg;
191 __raw_writel(con, reg);
192
193 return 0;
194}
195
196unsigned int s3c_gpio_getcfg_s3c24xx(struct s3c_gpio_chip *chip,
197 unsigned int off)
198{
199 u32 con;
200
201 con = __raw_readl(chip->base);
202 con >>= off * 2;
203 con &= 3;
204
205 /* this conversion works for IN and OUT as well as special mode */
206 return S3C_GPIO_SPECIAL(con);
207}
208#endif
209
210#ifdef CONFIG_S3C_GPIO_CFG_S3C64XX
211int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
212 unsigned int off, unsigned int cfg)
213{
214 void __iomem *reg = chip->base;
215 unsigned int shift = (off & 7) * 4;
216 u32 con;
217
218 if (off < 8 && chip->chip.ngpio > 8)
219 reg -= 4;
220
221 if (s3c_gpio_is_cfg_special(cfg)) {
222 cfg &= 0xf;
223 cfg <<= shift;
224 }
225
226 con = __raw_readl(reg);
227 con &= ~(0xf << shift);
228 con |= cfg;
229 __raw_writel(con, reg);
230
231 return 0;
232}
233
234unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
235 unsigned int off)
236{
237 void __iomem *reg = chip->base;
238 unsigned int shift = (off & 7) * 4;
239 u32 con;
240
241 if (off < 8 && chip->chip.ngpio > 8)
242 reg -= 4;
243
244 con = __raw_readl(reg);
245 con >>= shift;
246 con &= 0xf;
247
248 /* this conversion works for IN and OUT as well as special mode */
249 return S3C_GPIO_SPECIAL(con);
250}
251
252#endif /* CONFIG_S3C_GPIO_CFG_S3C64XX */
253
254#ifdef CONFIG_S3C_GPIO_PULL_UPDOWN
255int s3c_gpio_setpull_updown(struct s3c_gpio_chip *chip,
256 unsigned int off, s3c_gpio_pull_t pull)
257{
258 void __iomem *reg = chip->base + 0x08;
259 int shift = off * 2;
260 u32 pup;
261
262 pup = __raw_readl(reg);
263 pup &= ~(3 << shift);
264 pup |= pull << shift;
265 __raw_writel(pup, reg);
266
267 return 0;
268}
269
270s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip,
271 unsigned int off)
272{
273 void __iomem *reg = chip->base + 0x08;
274 int shift = off * 2;
275 u32 pup = __raw_readl(reg);
276
277 pup >>= shift;
278 pup &= 0x3;
279 return (__force s3c_gpio_pull_t)pup;
280}
281
282#ifdef CONFIG_S3C_GPIO_PULL_S3C2443
283int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
284 unsigned int off, s3c_gpio_pull_t pull)
285{
286 switch (pull) {
287 case S3C_GPIO_PULL_NONE:
288 pull = 0x01;
289 break;
290 case S3C_GPIO_PULL_UP:
291 pull = 0x00;
292 break;
293 case S3C_GPIO_PULL_DOWN:
294 pull = 0x02;
295 break;
296 }
297 return s3c_gpio_setpull_updown(chip, off, pull);
298}
299
300s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
301 unsigned int off)
302{
303 s3c_gpio_pull_t pull;
304
305 pull = s3c_gpio_getpull_updown(chip, off);
306
307 switch (pull) {
308 case 0x00:
309 pull = S3C_GPIO_PULL_UP;
310 break;
311 case 0x01:
312 case 0x03:
313 pull = S3C_GPIO_PULL_NONE;
314 break;
315 case 0x02:
316 pull = S3C_GPIO_PULL_DOWN;
317 break;
318 }
319
320 return pull;
321}
322#endif
323#endif
324
325#if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
326static int s3c_gpio_setpull_1(struct s3c_gpio_chip *chip,
327 unsigned int off, s3c_gpio_pull_t pull,
328 s3c_gpio_pull_t updown)
329{
330 void __iomem *reg = chip->base + 0x08;
331 u32 pup = __raw_readl(reg);
332
333 if (pull == updown)
334 pup &= ~(1 << off);
335 else if (pull == S3C_GPIO_PULL_NONE)
336 pup |= (1 << off);
337 else
338 return -EINVAL;
339
340 __raw_writel(pup, reg);
341 return 0;
342}
343
344static s3c_gpio_pull_t s3c_gpio_getpull_1(struct s3c_gpio_chip *chip,
345 unsigned int off, s3c_gpio_pull_t updown)
346{
347 void __iomem *reg = chip->base + 0x08;
348 u32 pup = __raw_readl(reg);
349
350 pup &= (1 << off);
351 return pup ? S3C_GPIO_PULL_NONE : updown;
352}
353#endif /* CONFIG_S3C_GPIO_PULL_UP || CONFIG_S3C_GPIO_PULL_DOWN */
354
355#ifdef CONFIG_S3C_GPIO_PULL_UP
356s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip,
357 unsigned int off)
358{
359 return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_UP);
360}
361
362int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip,
363 unsigned int off, s3c_gpio_pull_t pull)
364{
365 return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_UP);
366}
367#endif /* CONFIG_S3C_GPIO_PULL_UP */
368
369#ifdef CONFIG_S3C_GPIO_PULL_DOWN
370s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip,
371 unsigned int off)
372{
373 return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_DOWN);
374}
375
376int s3c_gpio_setpull_1down(struct s3c_gpio_chip *chip,
377 unsigned int off, s3c_gpio_pull_t pull)
378{
379 return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_DOWN);
380}
381#endif /* CONFIG_S3C_GPIO_PULL_DOWN */
382
383#ifdef CONFIG_S5P_GPIO_DRVSTR
384s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
385{
386 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
387 unsigned int off;
388 void __iomem *reg;
389 int shift;
390 u32 drvstr;
391
392 if (!chip)
393 return -EINVAL;
394
395 off = pin - chip->chip.base;
396 shift = off * 2;
397 reg = chip->base + 0x0C;
398
399 drvstr = __raw_readl(reg);
400 drvstr = drvstr >> shift;
401 drvstr &= 0x3;
402
403 return (__force s5p_gpio_drvstr_t)drvstr;
404}
405EXPORT_SYMBOL(s5p_gpio_get_drvstr);
406
407int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr)
408{
409 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
410 unsigned int off;
411 void __iomem *reg;
412 int shift;
413 u32 tmp;
414
415 if (!chip)
416 return -EINVAL;
417
418 off = pin - chip->chip.base;
419 shift = off * 2;
420 reg = chip->base + 0x0C;
421
422 tmp = __raw_readl(reg);
423 tmp &= ~(0x3 << shift);
424 tmp |= drvstr << shift;
425
426 __raw_writel(tmp, reg);
427
428 return 0;
429}
430EXPORT_SYMBOL(s5p_gpio_set_drvstr);
431#endif /* CONFIG_S5P_GPIO_DRVSTR */
diff --git a/arch/arm/plat-samsung/gpio.c b/arch/arm/plat-samsung/gpio.c
deleted file mode 100644
index 7743c4b8b2fb..000000000000
--- a/arch/arm/plat-samsung/gpio.c
+++ /dev/null
@@ -1,167 +0,0 @@
1/* linux/arch/arm/plat-s3c/gpio.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series GPIO core
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18#include <linux/spinlock.h>
19
20#include <plat/gpio-core.h>
21
22#ifdef CONFIG_S3C_GPIO_TRACK
23struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
24
25static __init void s3c_gpiolib_track(struct s3c_gpio_chip *chip)
26{
27 unsigned int gpn;
28 int i;
29
30 gpn = chip->chip.base;
31 for (i = 0; i < chip->chip.ngpio; i++, gpn++) {
32 BUG_ON(gpn >= ARRAY_SIZE(s3c_gpios));
33 s3c_gpios[gpn] = chip;
34 }
35}
36#endif /* CONFIG_S3C_GPIO_TRACK */
37
38/* Default routines for controlling GPIO, based on the original S3C24XX
39 * GPIO functions which deal with the case where each gpio bank of the
40 * chip is as following:
41 *
42 * base + 0x00: Control register, 2 bits per gpio
43 * gpio n: 2 bits starting at (2*n)
44 * 00 = input, 01 = output, others mean special-function
45 * base + 0x04: Data register, 1 bit per gpio
46 * bit n: data bit n
47*/
48
49static int s3c_gpiolib_input(struct gpio_chip *chip, unsigned offset)
50{
51 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
52 void __iomem *base = ourchip->base;
53 unsigned long flags;
54 unsigned long con;
55
56 s3c_gpio_lock(ourchip, flags);
57
58 con = __raw_readl(base + 0x00);
59 con &= ~(3 << (offset * 2));
60
61 __raw_writel(con, base + 0x00);
62
63 s3c_gpio_unlock(ourchip, flags);
64 return 0;
65}
66
67static int s3c_gpiolib_output(struct gpio_chip *chip,
68 unsigned offset, int value)
69{
70 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
71 void __iomem *base = ourchip->base;
72 unsigned long flags;
73 unsigned long dat;
74 unsigned long con;
75
76 s3c_gpio_lock(ourchip, flags);
77
78 dat = __raw_readl(base + 0x04);
79 dat &= ~(1 << offset);
80 if (value)
81 dat |= 1 << offset;
82 __raw_writel(dat, base + 0x04);
83
84 con = __raw_readl(base + 0x00);
85 con &= ~(3 << (offset * 2));
86 con |= 1 << (offset * 2);
87
88 __raw_writel(con, base + 0x00);
89 __raw_writel(dat, base + 0x04);
90
91 s3c_gpio_unlock(ourchip, flags);
92 return 0;
93}
94
95static void s3c_gpiolib_set(struct gpio_chip *chip,
96 unsigned offset, int value)
97{
98 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
99 void __iomem *base = ourchip->base;
100 unsigned long flags;
101 unsigned long dat;
102
103 s3c_gpio_lock(ourchip, flags);
104
105 dat = __raw_readl(base + 0x04);
106 dat &= ~(1 << offset);
107 if (value)
108 dat |= 1 << offset;
109 __raw_writel(dat, base + 0x04);
110
111 s3c_gpio_unlock(ourchip, flags);
112}
113
114static int s3c_gpiolib_get(struct gpio_chip *chip, unsigned offset)
115{
116 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
117 unsigned long val;
118
119 val = __raw_readl(ourchip->base + 0x04);
120 val >>= offset;
121 val &= 1;
122
123 return val;
124}
125
126__init void s3c_gpiolib_add(struct s3c_gpio_chip *chip)
127{
128 struct gpio_chip *gc = &chip->chip;
129 int ret;
130
131 BUG_ON(!chip->base);
132 BUG_ON(!gc->label);
133 BUG_ON(!gc->ngpio);
134
135 spin_lock_init(&chip->lock);
136
137 if (!gc->direction_input)
138 gc->direction_input = s3c_gpiolib_input;
139 if (!gc->direction_output)
140 gc->direction_output = s3c_gpiolib_output;
141 if (!gc->set)
142 gc->set = s3c_gpiolib_set;
143 if (!gc->get)
144 gc->get = s3c_gpiolib_get;
145
146#ifdef CONFIG_PM
147 if (chip->pm != NULL) {
148 if (!chip->pm->save || !chip->pm->resume)
149 printk(KERN_ERR "gpio: %s has missing PM functions\n",
150 gc->label);
151 } else
152 printk(KERN_ERR "gpio: %s has no PM function\n", gc->label);
153#endif
154
155 /* gpiochip_add() prints own failure message on error. */
156 ret = gpiochip_add(gc);
157 if (ret >= 0)
158 s3c_gpiolib_track(chip);
159}
160
161int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
162{
163 struct s3c_gpio_chip *s3c_chip = container_of(chip,
164 struct s3c_gpio_chip, chip);
165
166 return s3c_chip->irq_base + offset;
167}
diff --git a/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h b/arch/arm/plat-samsung/include/plat/audio-simtec.h
index de5e88fdcb31..5345364e7420 100644
--- a/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h
+++ b/arch/arm/plat-samsung/include/plat/audio-simtec.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c24xx/include/plat/audio-simtec.h 1/* arch/arm/plat-samsung/include/plat/audio-simtec.h
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s5p/include/plat/camport.h b/arch/arm/plat-samsung/include/plat/camport.h
index 71688c8ba288..a5708bf84b3a 100644
--- a/arch/arm/plat-s5p/include/plat/camport.h
+++ b/arch/arm/plat-samsung/include/plat/camport.h
@@ -8,8 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef PLAT_S5P_CAMPORT_H_ 11#ifndef __PLAT_SAMSUNG_CAMPORT_H_
12#define PLAT_S5P_CAMPORT_H_ __FILE__ 12#define __PLAT_SAMSUNG_CAMPORT_H_ __FILE__
13 13
14enum s5p_camport_id { 14enum s5p_camport_id {
15 S5P_CAMPORT_A, 15 S5P_CAMPORT_A,
@@ -25,4 +25,4 @@ enum s5p_camport_id {
25int s5pv210_fimc_setup_gpio(enum s5p_camport_id id); 25int s5pv210_fimc_setup_gpio(enum s5p_camport_id id);
26int exynos4_fimc_setup_gpio(enum s5p_camport_id id); 26int exynos4_fimc_setup_gpio(enum s5p_camport_id id);
27 27
28#endif 28#endif /* __PLAT_SAMSUNG_CAMPORT_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/common-smdk.h b/arch/arm/plat-samsung/include/plat/common-smdk.h
index 58d9094c935c..ba028f1ed30b 100644
--- a/arch/arm/plat-s3c24xx/include/plat/common-smdk.h
+++ b/arch/arm/plat-samsung/include/plat/common-smdk.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/common-smdk.h 1/* linux/arch/arm/plat-samsung/include/plat/common-smdk.h
2 * 2 *
3 * Copyright (c) 2006 Simtec Electronics 3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
index d623235ae961..dac4760c0f0a 100644
--- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-samsung/include/plat/cpu-freq-core.h
2 * 2 *
3 * Copyright (c) 2006-2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -195,7 +195,8 @@ struct s3c_cpufreq_info {
195 195
196extern int s3c_cpufreq_register(struct s3c_cpufreq_info *info); 196extern int s3c_cpufreq_register(struct s3c_cpufreq_info *info);
197 197
198extern int s3c_plltab_register(struct cpufreq_frequency_table *plls, unsigned int plls_no); 198extern int s3c_plltab_register(struct cpufreq_frequency_table *plls,
199 unsigned int plls_no);
199 200
200/* exports and utilities for debugfs */ 201/* exports and utilities for debugfs */
201extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); 202extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void);
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 24ebb1e1de41..ab633c9c2aec 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -30,30 +30,24 @@ extern struct s3c24xx_uart_resources s5p_uart_resources[];
30extern struct platform_device *s3c24xx_uart_devs[]; 30extern struct platform_device *s3c24xx_uart_devs[];
31extern struct platform_device *s3c24xx_uart_src[]; 31extern struct platform_device *s3c24xx_uart_src[];
32 32
33extern struct platform_device s3c_device_timer[]; 33extern struct platform_device s3c64xx_device_ac97;
34
35extern struct platform_device s3c64xx_device_iis0; 34extern struct platform_device s3c64xx_device_iis0;
36extern struct platform_device s3c64xx_device_iis1; 35extern struct platform_device s3c64xx_device_iis1;
37extern struct platform_device s3c64xx_device_iisv4; 36extern struct platform_device s3c64xx_device_iisv4;
38 37extern struct platform_device s3c64xx_device_onenand1;
39extern struct platform_device s3c64xx_device_spi0;
40extern struct platform_device s3c64xx_device_spi1;
41
42extern struct platform_device samsung_asoc_dma;
43extern struct platform_device samsung_asoc_idma;
44
45extern struct platform_device s3c64xx_device_pcm0; 38extern struct platform_device s3c64xx_device_pcm0;
46extern struct platform_device s3c64xx_device_pcm1; 39extern struct platform_device s3c64xx_device_pcm1;
40extern struct platform_device s3c64xx_device_spi0;
41extern struct platform_device s3c64xx_device_spi1;
47 42
48extern struct platform_device s3c64xx_device_ac97; 43extern struct platform_device s3c_device_adc;
49 44extern struct platform_device s3c_device_cfcon;
50extern struct platform_device s3c_device_ts;
51
52extern struct platform_device s3c_device_fb; 45extern struct platform_device s3c_device_fb;
53extern struct platform_device s5p_device_fimd0; 46extern struct platform_device s3c_device_hwmon;
54extern struct platform_device s3c_device_ohci; 47extern struct platform_device s3c_device_hsmmc0;
55extern struct platform_device s3c_device_lcd; 48extern struct platform_device s3c_device_hsmmc1;
56extern struct platform_device s3c_device_wdt; 49extern struct platform_device s3c_device_hsmmc2;
50extern struct platform_device s3c_device_hsmmc3;
57extern struct platform_device s3c_device_i2c0; 51extern struct platform_device s3c_device_i2c0;
58extern struct platform_device s3c_device_i2c1; 52extern struct platform_device s3c_device_i2c1;
59extern struct platform_device s3c_device_i2c2; 53extern struct platform_device s3c_device_i2c2;
@@ -62,93 +56,90 @@ extern struct platform_device s3c_device_i2c4;
62extern struct platform_device s3c_device_i2c5; 56extern struct platform_device s3c_device_i2c5;
63extern struct platform_device s3c_device_i2c6; 57extern struct platform_device s3c_device_i2c6;
64extern struct platform_device s3c_device_i2c7; 58extern struct platform_device s3c_device_i2c7;
59extern struct platform_device s3c_device_iis;
60extern struct platform_device s3c_device_lcd;
61extern struct platform_device s3c_device_nand;
62extern struct platform_device s3c_device_ohci;
63extern struct platform_device s3c_device_onenand;
65extern struct platform_device s3c_device_rtc; 64extern struct platform_device s3c_device_rtc;
66extern struct platform_device s3c_device_adc;
67extern struct platform_device s3c_device_sdi; 65extern struct platform_device s3c_device_sdi;
68extern struct platform_device s3c_device_iis;
69extern struct platform_device s3c_device_hwmon;
70extern struct platform_device s3c_device_hsmmc0;
71extern struct platform_device s3c_device_hsmmc1;
72extern struct platform_device s3c_device_hsmmc2;
73extern struct platform_device s3c_device_hsmmc3;
74extern struct platform_device s3c_device_cfcon;
75
76extern struct platform_device s3c_device_spi0; 66extern struct platform_device s3c_device_spi0;
77extern struct platform_device s3c_device_spi1; 67extern struct platform_device s3c_device_spi1;
78 68extern struct platform_device s3c_device_ts;
79extern struct platform_device s5pc100_device_spi0; 69extern struct platform_device s3c_device_timer[];
80extern struct platform_device s5pc100_device_spi1;
81extern struct platform_device s5pc100_device_spi2;
82extern struct platform_device s5pv210_device_spi0;
83extern struct platform_device s5pv210_device_spi1;
84extern struct platform_device s5p64x0_device_spi0;
85extern struct platform_device s5p64x0_device_spi1;
86
87extern struct platform_device s3c_device_hwmon;
88
89extern struct platform_device s3c_device_nand;
90extern struct platform_device s3c_device_onenand;
91extern struct platform_device s3c64xx_device_onenand1;
92extern struct platform_device s5p_device_onenand;
93
94extern struct platform_device s3c_device_usbgadget; 70extern struct platform_device s3c_device_usbgadget;
95extern struct platform_device s3c_device_usb_hsudc;
96extern struct platform_device s3c_device_usb_hsotg; 71extern struct platform_device s3c_device_usb_hsotg;
72extern struct platform_device s3c_device_usb_hsudc;
73extern struct platform_device s3c_device_wdt;
97 74
98extern struct platform_device s5pv210_device_ac97; 75extern struct platform_device s5p_device_ehci;
99extern struct platform_device s5pv210_device_pcm0; 76extern struct platform_device s5p_device_fimc0;
100extern struct platform_device s5pv210_device_pcm1; 77extern struct platform_device s5p_device_fimc1;
101extern struct platform_device s5pv210_device_pcm2; 78extern struct platform_device s5p_device_fimc2;
102extern struct platform_device s5pv210_device_iis0; 79extern struct platform_device s5p_device_fimc3;
103extern struct platform_device s5pv210_device_iis1; 80extern struct platform_device s5p_device_fimc_md;
104extern struct platform_device s5pv210_device_iis2; 81extern struct platform_device s5p_device_fimd0;
105extern struct platform_device s5pv210_device_spdif; 82extern struct platform_device s5p_device_hdmi;
106 83extern struct platform_device s5p_device_i2c_hdmiphy;
107extern struct platform_device exynos4_device_ac97; 84extern struct platform_device s5p_device_mfc;
108extern struct platform_device exynos4_device_pcm0; 85extern struct platform_device s5p_device_mfc_l;
109extern struct platform_device exynos4_device_pcm1; 86extern struct platform_device s5p_device_mfc_r;
110extern struct platform_device exynos4_device_pcm2; 87extern struct platform_device s5p_device_mipi_csis0;
111extern struct platform_device exynos4_device_i2s0; 88extern struct platform_device s5p_device_mipi_csis1;
112extern struct platform_device exynos4_device_i2s1; 89extern struct platform_device s5p_device_mixer;
113extern struct platform_device exynos4_device_i2s2; 90extern struct platform_device s5p_device_onenand;
114extern struct platform_device exynos4_device_spdif; 91extern struct platform_device s5p_device_sdo;
115extern struct platform_device exynos4_device_pd[];
116extern struct platform_device exynos4_device_ahci;
117extern struct platform_device exynos4_device_dwmci;
118 92
119extern struct platform_device s5p6440_device_pcm;
120extern struct platform_device s5p6440_device_iis; 93extern struct platform_device s5p6440_device_iis;
94extern struct platform_device s5p6440_device_pcm;
121 95
122extern struct platform_device s5p6450_device_iis0; 96extern struct platform_device s5p6450_device_iis0;
123extern struct platform_device s5p6450_device_iis1; 97extern struct platform_device s5p6450_device_iis1;
124extern struct platform_device s5p6450_device_iis2; 98extern struct platform_device s5p6450_device_iis2;
125extern struct platform_device s5p6450_device_pcm0; 99extern struct platform_device s5p6450_device_pcm0;
126 100
101extern struct platform_device s5p64x0_device_spi0;
102extern struct platform_device s5p64x0_device_spi1;
103
127extern struct platform_device s5pc100_device_ac97; 104extern struct platform_device s5pc100_device_ac97;
128extern struct platform_device s5pc100_device_pcm0;
129extern struct platform_device s5pc100_device_pcm1;
130extern struct platform_device s5pc100_device_iis0; 105extern struct platform_device s5pc100_device_iis0;
131extern struct platform_device s5pc100_device_iis1; 106extern struct platform_device s5pc100_device_iis1;
132extern struct platform_device s5pc100_device_iis2; 107extern struct platform_device s5pc100_device_iis2;
108extern struct platform_device s5pc100_device_pcm0;
109extern struct platform_device s5pc100_device_pcm1;
133extern struct platform_device s5pc100_device_spdif; 110extern struct platform_device s5pc100_device_spdif;
111extern struct platform_device s5pc100_device_spi0;
112extern struct platform_device s5pc100_device_spi1;
113extern struct platform_device s5pc100_device_spi2;
134 114
135extern struct platform_device samsung_device_keypad; 115extern struct platform_device s5pv210_device_ac97;
136 116extern struct platform_device s5pv210_device_iis0;
137extern struct platform_device s5p_device_fimc0; 117extern struct platform_device s5pv210_device_iis1;
138extern struct platform_device s5p_device_fimc1; 118extern struct platform_device s5pv210_device_iis2;
139extern struct platform_device s5p_device_fimc2; 119extern struct platform_device s5pv210_device_pcm0;
140extern struct platform_device s5p_device_fimc3; 120extern struct platform_device s5pv210_device_pcm1;
141 121extern struct platform_device s5pv210_device_pcm2;
142extern struct platform_device s5p_device_mfc; 122extern struct platform_device s5pv210_device_spdif;
143extern struct platform_device s5p_device_mfc_l; 123extern struct platform_device s5pv210_device_spi0;
144extern struct platform_device s5p_device_mfc_r; 124extern struct platform_device s5pv210_device_spi1;
145extern struct platform_device s5p_device_mipi_csis0;
146extern struct platform_device s5p_device_mipi_csis1;
147
148extern struct platform_device s5p_device_ehci;
149 125
126extern struct platform_device exynos4_device_ac97;
127extern struct platform_device exynos4_device_ahci;
128extern struct platform_device exynos4_device_dwmci;
129extern struct platform_device exynos4_device_i2s0;
130extern struct platform_device exynos4_device_i2s1;
131extern struct platform_device exynos4_device_i2s2;
132extern struct platform_device exynos4_device_pcm0;
133extern struct platform_device exynos4_device_pcm1;
134extern struct platform_device exynos4_device_pcm2;
135extern struct platform_device exynos4_device_pd[];
136extern struct platform_device exynos4_device_spdif;
150extern struct platform_device exynos4_device_sysmmu; 137extern struct platform_device exynos4_device_sysmmu;
151 138
139extern struct platform_device samsung_asoc_dma;
140extern struct platform_device samsung_asoc_idma;
141extern struct platform_device samsung_device_keypad;
142
152/* s3c2440 specific devices */ 143/* s3c2440 specific devices */
153 144
154#ifdef CONFIG_CPU_S3C2440 145#ifdef CONFIG_CPU_S3C2440
diff --git a/arch/arm/plat-s5p/include/plat/ehci.h b/arch/arm/plat-samsung/include/plat/ehci.h
index 6ae6810c7569..5f28cae18582 100644
--- a/arch/arm/plat-s5p/include/plat/ehci.h
+++ b/arch/arm/plat-samsung/include/plat/ehci.h
@@ -8,8 +8,8 @@
8 * option) any later version. 8 * option) any later version.
9 */ 9 */
10 10
11#ifndef __PLAT_S5P_EHCI_H 11#ifndef __PLAT_SAMSUNG_EHCI_H
12#define __PLAT_S5P_EHCI_H 12#define __PLAT_SAMSUNG_EHCI_H __FILE__
13 13
14struct s5p_ehci_platdata { 14struct s5p_ehci_platdata {
15 int (*phy_init)(struct platform_device *pdev, int type); 15 int (*phy_init)(struct platform_device *pdev, int type);
@@ -18,4 +18,4 @@ struct s5p_ehci_platdata {
18 18
19extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); 19extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
20 20
21#endif /* __PLAT_S5P_EHCI_H */ 21#endif /* __PLAT_SAMSUNG_EHCI_H */
diff --git a/arch/arm/plat-s5p/include/plat/exynos4.h b/arch/arm/plat-samsung/include/plat/exynos4.h
index f680a143e38c..20d73bf77537 100644
--- a/arch/arm/plat-s5p/include/plat/exynos4.h
+++ b/arch/arm/plat-samsung/include/plat/exynos4.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/exynos4.h 1/* linux/arch/arm/plat-samsung/include/plat/exynos4.h
2 * 2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
diff --git a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
new file mode 100644
index 000000000000..4e5d9588b5ba
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
@@ -0,0 +1,72 @@
1/* arch/arm/plat-samsung/include/plat/fb-s3c2410.h
2 *
3 * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
4 *
5 * Inspired by pxafb.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#ifndef __ASM_PLAT_FB_S3C2410_H
13#define __ASM_PLAT_FB_S3C2410_H __FILE__
14
15struct s3c2410fb_hw {
16 unsigned long lcdcon1;
17 unsigned long lcdcon2;
18 unsigned long lcdcon3;
19 unsigned long lcdcon4;
20 unsigned long lcdcon5;
21};
22
23/* LCD description */
24struct s3c2410fb_display {
25 /* LCD type */
26 unsigned type;
27
28 /* Screen size */
29 unsigned short width;
30 unsigned short height;
31
32 /* Screen info */
33 unsigned short xres;
34 unsigned short yres;
35 unsigned short bpp;
36
37 unsigned pixclock; /* pixclock in picoseconds */
38 unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */
39 unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
40 unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */
41 unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */
42 unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */
43 unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */
44
45 /* lcd configuration registers */
46 unsigned long lcdcon5;
47};
48
49struct s3c2410fb_mach_info {
50
51 struct s3c2410fb_display *displays; /* attached diplays info */
52 unsigned num_displays; /* number of defined displays */
53 unsigned default_display;
54
55 /* GPIOs */
56
57 unsigned long gpcup;
58 unsigned long gpcup_mask;
59 unsigned long gpccon;
60 unsigned long gpccon_mask;
61 unsigned long gpdup;
62 unsigned long gpdup_mask;
63 unsigned long gpdcon;
64 unsigned long gpdcon_mask;
65
66 /* lpc3600 control register */
67 unsigned long lpcsel;
68};
69
70extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
71
72#endif /* __ASM_PLAT_FB_S3C2410_H */
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 01f10e4d00c7..0fedf47fa502 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -109,4 +109,11 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);
109 */ 109 */
110extern void exynos4_fimd0_gpio_setup_24bpp(void); 110extern void exynos4_fimd0_gpio_setup_24bpp(void);
111 111
112/**
113 * s5p64x0_fb_gpio_setup_24bpp() - S5P6440/S5P6450 setup function for 24bpp LCD
114 *
115 * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
116 */
117extern void s5p64x0_fb_gpio_setup_24bpp(void);
118
112#endif /* __PLAT_S3C_FB_H */ 119#endif /* __PLAT_S3C_FB_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/fiq.h b/arch/arm/plat-samsung/include/plat/fiq.h
index 8521b8372c5f..535d06a35628 100644
--- a/arch/arm/plat-s3c24xx/include/plat/fiq.h
+++ b/arch/arm/plat-samsung/include/plat/fiq.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/fiq.h 1/* linux/arch/arm/plat-samsung/include/plat/fiq.h
2 * 2 *
3 * Copyright (c) 2009 Simtec Electronics 3 * Copyright (c) 2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
index 9a4e53d52967..a181d7ce81cf 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
@@ -1,11 +1,11 @@
1/* linux/arch/arm/plat-s3c/include/plat/gpio-cfg-helper.h 1/* linux/arch/arm/plat-samsung/include/plat/gpio-cfg-helper.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk> 6 * Ben Dooks <ben@simtec.co.uk>
7 * 7 *
8 * S3C Platform - GPIO pin configuration helper definitions 8 * Samsung Platform - GPIO pin configuration helper definitions
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -24,120 +24,30 @@
24 * by disabling interrupts. 24 * by disabling interrupts.
25*/ 25*/
26 26
27static inline int s3c_gpio_do_setcfg(struct s3c_gpio_chip *chip, 27static inline int samsung_gpio_do_setcfg(struct samsung_gpio_chip *chip,
28 unsigned int off, unsigned int config) 28 unsigned int off, unsigned int config)
29{ 29{
30 return (chip->config->set_config)(chip, off, config); 30 return (chip->config->set_config)(chip, off, config);
31} 31}
32 32
33static inline unsigned s3c_gpio_do_getcfg(struct s3c_gpio_chip *chip, 33static inline unsigned samsung_gpio_do_getcfg(struct samsung_gpio_chip *chip,
34 unsigned int off) 34 unsigned int off)
35{ 35{
36 return (chip->config->get_config)(chip, off); 36 return (chip->config->get_config)(chip, off);
37} 37}
38 38
39static inline int s3c_gpio_do_setpull(struct s3c_gpio_chip *chip, 39static inline int samsung_gpio_do_setpull(struct samsung_gpio_chip *chip,
40 unsigned int off, s3c_gpio_pull_t pull) 40 unsigned int off, samsung_gpio_pull_t pull)
41{ 41{
42 return (chip->config->set_pull)(chip, off, pull); 42 return (chip->config->set_pull)(chip, off, pull);
43} 43}
44 44
45static inline s3c_gpio_pull_t s3c_gpio_do_getpull(struct s3c_gpio_chip *chip, 45static inline samsung_gpio_pull_t samsung_gpio_do_getpull(struct samsung_gpio_chip *chip,
46 unsigned int off) 46 unsigned int off)
47{ 47{
48 return chip->config->get_pull(chip, off); 48 return chip->config->get_pull(chip, off);
49} 49}
50 50
51/**
52 * s3c_gpio_setcfg_s3c24xx - S3C24XX style GPIO configuration.
53 * @chip: The gpio chip that is being configured.
54 * @off: The offset for the GPIO being configured.
55 * @cfg: The configuration value to set.
56 *
57 * This helper deal with the GPIO cases where the control register
58 * has two bits of configuration per gpio, which have the following
59 * functions:
60 * 00 = input
61 * 01 = output
62 * 1x = special function
63*/
64extern int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip,
65 unsigned int off, unsigned int cfg);
66
67/**
68 * s3c_gpio_getcfg_s3c24xx - S3C24XX style GPIO configuration read.
69 * @chip: The gpio chip that is being configured.
70 * @off: The offset for the GPIO being configured.
71 *
72 * The reverse of s3c_gpio_setcfg_s3c24xx(). Will return a value whicg
73 * could be directly passed back to s3c_gpio_setcfg_s3c24xx(), from the
74 * S3C_GPIO_SPECIAL() macro.
75 */
76unsigned int s3c_gpio_getcfg_s3c24xx(struct s3c_gpio_chip *chip,
77 unsigned int off);
78
79/**
80 * s3c_gpio_setcfg_s3c24xx_a - S3C24XX style GPIO configuration (Bank A)
81 * @chip: The gpio chip that is being configured.
82 * @off: The offset for the GPIO being configured.
83 * @cfg: The configuration value to set.
84 *
85 * This helper deal with the GPIO cases where the control register
86 * has one bit of configuration for the gpio, where setting the bit
87 * means the pin is in special function mode and unset means output.
88*/
89extern int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
90 unsigned int off, unsigned int cfg);
91
92
93/**
94 * s3c_gpio_getcfg_s3c24xx_a - S3C24XX style GPIO configuration read (Bank A)
95 * @chip: The gpio chip that is being configured.
96 * @off: The offset for the GPIO being configured.
97 *
98 * The reverse of s3c_gpio_setcfg_s3c24xx_a() turning an GPIO into a usable
99 * GPIO configuration value.
100 *
101 * @sa s3c_gpio_getcfg_s3c24xx
102 * @sa s3c_gpio_getcfg_s3c64xx_4bit
103 */
104extern unsigned s3c_gpio_getcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
105 unsigned int off);
106
107/**
108 * s3c_gpio_setcfg_s3c64xx_4bit - S3C64XX 4bit single register GPIO config.
109 * @chip: The gpio chip that is being configured.
110 * @off: The offset for the GPIO being configured.
111 * @cfg: The configuration value to set.
112 *
113 * This helper deal with the GPIO cases where the control register has 4 bits
114 * of control per GPIO, generally in the form of:
115 * 0000 = Input
116 * 0001 = Output
117 * others = Special functions (dependent on bank)
118 *
119 * Note, since the code to deal with the case where there are two control
120 * registers instead of one, we do not have a separate set of functions for
121 * each case.
122*/
123extern int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
124 unsigned int off, unsigned int cfg);
125
126
127/**
128 * s3c_gpio_getcfg_s3c64xx_4bit - S3C64XX 4bit single register GPIO config read.
129 * @chip: The gpio chip that is being configured.
130 * @off: The offset for the GPIO being configured.
131 *
132 * The reverse of s3c_gpio_setcfg_s3c64xx_4bit(), turning a gpio configuration
133 * register setting into a value the software can use, such as could be passed
134 * to s3c_gpio_setcfg_s3c64xx_4bit().
135 *
136 * @sa s3c_gpio_getcfg_s3c24xx
137 */
138extern unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
139 unsigned int off);
140
141/* Pull-{up,down} resistor controls. 51/* Pull-{up,down} resistor controls.
142 * 52 *
143 * S3C2410,S3C2440 = Pull-UP, 53 * S3C2410,S3C2440 = Pull-UP,
@@ -147,7 +57,7 @@ extern unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
147 */ 57 */
148 58
149/** 59/**
150 * s3c_gpio_setpull_1up() - Pull configuration for choice of up or none. 60 * s3c24xx_gpio_setpull_1up() - Pull configuration for choice of up or none.
151 * @chip: The gpio chip that is being configured. 61 * @chip: The gpio chip that is being configured.
152 * @off: The offset for the GPIO being configured. 62 * @off: The offset for the GPIO being configured.
153 * @param: pull: The pull mode being requested. 63 * @param: pull: The pull mode being requested.
@@ -155,11 +65,11 @@ extern unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
155 * This is a helper function for the case where we have GPIOs with one 65 * This is a helper function for the case where we have GPIOs with one
156 * bit configuring the presence of a pull-up resistor. 66 * bit configuring the presence of a pull-up resistor.
157 */ 67 */
158extern int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, 68extern int s3c24xx_gpio_setpull_1up(struct samsung_gpio_chip *chip,
159 unsigned int off, s3c_gpio_pull_t pull); 69 unsigned int off, samsung_gpio_pull_t pull);
160 70
161/** 71/**
162 * s3c_gpio_setpull_1down() - Pull configuration for choice of down or none 72 * s3c24xx_gpio_setpull_1down() - Pull configuration for choice of down or none
163 * @chip: The gpio chip that is being configured 73 * @chip: The gpio chip that is being configured
164 * @off: The offset for the GPIO being configured 74 * @off: The offset for the GPIO being configured
165 * @param: pull: The pull mode being requested 75 * @param: pull: The pull mode being requested
@@ -167,11 +77,13 @@ extern int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip,
167 * This is a helper function for the case where we have GPIOs with one 77 * This is a helper function for the case where we have GPIOs with one
168 * bit configuring the presence of a pull-down resistor. 78 * bit configuring the presence of a pull-down resistor.
169 */ 79 */
170extern int s3c_gpio_setpull_1down(struct s3c_gpio_chip *chip, 80extern int s3c24xx_gpio_setpull_1down(struct samsung_gpio_chip *chip,
171 unsigned int off, s3c_gpio_pull_t pull); 81 unsigned int off, samsung_gpio_pull_t pull);
172 82
173/** 83/**
174 * s3c_gpio_setpull_upown() - Pull configuration for choice of up, down or none 84 * samsung_gpio_setpull_upown() - Pull configuration for choice of up,
85 * down or none
86 *
175 * @chip: The gpio chip that is being configured. 87 * @chip: The gpio chip that is being configured.
176 * @off: The offset for the GPIO being configured. 88 * @off: The offset for the GPIO being configured.
177 * @param: pull: The pull mode being requested. 89 * @param: pull: The pull mode being requested.
@@ -183,45 +95,46 @@ extern int s3c_gpio_setpull_1down(struct s3c_gpio_chip *chip,
183 * 01 = Pull-up resistor connected 95 * 01 = Pull-up resistor connected
184 * 10 = Pull-down resistor connected 96 * 10 = Pull-down resistor connected
185 */ 97 */
186extern int s3c_gpio_setpull_updown(struct s3c_gpio_chip *chip, 98extern int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
187 unsigned int off, s3c_gpio_pull_t pull); 99 unsigned int off, samsung_gpio_pull_t pull);
188
189 100
190/** 101/**
191 * s3c_gpio_getpull_updown() - Get configuration for choice of up, down or none 102 * samsung_gpio_getpull_updown() - Get configuration for choice of up,
103 * down or none
104 *
192 * @chip: The gpio chip that the GPIO pin belongs to 105 * @chip: The gpio chip that the GPIO pin belongs to
193 * @off: The offset to the pin to get the configuration of. 106 * @off: The offset to the pin to get the configuration of.
194 * 107 *
195 * This helper function reads the state of the pull-{up,down} resistor for the 108 * This helper function reads the state of the pull-{up,down} resistor
196 * given GPIO in the same case as s3c_gpio_setpull_upown. 109 * for the given GPIO in the same case as samsung_gpio_setpull_upown.
197*/ 110*/
198extern s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip, 111extern samsung_gpio_pull_t samsung_gpio_getpull_updown(struct samsung_gpio_chip *chip,
199 unsigned int off); 112 unsigned int off);
200 113
201/** 114/**
202 * s3c_gpio_getpull_1up() - Get configuration for choice of up or none 115 * s3c24xx_gpio_getpull_1up() - Get configuration for choice of up or none
203 * @chip: The gpio chip that the GPIO pin belongs to 116 * @chip: The gpio chip that the GPIO pin belongs to
204 * @off: The offset to the pin to get the configuration of. 117 * @off: The offset to the pin to get the configuration of.
205 * 118 *
206 * This helper function reads the state of the pull-up resistor for the 119 * This helper function reads the state of the pull-up resistor for the
207 * given GPIO in the same case as s3c_gpio_setpull_1up. 120 * given GPIO in the same case as s3c24xx_gpio_setpull_1up.
208*/ 121*/
209extern s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, 122extern samsung_gpio_pull_t s3c24xx_gpio_getpull_1up(struct samsung_gpio_chip *chip,
210 unsigned int off); 123 unsigned int off);
211 124
212/** 125/**
213 * s3c_gpio_getpull_1down() - Get configuration for choice of down or none 126 * s3c24xx_gpio_getpull_1down() - Get configuration for choice of down or none
214 * @chip: The gpio chip that the GPIO pin belongs to 127 * @chip: The gpio chip that the GPIO pin belongs to
215 * @off: The offset to the pin to get the configuration of. 128 * @off: The offset to the pin to get the configuration of.
216 * 129 *
217 * This helper function reads the state of the pull-down resistor for the 130 * This helper function reads the state of the pull-down resistor for the
218 * given GPIO in the same case as s3c_gpio_setpull_1down. 131 * given GPIO in the same case as s3c24xx_gpio_setpull_1down.
219*/ 132*/
220extern s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip, 133extern samsung_gpio_pull_t s3c24xx_gpio_getpull_1down(struct samsung_gpio_chip *chip,
221 unsigned int off); 134 unsigned int off);
222 135
223/** 136/**
224 * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. 137 * s3c2443_gpio_setpull() - Pull configuration for s3c2443.
225 * @chip: The gpio chip that is being configured. 138 * @chip: The gpio chip that is being configured.
226 * @off: The offset for the GPIO being configured. 139 * @off: The offset for the GPIO being configured.
227 * @param: pull: The pull mode being requested. 140 * @param: pull: The pull mode being requested.
@@ -233,19 +146,18 @@ extern s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip,
233 * 10 = Pull-down resistor connected 146 * 10 = Pull-down resistor connected
234 * x1 = No pull up resistor 147 * x1 = No pull up resistor
235 */ 148 */
236extern int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip, 149extern int s3c2443_gpio_setpull(struct samsung_gpio_chip *chip,
237 unsigned int off, s3c_gpio_pull_t pull); 150 unsigned int off, samsung_gpio_pull_t pull);
238 151
239/** 152/**
240 * s3c_gpio_getpull_s3c2443() - Get configuration for s3c2443 pull resistors 153 * s3c2443_gpio_getpull() - Get configuration for s3c2443 pull resistors
241 * @chip: The gpio chip that the GPIO pin belongs to. 154 * @chip: The gpio chip that the GPIO pin belongs to.
242 * @off: The offset to the pin to get the configuration of. 155 * @off: The offset to the pin to get the configuration of.
243 * 156 *
244 * This helper function reads the state of the pull-{up,down} resistor for the 157 * This helper function reads the state of the pull-{up,down} resistor for the
245 * given GPIO in the same case as s3c_gpio_setpull_upown. 158 * given GPIO in the same case as samsung_gpio_setpull_upown.
246*/ 159*/
247extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip, 160extern samsung_gpio_pull_t s3c2443_gpio_getpull(struct samsung_gpio_chip *chip,
248 unsigned int off); 161 unsigned int off);
249 162
250#endif /* __PLAT_GPIO_CFG_HELPERS_H */ 163#endif /* __PLAT_GPIO_CFG_HELPERS_H */
251
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 1762dcb4cb9e..d48245bb02b3 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -24,14 +24,14 @@
24#ifndef __PLAT_GPIO_CFG_H 24#ifndef __PLAT_GPIO_CFG_H
25#define __PLAT_GPIO_CFG_H __FILE__ 25#define __PLAT_GPIO_CFG_H __FILE__
26 26
27typedef unsigned int __bitwise__ s3c_gpio_pull_t; 27typedef unsigned int __bitwise__ samsung_gpio_pull_t;
28typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; 28typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
29 29
30/* forward declaration if gpio-core.h hasn't been included */ 30/* forward declaration if gpio-core.h hasn't been included */
31struct s3c_gpio_chip; 31struct samsung_gpio_chip;
32 32
33/** 33/**
34 * struct s3c_gpio_cfg GPIO configuration 34 * struct samsung_gpio_cfg GPIO configuration
35 * @cfg_eint: Configuration setting when used for external interrupt source 35 * @cfg_eint: Configuration setting when used for external interrupt source
36 * @get_pull: Read the current pull configuration for the GPIO 36 * @get_pull: Read the current pull configuration for the GPIO
37 * @set_pull: Set the current pull configuraiton for the GPIO 37 * @set_pull: Set the current pull configuraiton for the GPIO
@@ -44,20 +44,20 @@ struct s3c_gpio_chip;
44 * per-bank configuration information that other systems such as the 44 * per-bank configuration information that other systems such as the
45 * external interrupt code will need. 45 * external interrupt code will need.
46 * 46 *
47 * @sa s3c_gpio_cfgpin 47 * @sa samsung_gpio_cfgpin
48 * @sa s3c_gpio_getcfg 48 * @sa s3c_gpio_getcfg
49 * @sa s3c_gpio_setpull 49 * @sa s3c_gpio_setpull
50 * @sa s3c_gpio_getpull 50 * @sa s3c_gpio_getpull
51 */ 51 */
52struct s3c_gpio_cfg { 52struct samsung_gpio_cfg {
53 unsigned int cfg_eint; 53 unsigned int cfg_eint;
54 54
55 s3c_gpio_pull_t (*get_pull)(struct s3c_gpio_chip *chip, unsigned offs); 55 samsung_gpio_pull_t (*get_pull)(struct samsung_gpio_chip *chip, unsigned offs);
56 int (*set_pull)(struct s3c_gpio_chip *chip, unsigned offs, 56 int (*set_pull)(struct samsung_gpio_chip *chip, unsigned offs,
57 s3c_gpio_pull_t pull); 57 samsung_gpio_pull_t pull);
58 58
59 unsigned (*get_config)(struct s3c_gpio_chip *chip, unsigned offs); 59 unsigned (*get_config)(struct samsung_gpio_chip *chip, unsigned offs);
60 int (*set_config)(struct s3c_gpio_chip *chip, unsigned offs, 60 int (*set_config)(struct samsung_gpio_chip *chip, unsigned offs,
61 unsigned config); 61 unsigned config);
62}; 62};
63 63
@@ -69,7 +69,7 @@ struct s3c_gpio_cfg {
69#define S3C_GPIO_OUTPUT (S3C_GPIO_SPECIAL(1)) 69#define S3C_GPIO_OUTPUT (S3C_GPIO_SPECIAL(1))
70#define S3C_GPIO_SFN(x) (S3C_GPIO_SPECIAL(x)) 70#define S3C_GPIO_SFN(x) (S3C_GPIO_SPECIAL(x))
71 71
72#define s3c_gpio_is_cfg_special(_cfg) \ 72#define samsung_gpio_is_cfg_special(_cfg) \
73 (((_cfg) & S3C_GPIO_SPECIAL_MARK) == S3C_GPIO_SPECIAL_MARK) 73 (((_cfg) & S3C_GPIO_SPECIAL_MARK) == S3C_GPIO_SPECIAL_MARK)
74 74
75/** 75/**
@@ -128,9 +128,9 @@ extern int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
128 * up or down settings, and it may be dependent on the chip that is being 128 * up or down settings, and it may be dependent on the chip that is being
129 * used to whether the particular mode is available. 129 * used to whether the particular mode is available.
130 */ 130 */
131#define S3C_GPIO_PULL_NONE ((__force s3c_gpio_pull_t)0x00) 131#define S3C_GPIO_PULL_NONE ((__force samsung_gpio_pull_t)0x00)
132#define S3C_GPIO_PULL_DOWN ((__force s3c_gpio_pull_t)0x01) 132#define S3C_GPIO_PULL_DOWN ((__force samsung_gpio_pull_t)0x01)
133#define S3C_GPIO_PULL_UP ((__force s3c_gpio_pull_t)0x02) 133#define S3C_GPIO_PULL_UP ((__force samsung_gpio_pull_t)0x02)
134 134
135/** 135/**
136 * s3c_gpio_setpull() - set the state of a gpio pin pull resistor 136 * s3c_gpio_setpull() - set the state of a gpio pin pull resistor
@@ -143,7 +143,7 @@ extern int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,
143 * 143 *
144 * @pull is one of S3C_GPIO_PULL_NONE, S3C_GPIO_PULL_DOWN or S3C_GPIO_PULL_UP. 144 * @pull is one of S3C_GPIO_PULL_NONE, S3C_GPIO_PULL_DOWN or S3C_GPIO_PULL_UP.
145*/ 145*/
146extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull); 146extern int s3c_gpio_setpull(unsigned int pin, samsung_gpio_pull_t pull);
147 147
148/** 148/**
149 * s3c_gpio_getpull() - get the pull resistor state of a gpio pin 149 * s3c_gpio_getpull() - get the pull resistor state of a gpio pin
@@ -151,7 +151,7 @@ extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull);
151 * 151 *
152 * Read the pull resistor value for the specified pin. 152 * Read the pull resistor value for the specified pin.
153*/ 153*/
154extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin); 154extern samsung_gpio_pull_t s3c_gpio_getpull(unsigned int pin);
155 155
156/* configure `all` aspects of an gpio */ 156/* configure `all` aspects of an gpio */
157 157
@@ -170,7 +170,7 @@ extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin);
170 * @sa s3c_gpio_cfgpin_range 170 * @sa s3c_gpio_cfgpin_range
171 */ 171 */
172extern int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr, 172extern int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,
173 unsigned int cfg, s3c_gpio_pull_t pull); 173 unsigned int cfg, samsung_gpio_pull_t pull);
174 174
175static inline int s3c_gpio_cfgrange_nopull(unsigned int pin, unsigned int size, 175static inline int s3c_gpio_cfgrange_nopull(unsigned int pin, unsigned int size,
176 unsigned int cfg) 176 unsigned int cfg)
diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
index 8cad4cf19c3c..1fe6917f6a2a 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-core.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
@@ -25,22 +25,22 @@
25 * specific code. 25 * specific code.
26*/ 26*/
27 27
28struct s3c_gpio_chip; 28struct samsung_gpio_chip;
29 29
30/** 30/**
31 * struct s3c_gpio_pm - power management (suspend/resume) information 31 * struct samsung_gpio_pm - power management (suspend/resume) information
32 * @save: Routine to save the state of the GPIO block 32 * @save: Routine to save the state of the GPIO block
33 * @resume: Routine to resume the GPIO block. 33 * @resume: Routine to resume the GPIO block.
34 */ 34 */
35struct s3c_gpio_pm { 35struct samsung_gpio_pm {
36 void (*save)(struct s3c_gpio_chip *chip); 36 void (*save)(struct samsung_gpio_chip *chip);
37 void (*resume)(struct s3c_gpio_chip *chip); 37 void (*resume)(struct samsung_gpio_chip *chip);
38}; 38};
39 39
40struct s3c_gpio_cfg; 40struct samsung_gpio_cfg;
41 41
42/** 42/**
43 * struct s3c_gpio_chip - wrapper for specific implementation of gpio 43 * struct samsung_gpio_chip - wrapper for specific implementation of gpio
44 * @chip: The chip structure to be exported via gpiolib. 44 * @chip: The chip structure to be exported via gpiolib.
45 * @base: The base pointer to the gpio configuration registers. 45 * @base: The base pointer to the gpio configuration registers.
46 * @group: The group register number for gpio interrupt support. 46 * @group: The group register number for gpio interrupt support.
@@ -60,10 +60,10 @@ struct s3c_gpio_cfg;
60 * CPU cores trying to get one lock for different GPIO banks, where each 60 * CPU cores trying to get one lock for different GPIO banks, where each
61 * bank of GPIO has its own register space and configuration registers. 61 * bank of GPIO has its own register space and configuration registers.
62 */ 62 */
63struct s3c_gpio_chip { 63struct samsung_gpio_chip {
64 struct gpio_chip chip; 64 struct gpio_chip chip;
65 struct s3c_gpio_cfg *config; 65 struct samsung_gpio_cfg *config;
66 struct s3c_gpio_pm *pm; 66 struct samsung_gpio_pm *pm;
67 void __iomem *base; 67 void __iomem *base;
68 int irq_base; 68 int irq_base;
69 int group; 69 int group;
@@ -73,58 +73,11 @@ struct s3c_gpio_chip {
73#endif 73#endif
74}; 74};
75 75
76static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc) 76static inline struct samsung_gpio_chip *to_samsung_gpio(struct gpio_chip *gpc)
77{ 77{
78 return container_of(gpc, struct s3c_gpio_chip, chip); 78 return container_of(gpc, struct samsung_gpio_chip, chip);
79} 79}
80 80
81/** s3c_gpiolib_add() - add the s3c specific version of a gpio_chip.
82 * @chip: The chip to register
83 *
84 * This is a wrapper to gpiochip_add() that takes our specific gpio chip
85 * information and makes the necessary alterations for the platform and
86 * notes the information for use with the configuration systems and any
87 * other parts of the system.
88 */
89extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip);
90
91/* CONFIG_S3C_GPIO_TRACK enables the tracking of the s3c specific gpios
92 * for use with the configuration calls, and other parts of the s3c gpiolib
93 * support code.
94 *
95 * Not all s3c support code will need this, as some configurations of cpu
96 * may only support one or two different configuration options and have an
97 * easy gpio to s3c_gpio_chip mapping function. If this is the case, then
98 * the machine support file should provide its own s3c_gpiolib_getchip()
99 * and any other necessary functions.
100 */
101
102/**
103 * samsung_gpiolib_add_4bit_chips - 4bit single register GPIO config.
104 * @chip: The gpio chip that is being configured.
105 * @nr_chips: The no of chips (gpio ports) for the GPIO being configured.
106 *
107 * This helper deal with the GPIO cases where the control register has 4 bits
108 * of control per GPIO, generally in the form of:
109 * 0000 = Input
110 * 0001 = Output
111 * others = Special functions (dependent on bank)
112 *
113 * Note, since the code to deal with the case where there are two control
114 * registers instead of one, we do not have a separate set of function
115 * (samsung_gpiolib_add_4bit2_chips)for each case.
116 */
117extern void samsung_gpiolib_add_4bit_chips(struct s3c_gpio_chip *chip,
118 int nr_chips);
119extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip,
120 int nr_chips);
121extern void samsung_gpiolib_add_2bit_chips(struct s3c_gpio_chip *chip,
122 int nr_chips);
123
124extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip);
125extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
126
127
128/** 81/**
129 * samsung_gpiolib_to_irq - convert gpio pin to irq number 82 * samsung_gpiolib_to_irq - convert gpio pin to irq number
130 * @chip: The gpio chip that the pin belongs to. 83 * @chip: The gpio chip that the pin belongs to.
@@ -136,36 +89,36 @@ extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
136extern int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset); 89extern int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset);
137 90
138/* exported for core SoC support to change */ 91/* exported for core SoC support to change */
139extern struct s3c_gpio_cfg s3c24xx_gpiocfg_default; 92extern struct samsung_gpio_cfg s3c24xx_gpiocfg_default;
140 93
141#ifdef CONFIG_S3C_GPIO_TRACK 94#ifdef CONFIG_S3C_GPIO_TRACK
142extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; 95extern struct samsung_gpio_chip *s3c_gpios[S3C_GPIO_END];
143 96
144static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int chip) 97static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int chip)
145{ 98{
146 return (chip < S3C_GPIO_END) ? s3c_gpios[chip] : NULL; 99 return (chip < S3C_GPIO_END) ? s3c_gpios[chip] : NULL;
147} 100}
148#else 101#else
149/* machine specific code should provide s3c_gpiolib_getchip */ 102/* machine specific code should provide samsung_gpiolib_getchip */
150 103
151#include <mach/gpio-track.h> 104#include <mach/gpio-track.h>
152 105
153static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } 106static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { }
154#endif 107#endif
155 108
156#ifdef CONFIG_PM 109#ifdef CONFIG_PM
157extern struct s3c_gpio_pm s3c_gpio_pm_1bit; 110extern struct samsung_gpio_pm samsung_gpio_pm_1bit;
158extern struct s3c_gpio_pm s3c_gpio_pm_2bit; 111extern struct samsung_gpio_pm samsung_gpio_pm_2bit;
159extern struct s3c_gpio_pm s3c_gpio_pm_4bit; 112extern struct samsung_gpio_pm samsung_gpio_pm_4bit;
160#define __gpio_pm(x) x 113#define __gpio_pm(x) x
161#else 114#else
162#define s3c_gpio_pm_1bit NULL 115#define samsung_gpio_pm_1bit NULL
163#define s3c_gpio_pm_2bit NULL 116#define samsung_gpio_pm_2bit NULL
164#define s3c_gpio_pm_4bit NULL 117#define samsung_gpio_pm_4bit NULL
165#define __gpio_pm(x) NULL 118#define __gpio_pm(x) NULL
166 119
167#endif /* CONFIG_PM */ 120#endif /* CONFIG_PM */
168 121
169/* locking wrappers to deal with multiple access to the same gpio bank */ 122/* locking wrappers to deal with multiple access to the same gpio bank */
170#define s3c_gpio_lock(_oc, _fl) spin_lock_irqsave(&(_oc)->lock, _fl) 123#define samsung_gpio_lock(_oc, _fl) spin_lock_irqsave(&(_oc)->lock, _fl)
171#define s3c_gpio_unlock(_oc, _fl) spin_unlock_irqrestore(&(_oc)->lock, _fl) 124#define samsung_gpio_unlock(_oc, _fl) spin_unlock_irqrestore(&(_oc)->lock, _fl)
diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h
new file mode 100644
index 000000000000..bab139201761
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/gpio-fns.h
@@ -0,0 +1,98 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
2 *
3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - hardware
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __MACH_GPIO_FNS_H
14#define __MACH_GPIO_FNS_H __FILE__
15
16/* These functions are in the to-be-removed category and it is strongly
17 * encouraged not to use these in new code. They will be marked deprecated
18 * very soon.
19 *
20 * Most of the functionality can be either replaced by the gpiocfg calls
21 * for the s3c platform or by the generic GPIOlib API.
22 *
23 * As of 2.6.35-rc, these will be removed, with the few drivers using them
24 * either replaced or given a wrapper until the calls can be removed.
25*/
26
27#include <plat/gpio-cfg.h>
28
29static inline void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int cfg)
30{
31 /* 1:1 mapping between cfgpin and setcfg calls at the moment */
32 s3c_gpio_cfgpin(pin, cfg);
33}
34
35/* external functions for GPIO support
36 *
37 * These allow various different clients to access the same GPIO
38 * registers without conflicting. If your driver only owns the entire
39 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
40*/
41
42extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
43
44/* s3c2410_gpio_getirq
45 *
46 * turn the given pin number into the corresponding IRQ number
47 *
48 * returns:
49 * < 0 = no interrupt for this pin
50 * >=0 = interrupt number for the pin
51*/
52
53extern int s3c2410_gpio_getirq(unsigned int pin);
54
55/* s3c2410_gpio_irqfilter
56 *
57 * set the irq filtering on the given pin
58 *
59 * on = 0 => disable filtering
60 * 1 => enable filtering
61 *
62 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
63 * width of filter (0 through 63)
64 *
65 *
66*/
67
68extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
69 unsigned int config);
70
71/* s3c2410_gpio_pullup
72 *
73 * This call should be replaced with s3c_gpio_setpull().
74 *
75 * As a note, there is currently no distinction between pull-up and pull-down
76 * in the s3c24xx series devices with only an on/off configuration.
77 */
78
79/* s3c2410_gpio_pullup
80 *
81 * configure the pull-up control on the given pin
82 *
83 * to = 1 => disable the pull-up
84 * 0 => enable the pull-up
85 *
86 * eg;
87 *
88 * s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
89 * s3c2410_gpio_pullup(S3C2410_GPE(8), 0);
90*/
91
92extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
93
94extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
95
96extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
97
98#endif /* __MACH_GPIO_FNS_H */
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h
index 56b0059439e1..51d52e767a19 100644
--- a/arch/arm/plat-samsung/include/plat/iic.h
+++ b/arch/arm/plat-samsung/include/plat/iic.h
@@ -60,6 +60,7 @@ extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);
60extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c); 60extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c);
61extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c); 61extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c);
62extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c); 62extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c);
63extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c);
63 64
64/* defined by architecture to configure gpio */ 65/* defined by architecture to configure gpio */
65extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); 66extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
diff --git a/arch/arm/plat-s3c24xx/include/plat/irq.h b/arch/arm/plat-samsung/include/plat/irq.h
index ec087d6054b1..e21a89bc26c9 100644
--- a/arch/arm/plat-s3c24xx/include/plat/irq.h
+++ b/arch/arm/plat-samsung/include/plat/irq.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/irq.h 1/* linux/arch/arm/plat-samsung/include/plat/irq.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -25,9 +25,9 @@
25extern struct irq_chip s3c_irq_level_chip; 25extern struct irq_chip s3c_irq_level_chip;
26extern struct irq_chip s3c_irq_chip; 26extern struct irq_chip s3c_irq_chip;
27 27
28static inline void 28static inline void s3c_irqsub_mask(unsigned int irqno,
29s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, 29 unsigned int parentbit,
30 int subcheck) 30 int subcheck)
31{ 31{
32 unsigned long mask; 32 unsigned long mask;
33 unsigned long submask; 33 unsigned long submask;
@@ -39,17 +39,16 @@ s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
39 39
40 /* check to see if we need to mask the parent IRQ */ 40 /* check to see if we need to mask the parent IRQ */
41 41
42 if ((submask & subcheck) == subcheck) { 42 if ((submask & subcheck) == subcheck)
43 __raw_writel(mask | parentbit, S3C2410_INTMSK); 43 __raw_writel(mask | parentbit, S3C2410_INTMSK);
44 }
45 44
46 /* write back masks */ 45 /* write back masks */
47 __raw_writel(submask, S3C2410_INTSUBMSK); 46 __raw_writel(submask, S3C2410_INTSUBMSK);
48 47
49} 48}
50 49
51static inline void 50static inline void s3c_irqsub_unmask(unsigned int irqno,
52s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit) 51 unsigned int parentbit)
53{ 52{
54 unsigned long mask; 53 unsigned long mask;
55 unsigned long submask; 54 unsigned long submask;
@@ -66,8 +65,9 @@ s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
66} 65}
67 66
68 67
69static inline void 68static inline void s3c_irqsub_maskack(unsigned int irqno,
70s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group) 69 unsigned int parentmask,
70 unsigned int group)
71{ 71{
72 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); 72 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
73 73
@@ -86,8 +86,9 @@ s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int gro
86 } 86 }
87} 87}
88 88
89static inline void 89static inline void s3c_irqsub_ack(unsigned int irqno,
90s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group) 90 unsigned int parentmask,
91 unsigned int group)
91{ 92{
92 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); 93 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
93 94
diff --git a/arch/arm/plat-s5p/include/plat/irqs.h b/arch/arm/plat-samsung/include/plat/irqs.h
index 144dbfc6506d..08d1a7ef97b7 100644
--- a/arch/arm/plat-s5p/include/plat/irqs.h
+++ b/arch/arm/plat-samsung/include/plat/irqs.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/irqs.h 1/* linux/arch/arm/plat-samsung/include/plat/irqs.h
2 * 2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
@@ -10,8 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#ifndef __ASM_PLAT_S5P_IRQS_H 13#ifndef __PLAT_SAMSUNG_IRQS_H
14#define __ASM_PLAT_S5P_IRQS_H __FILE__ 14#define __PLAT_SAMSUNG_IRQS_H __FILE__
15 15
16/* we keep the first set of CPU IRQs out of the range of 16/* we keep the first set of CPU IRQs out of the range of
17 * the ISA space, so that the PC104 has them to itself 17 * the ISA space, so that the PC104 has them to itself
@@ -77,4 +77,4 @@
77#define S5P_IRQ_TYPE_EDGE_RISING (0x03) 77#define S5P_IRQ_TYPE_EDGE_RISING (0x03)
78#define S5P_IRQ_TYPE_EDGE_BOTH (0x04) 78#define S5P_IRQ_TYPE_EDGE_BOTH (0x04)
79 79
80#endif /* __ASM_PLAT_S5P_IRQS_H */ 80#endif /* __PLAT_SAMSUNG_IRQS_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-samsung/include/plat/mci.h
index 2ac2b21ec490..c42d31711944 100644
--- a/arch/arm/plat-s3c24xx/include/plat/mci.h
+++ b/arch/arm/plat-samsung/include/plat/mci.h
@@ -27,11 +27,11 @@
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used. 27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */ 28 */
29struct s3c24xx_mci_pdata { 29struct s3c24xx_mci_pdata {
30 unsigned int no_wprotect : 1; 30 unsigned int no_wprotect:1;
31 unsigned int no_detect : 1; 31 unsigned int no_detect:1;
32 unsigned int wprotect_invert : 1; 32 unsigned int wprotect_invert:1;
33 unsigned int detect_invert : 1; /* set => detect active high. */ 33 unsigned int detect_invert:1; /* set => detect active high */
34 unsigned int use_dma : 1; 34 unsigned int use_dma:1;
35 35
36 unsigned int gpio_detect; 36 unsigned int gpio_detect;
37 unsigned int gpio_wprotect; 37 unsigned int gpio_wprotect;
diff --git a/arch/arm/plat-s5p/include/plat/mfc.h b/arch/arm/plat-samsung/include/plat/mfc.h
index 6697f8cb2949..ac13227272f0 100644
--- a/arch/arm/plat-s5p/include/plat/mfc.h
+++ b/arch/arm/plat-samsung/include/plat/mfc.h
@@ -7,8 +7,8 @@
7 * option) any later version. 7 * option) any later version.
8 */ 8 */
9 9
10#ifndef __PLAT_S5P_MFC_H 10#ifndef __PLAT_SAMSUNG_MFC_H
11#define __PLAT_S5P_MFC_H 11#define __PLAT_SAMSUNG_MFC_H __FILE__
12 12
13/** 13/**
14 * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver 14 * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver
@@ -24,4 +24,4 @@
24void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, 24void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
25 phys_addr_t lbase, unsigned int lsize); 25 phys_addr_t lbase, unsigned int lsize);
26 26
27#endif /* __PLAT_S5P_MFC_H */ 27#endif /* __PLAT_SAMSUNG_MFC_H */
diff --git a/arch/arm/plat-s5p/include/plat/mipi_csis.h b/arch/arm/plat-samsung/include/plat/mipi_csis.h
index 9bd254c5ed22..c45b1e8d4c2e 100644
--- a/arch/arm/plat-s5p/include/plat/mipi_csis.h
+++ b/arch/arm/plat-samsung/include/plat/mipi_csis.h
@@ -8,8 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef PLAT_S5P_MIPI_CSIS_H_ 11#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
12#define PLAT_S5P_MIPI_CSIS_H_ __FILE__ 12#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__
13 13
14struct platform_device; 14struct platform_device;
15 15
@@ -40,4 +40,4 @@ struct s5p_platform_mipi_csis {
40 */ 40 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on); 41int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
42 42
43#endif /* PLAT_S5P_MIPI_CSIS_H_ */ 43#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-samsung/include/plat/pll.h
index 3e21b9444cc5..357af7c1c664 100644
--- a/arch/arm/plat-s5p/include/plat/pll.h
+++ b/arch/arm/plat-samsung/include/plat/pll.h
@@ -1,11 +1,14 @@
1/* arch/arm/plat-s5p/include/plat/pll.h 1/* linux/arch/arm/plat-samsung/include/plat/pll.h
2 * 2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
5 * 5 *
6 * S5P PLL code 6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/
7 * 10 *
8 * Based on arch/arm/plat-s3c64xx/include/plat/pll.h 11 * Samsung PLL codes
9 * 12 *
10 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -14,6 +17,111 @@
14 17
15#include <asm/div64.h> 18#include <asm/div64.h>
16 19
20#define S3C24XX_PLL_MDIV_MASK (0xFF)
21#define S3C24XX_PLL_PDIV_MASK (0x1F)
22#define S3C24XX_PLL_SDIV_MASK (0x3)
23#define S3C24XX_PLL_MDIV_SHIFT (12)
24#define S3C24XX_PLL_PDIV_SHIFT (4)
25#define S3C24XX_PLL_SDIV_SHIFT (0)
26
27static inline unsigned int s3c24xx_get_pll(unsigned int pllval,
28 unsigned int baseclk)
29{
30 unsigned int mdiv, pdiv, sdiv;
31 uint64_t fvco;
32
33 mdiv = (pllval >> S3C24XX_PLL_MDIV_SHIFT) & S3C24XX_PLL_MDIV_MASK;
34 pdiv = (pllval >> S3C24XX_PLL_PDIV_SHIFT) & S3C24XX_PLL_PDIV_MASK;
35 sdiv = (pllval >> S3C24XX_PLL_SDIV_SHIFT) & S3C24XX_PLL_SDIV_MASK;
36
37 fvco = (uint64_t)baseclk * (mdiv + 8);
38 do_div(fvco, (pdiv + 2) << sdiv);
39
40 return (unsigned int)fvco;
41}
42
43#define S3C2416_PLL_MDIV_MASK (0x3FF)
44#define S3C2416_PLL_PDIV_MASK (0x3F)
45#define S3C2416_PLL_SDIV_MASK (0x7)
46#define S3C2416_PLL_MDIV_SHIFT (14)
47#define S3C2416_PLL_PDIV_SHIFT (5)
48#define S3C2416_PLL_SDIV_SHIFT (0)
49
50static inline unsigned int s3c2416_get_pll(unsigned int pllval,
51 unsigned int baseclk)
52{
53 unsigned int mdiv, pdiv, sdiv;
54 uint64_t fvco;
55
56 mdiv = (pllval >> S3C2416_PLL_MDIV_SHIFT) & S3C2416_PLL_MDIV_MASK;
57 pdiv = (pllval >> S3C2416_PLL_PDIV_SHIFT) & S3C2416_PLL_PDIV_MASK;
58 sdiv = (pllval >> S3C2416_PLL_SDIV_SHIFT) & S3C2416_PLL_SDIV_MASK;
59
60 fvco = (uint64_t)baseclk * mdiv;
61 do_div(fvco, (pdiv << sdiv));
62
63 return (unsigned int)fvco;
64}
65
66#define S3C6400_PLL_MDIV_MASK (0x3FF)
67#define S3C6400_PLL_PDIV_MASK (0x3F)
68#define S3C6400_PLL_SDIV_MASK (0x7)
69#define S3C6400_PLL_MDIV_SHIFT (16)
70#define S3C6400_PLL_PDIV_SHIFT (8)
71#define S3C6400_PLL_SDIV_SHIFT (0)
72
73static inline unsigned long s3c6400_get_pll(unsigned long baseclk,
74 u32 pllcon)
75{
76 u32 mdiv, pdiv, sdiv;
77 u64 fvco = baseclk;
78
79 mdiv = (pllcon >> S3C6400_PLL_MDIV_SHIFT) & S3C6400_PLL_MDIV_MASK;
80 pdiv = (pllcon >> S3C6400_PLL_PDIV_SHIFT) & S3C6400_PLL_PDIV_MASK;
81 sdiv = (pllcon >> S3C6400_PLL_SDIV_SHIFT) & S3C6400_PLL_SDIV_MASK;
82
83 fvco *= mdiv;
84 do_div(fvco, (pdiv << sdiv));
85
86 return (unsigned long)fvco;
87}
88
89#define PLL6553X_MDIV_MASK (0x7F)
90#define PLL6553X_PDIV_MASK (0x1F)
91#define PLL6553X_SDIV_MASK (0x3)
92#define PLL6553X_KDIV_MASK (0xFFFF)
93#define PLL6553X_MDIV_SHIFT (16)
94#define PLL6553X_PDIV_SHIFT (8)
95#define PLL6553X_SDIV_SHIFT (0)
96
97static inline unsigned long s3c_get_pll6553x(unsigned long baseclk,
98 u32 pll_con0, u32 pll_con1)
99{
100 unsigned long result;
101 u32 mdiv, pdiv, sdiv, kdiv;
102 u64 tmp;
103
104 mdiv = (pll_con0 >> PLL6553X_MDIV_SHIFT) & PLL6553X_MDIV_MASK;
105 pdiv = (pll_con0 >> PLL6553X_PDIV_SHIFT) & PLL6553X_PDIV_MASK;
106 sdiv = (pll_con0 >> PLL6553X_SDIV_SHIFT) & PLL6553X_SDIV_MASK;
107 kdiv = pll_con1 & PLL6553X_KDIV_MASK;
108
109 /*
110 * We need to multiple baseclk by mdiv (the integer part) and kdiv
111 * which is in 2^16ths, so shift mdiv up (does not overflow) and
112 * add kdiv before multiplying. The use of tmp is to avoid any
113 * overflows before shifting bac down into result when multipling
114 * by the mdiv and kdiv pair.
115 */
116
117 tmp = baseclk;
118 tmp *= (mdiv << 16) + kdiv;
119 do_div(tmp, (pdiv << sdiv));
120 result = tmp >> 16;
121
122 return result;
123}
124
17#define PLL35XX_MDIV_MASK (0x3FF) 125#define PLL35XX_MDIV_MASK (0x3FF)
18#define PLL35XX_PDIV_MASK (0x3F) 126#define PLL35XX_PDIV_MASK (0x3F)
19#define PLL35XX_SDIV_MASK (0x7) 127#define PLL35XX_SDIV_MASK (0x7)
@@ -97,15 +205,24 @@ static inline unsigned long s5p_get_pll45xx(unsigned long baseclk, u32 pll_con,
97 return (unsigned long)fvco; 205 return (unsigned long)fvco;
98} 206}
99 207
100#define PLL46XX_KDIV_MASK (0xFFFF) 208/* CON0 bit-fields */
101#define PLL4650C_KDIV_MASK (0xFFF)
102#define PLL46XX_MDIV_MASK (0x1FF) 209#define PLL46XX_MDIV_MASK (0x1FF)
103#define PLL46XX_PDIV_MASK (0x3F) 210#define PLL46XX_PDIV_MASK (0x3F)
104#define PLL46XX_SDIV_MASK (0x7) 211#define PLL46XX_SDIV_MASK (0x7)
212#define PLL46XX_LOCKED_SHIFT (29)
105#define PLL46XX_MDIV_SHIFT (16) 213#define PLL46XX_MDIV_SHIFT (16)
106#define PLL46XX_PDIV_SHIFT (8) 214#define PLL46XX_PDIV_SHIFT (8)
107#define PLL46XX_SDIV_SHIFT (0) 215#define PLL46XX_SDIV_SHIFT (0)
108 216
217/* CON1 bit-fields */
218#define PLL46XX_MRR_MASK (0x1F)
219#define PLL46XX_MFR_MASK (0x3F)
220#define PLL46XX_KDIV_MASK (0xFFFF)
221#define PLL4650C_KDIV_MASK (0xFFF)
222#define PLL46XX_MRR_SHIFT (24)
223#define PLL46XX_MFR_SHIFT (16)
224#define PLL46XX_KDIV_SHIFT (0)
225
109enum pll46xx_type_t { 226enum pll46xx_type_t {
110 pll_4600, 227 pll_4600,
111 pll_4650, 228 pll_4650,
@@ -123,6 +240,7 @@ static inline unsigned long s5p_get_pll46xx(unsigned long baseclk,
123 mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & PLL46XX_MDIV_MASK; 240 mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & PLL46XX_MDIV_MASK;
124 pdiv = (pll_con0 >> PLL46XX_PDIV_SHIFT) & PLL46XX_PDIV_MASK; 241 pdiv = (pll_con0 >> PLL46XX_PDIV_SHIFT) & PLL46XX_PDIV_MASK;
125 sdiv = (pll_con0 >> PLL46XX_SDIV_SHIFT) & PLL46XX_SDIV_MASK; 242 sdiv = (pll_con0 >> PLL46XX_SDIV_SHIFT) & PLL46XX_SDIV_MASK;
243 kdiv = pll_con1 & PLL46XX_KDIV_MASK;
126 244
127 if (pll_type == pll_4650c) 245 if (pll_type == pll_4650c)
128 kdiv = pll_con1 & PLL4650C_KDIV_MASK; 246 kdiv = pll_con1 & PLL4650C_KDIV_MASK;
@@ -148,6 +266,7 @@ static inline unsigned long s5p_get_pll46xx(unsigned long baseclk,
148#define PLL90XX_PDIV_MASK (0x3F) 266#define PLL90XX_PDIV_MASK (0x3F)
149#define PLL90XX_SDIV_MASK (0x7) 267#define PLL90XX_SDIV_MASK (0x7)
150#define PLL90XX_KDIV_MASK (0xffff) 268#define PLL90XX_KDIV_MASK (0xffff)
269#define PLL90XX_LOCKED_SHIFT (29)
151#define PLL90XX_MDIV_SHIFT (16) 270#define PLL90XX_MDIV_SHIFT (16)
152#define PLL90XX_PDIV_SHIFT (8) 271#define PLL90XX_PDIV_SHIFT (8)
153#define PLL90XX_SDIV_SHIFT (0) 272#define PLL90XX_SDIV_SHIFT (0)
@@ -165,7 +284,8 @@ static inline unsigned long s5p_get_pll90xx(unsigned long baseclk,
165 sdiv = (pll_con >> PLL90XX_SDIV_SHIFT) & PLL90XX_SDIV_MASK; 284 sdiv = (pll_con >> PLL90XX_SDIV_SHIFT) & PLL90XX_SDIV_MASK;
166 kdiv = pll_conk & PLL90XX_KDIV_MASK; 285 kdiv = pll_conk & PLL90XX_KDIV_MASK;
167 286
168 /* We need to multiple baseclk by mdiv (the integer part) and kdiv 287 /*
288 * We need to multiple baseclk by mdiv (the integer part) and kdiv
169 * which is in 2^16ths, so shift mdiv up (does not overflow) and 289 * which is in 2^16ths, so shift mdiv up (does not overflow) and
170 * add kdiv before multiplying. The use of tmp is to avoid any 290 * add kdiv before multiplying. The use of tmp is to avoid any
171 * overflows before shifting bac down into result when multipling 291 * overflows before shifting bac down into result when multipling
diff --git a/arch/arm/plat-samsung/include/plat/pll6553x.h b/arch/arm/plat-samsung/include/plat/pll6553x.h
deleted file mode 100644
index b8b7e1d884f8..000000000000
--- a/arch/arm/plat-samsung/include/plat/pll6553x.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/pll6553x.h
2 * partially from arch/arm/mach-s3c64xx/include/mach/pll.h
3 *
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * Samsung PLL6553x PLL code
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16/* S3C6400 and compatible (S3C2416, etc.) EPLL code */
17
18#define PLL6553X_MDIV_MASK ((1 << (23-16)) - 1)
19#define PLL6553X_PDIV_MASK ((1 << (13-8)) - 1)
20#define PLL6553X_SDIV_MASK ((1 << (2-0)) - 1)
21#define PLL6553X_MDIV_SHIFT (16)
22#define PLL6553X_PDIV_SHIFT (8)
23#define PLL6553X_SDIV_SHIFT (0)
24#define PLL6553X_KDIV_MASK (0xffff)
25
26static inline unsigned long s3c_get_pll6553x(unsigned long baseclk,
27 u32 pll0, u32 pll1)
28{
29 unsigned long result;
30 u32 mdiv, pdiv, sdiv, kdiv;
31 u64 tmp;
32
33 mdiv = (pll0 >> PLL6553X_MDIV_SHIFT) & PLL6553X_MDIV_MASK;
34 pdiv = (pll0 >> PLL6553X_PDIV_SHIFT) & PLL6553X_PDIV_MASK;
35 sdiv = (pll0 >> PLL6553X_SDIV_SHIFT) & PLL6553X_SDIV_MASK;
36 kdiv = pll1 & PLL6553X_KDIV_MASK;
37
38 /* We need to multiple baseclk by mdiv (the integer part) and kdiv
39 * which is in 2^16ths, so shift mdiv up (does not overflow) and
40 * add kdiv before multiplying. The use of tmp is to avoid any
41 * overflows before shifting bac down into result when multipling
42 * by the mdiv and kdiv pair.
43 */
44
45 tmp = baseclk;
46 tmp *= (mdiv << 16) + kdiv;
47 do_div(tmp, (pdiv << sdiv));
48 result = tmp >> 16;
49
50 return result;
51}
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index f6749916d194..dcf68709f9cf 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -165,20 +165,20 @@ extern void s3c_pm_check_store(void);
165extern void s3c_pm_configure_extint(void); 165extern void s3c_pm_configure_extint(void);
166 166
167/** 167/**
168 * s3c_pm_restore_gpios() - restore the state of the gpios after sleep. 168 * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
169 * 169 *
170 * Restore the state of the GPIO pins after sleep, which may involve ensuring 170 * Restore the state of the GPIO pins after sleep, which may involve ensuring
171 * that we do not glitch the state of the pins from that the bootloader's 171 * that we do not glitch the state of the pins from that the bootloader's
172 * resume code has done. 172 * resume code has done.
173*/ 173*/
174extern void s3c_pm_restore_gpios(void); 174extern void samsung_pm_restore_gpios(void);
175 175
176/** 176/**
177 * s3c_pm_save_gpios() - save the state of the GPIOs for restoring after sleep. 177 * samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
178 * 178 *
179 * Save the GPIO states for resotration on resume. See s3c_pm_restore_gpios(). 179 * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
180 */ 180 */
181extern void s3c_pm_save_gpios(void); 181extern void samsung_pm_save_gpios(void);
182 182
183extern void s3c_pm_save_core(void); 183extern void s3c_pm_save_core(void);
184extern void s3c_pm_restore_core(void); 184extern void s3c_pm_restore_core(void);
diff --git a/arch/arm/mach-exynos4/include/mach/pwm-clock.h b/arch/arm/plat-samsung/include/plat/pwm-clock.h
index 8e12090287bb..bf6a60eb6237 100644
--- a/arch/arm/mach-exynos4/include/mach/pwm-clock.h
+++ b/arch/arm/plat-samsung/include/plat/pwm-clock.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-exynos4/include/mach/pwm-clock.h 1/* linux/arch/arm/plat-samsung/include/plat/pwm-clock.h
2 * 2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
@@ -8,17 +8,15 @@
8 * Ben Dooks <ben@simtec.co.uk> 8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/ 9 * http://armlinux.simtec.co.uk/
10 * 10 *
11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h 11 * SAMSUNG - pwm clock and timer support
12 *
13 * EXYNOS4 - pwm clock and timer support
14 * 12 *
15 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation. 15 * published by the Free Software Foundation.
18*/ 16*/
19 17
20#ifndef __ASM_ARCH_PWMCLK_H 18#ifndef __ASM_PLAT_PWM_CLOCK_H
21#define __ASM_ARCH_PWMCLK_H __FILE__ 19#define __ASM_PLAT_PWM_CLOCK_H __FILE__
22 20
23/** 21/**
24 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk 22 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
@@ -29,7 +27,14 @@
29 */ 27 */
30static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) 28static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
31{ 29{
32 return tcfg == S3C64XX_TCFG1_MUX_TCLK; 30 if (soc_is_s3c24xx())
31 return tcfg == S3C2410_TCFG1_MUX_TCLK;
32 else if (soc_is_s3c64xx() || soc_is_s5pc100())
33 return tcfg >= S3C64XX_TCFG1_MUX_TCLK;
34 else if (soc_is_s5p6440() || soc_is_s5p6450())
35 return 0;
36 else
37 return tcfg == S3C64XX_TCFG1_MUX_TCLK;
33} 38}
34 39
35/** 40/**
@@ -41,7 +46,10 @@ static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
41 */ 46 */
42static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) 47static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
43{ 48{
44 return 1 << tcfg1; 49 if (soc_is_s3c24xx())
50 return 1 << (tcfg1 + 1);
51 else
52 return 1 << tcfg1;
45} 53}
46 54
47/** 55/**
@@ -51,7 +59,10 @@ static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
51 */ 59 */
52static inline unsigned int pwm_tdiv_has_div1(void) 60static inline unsigned int pwm_tdiv_has_div1(void)
53{ 61{
54 return 1; 62 if (soc_is_s3c24xx())
63 return 0;
64 else
65 return 1;
55} 66}
56 67
57/** 68/**
@@ -62,9 +73,9 @@ static inline unsigned int pwm_tdiv_has_div1(void)
62 */ 73 */
63static inline unsigned long pwm_tdiv_div_bits(unsigned int div) 74static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
64{ 75{
65 return ilog2(div); 76 if (soc_is_s3c24xx())
77 return ilog2(div) - 1;
78 else
79 return ilog2(div);
66} 80}
67 81#endif /* __ASM_PLAT_PWM_CLOCK_H */
68#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK
69
70#endif /* __ASM_ARCH_PWMCLK_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h b/arch/arm/plat-samsung/include/plat/regs-dma.h
index 1b0f4c36d384..178bccbe4804 100644
--- a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
+++ b/arch/arm/plat-samsung/include/plat/regs-dma.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h 1/* arch/arm/plat-samsung/include/plat/regs-dma.h
2 * 2 *
3 * Copyright (C) 2003-2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -10,7 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13/* DMA Register definitions */ 13#ifndef __ASM_PLAT_REGS_DMA_H
14#define __ASM_PLAT_REGS_DMA_H __FILE__
14 15
15#define S3C2410_DMA_DISRC (0x00) 16#define S3C2410_DMA_DISRC (0x00)
16#define S3C2410_DMA_DISRCC (0x04) 17#define S3C2410_DMA_DISRCC (0x04)
@@ -24,74 +25,75 @@
24#define S3C2412_DMA_DMAREQSEL (0x24) 25#define S3C2412_DMA_DMAREQSEL (0x24)
25#define S3C2443_DMA_DMAREQSEL (0x24) 26#define S3C2443_DMA_DMAREQSEL (0x24)
26 27
27#define S3C2410_DISRCC_INC (1<<0) 28#define S3C2410_DISRCC_INC (1 << 0)
28#define S3C2410_DISRCC_APB (1<<1) 29#define S3C2410_DISRCC_APB (1 << 1)
29 30
30#define S3C2410_DMASKTRIG_STOP (1<<2) 31#define S3C2410_DMASKTRIG_STOP (1 << 2)
31#define S3C2410_DMASKTRIG_ON (1<<1) 32#define S3C2410_DMASKTRIG_ON (1 << 1)
32#define S3C2410_DMASKTRIG_SWTRIG (1<<0) 33#define S3C2410_DMASKTRIG_SWTRIG (1 << 0)
33 34
34#define S3C2410_DCON_DEMAND (0<<31) 35#define S3C2410_DCON_DEMAND (0 << 31)
35#define S3C2410_DCON_HANDSHAKE (1<<31) 36#define S3C2410_DCON_HANDSHAKE (1 << 31)
36#define S3C2410_DCON_SYNC_PCLK (0<<30) 37#define S3C2410_DCON_SYNC_PCLK (0 << 30)
37#define S3C2410_DCON_SYNC_HCLK (1<<30) 38#define S3C2410_DCON_SYNC_HCLK (1 << 30)
38 39
39#define S3C2410_DCON_INTREQ (1<<29) 40#define S3C2410_DCON_INTREQ (1 << 29)
40 41
41#define S3C2410_DCON_CH0_XDREQ0 (0<<24) 42#define S3C2410_DCON_CH0_XDREQ0 (0 << 24)
42#define S3C2410_DCON_CH0_UART0 (1<<24) 43#define S3C2410_DCON_CH0_UART0 (1 << 24)
43#define S3C2410_DCON_CH0_SDI (2<<24) 44#define S3C2410_DCON_CH0_SDI (2 << 24)
44#define S3C2410_DCON_CH0_TIMER (3<<24) 45#define S3C2410_DCON_CH0_TIMER (3 << 24)
45#define S3C2410_DCON_CH0_USBEP1 (4<<24) 46#define S3C2410_DCON_CH0_USBEP1 (4 << 24)
46 47
47#define S3C2410_DCON_CH1_XDREQ1 (0<<24) 48#define S3C2410_DCON_CH1_XDREQ1 (0 << 24)
48#define S3C2410_DCON_CH1_UART1 (1<<24) 49#define S3C2410_DCON_CH1_UART1 (1 << 24)
49#define S3C2410_DCON_CH1_I2SSDI (2<<24) 50#define S3C2410_DCON_CH1_I2SSDI (2 << 24)
50#define S3C2410_DCON_CH1_SPI (3<<24) 51#define S3C2410_DCON_CH1_SPI (3 << 24)
51#define S3C2410_DCON_CH1_USBEP2 (4<<24) 52#define S3C2410_DCON_CH1_USBEP2 (4 << 24)
52 53
53#define S3C2410_DCON_CH2_I2SSDO (0<<24) 54#define S3C2410_DCON_CH2_I2SSDO (0 << 24)
54#define S3C2410_DCON_CH2_I2SSDI (1<<24) 55#define S3C2410_DCON_CH2_I2SSDI (1 << 24)
55#define S3C2410_DCON_CH2_SDI (2<<24) 56#define S3C2410_DCON_CH2_SDI (2 << 24)
56#define S3C2410_DCON_CH2_TIMER (3<<24) 57#define S3C2410_DCON_CH2_TIMER (3 << 24)
57#define S3C2410_DCON_CH2_USBEP3 (4<<24) 58#define S3C2410_DCON_CH2_USBEP3 (4 << 24)
58 59
59#define S3C2410_DCON_CH3_UART2 (0<<24) 60#define S3C2410_DCON_CH3_UART2 (0 << 24)
60#define S3C2410_DCON_CH3_SDI (1<<24) 61#define S3C2410_DCON_CH3_SDI (1 << 24)
61#define S3C2410_DCON_CH3_SPI (2<<24) 62#define S3C2410_DCON_CH3_SPI (2 << 24)
62#define S3C2410_DCON_CH3_TIMER (3<<24) 63#define S3C2410_DCON_CH3_TIMER (3 << 24)
63#define S3C2410_DCON_CH3_USBEP4 (4<<24) 64#define S3C2410_DCON_CH3_USBEP4 (4 << 24)
64 65
65#define S3C2410_DCON_SRCSHIFT (24) 66#define S3C2410_DCON_SRCSHIFT (24)
66#define S3C2410_DCON_SRCMASK (7<<24) 67#define S3C2410_DCON_SRCMASK (7 << 24)
67 68
68#define S3C2410_DCON_BYTE (0<<20) 69#define S3C2410_DCON_BYTE (0 << 20)
69#define S3C2410_DCON_HALFWORD (1<<20) 70#define S3C2410_DCON_HALFWORD (1 << 20)
70#define S3C2410_DCON_WORD (2<<20) 71#define S3C2410_DCON_WORD (2 << 20)
71 72
72#define S3C2410_DCON_AUTORELOAD (0<<22) 73#define S3C2410_DCON_AUTORELOAD (0 << 22)
73#define S3C2410_DCON_NORELOAD (1<<22) 74#define S3C2410_DCON_NORELOAD (1 << 22)
74#define S3C2410_DCON_HWTRIG (1<<23) 75#define S3C2410_DCON_HWTRIG (1 << 23)
75 76
76#ifdef CONFIG_CPU_S3C2440 77#ifdef CONFIG_CPU_S3C2440
77#define S3C2440_DIDSTC_CHKINT (1<<2)
78 78
79#define S3C2440_DCON_CH0_I2SSDO (5<<24) 79#define S3C2440_DIDSTC_CHKINT (1 << 2)
80#define S3C2440_DCON_CH0_PCMIN (6<<24)
81 80
82#define S3C2440_DCON_CH1_PCMOUT (5<<24) 81#define S3C2440_DCON_CH0_I2SSDO (5 << 24)
83#define S3C2440_DCON_CH1_SDI (6<<24) 82#define S3C2440_DCON_CH0_PCMIN (6 << 24)
84 83
85#define S3C2440_DCON_CH2_PCMIN (5<<24) 84#define S3C2440_DCON_CH1_PCMOUT (5 << 24)
86#define S3C2440_DCON_CH2_MICIN (6<<24) 85#define S3C2440_DCON_CH1_SDI (6 << 24)
87 86
88#define S3C2440_DCON_CH3_MICIN (5<<24) 87#define S3C2440_DCON_CH2_PCMIN (5 << 24)
89#define S3C2440_DCON_CH3_PCMOUT (6<<24) 88#define S3C2440_DCON_CH2_MICIN (6 << 24)
90#endif 89
90#define S3C2440_DCON_CH3_MICIN (5 << 24)
91#define S3C2440_DCON_CH3_PCMOUT (6 << 24)
92#endif /* CONFIG_CPU_S3C2440 */
91 93
92#ifdef CONFIG_CPU_S3C2412 94#ifdef CONFIG_CPU_S3C2412
93 95
94#define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) 96#define S3C2412_DMAREQSEL_SRC(x) ((x) << 1)
95 97
96#define S3C2412_DMAREQSEL_HW (1) 98#define S3C2412_DMAREQSEL_HW (1)
97 99
@@ -115,10 +117,11 @@
115#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) 117#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22)
116#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) 118#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23)
117#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) 119#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24)
120#endif /* CONFIG_CPU_S3C2412 */
118 121
119#endif 122#ifdef CONFIG_CPU_S3C2443
120 123
121#define S3C2443_DMAREQSEL_SRC(x) ((x)<<1) 124#define S3C2443_DMAREQSEL_SRC(x) ((x) << 1)
122 125
123#define S3C2443_DMAREQSEL_HW (1) 126#define S3C2443_DMAREQSEL_HW (1)
124 127
@@ -141,5 +144,8 @@
141#define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25) 144#define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25)
142#define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26) 145#define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26)
143#define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27) 146#define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27)
144#define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28) 147#define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28)
145#define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29) 148#define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29)
149#endif /* CONFIG_CPU_S3C2443 */
150
151#endif /* __ASM_PLAT_REGS_DMA_H */
diff --git a/arch/arm/plat-samsung/include/plat/regs-iis.h b/arch/arm/plat-samsung/include/plat/regs-iis.h
new file mode 100644
index 000000000000..a18d35e7a735
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/regs-iis.h
@@ -0,0 +1,70 @@
1/* arch/arm/plat-samsung/include/plat/regs-iis.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * S3C2410 IIS register definition
11*/
12
13#ifndef __ASM_ARCH_REGS_IIS_H
14#define __ASM_ARCH_REGS_IIS_H
15
16#define S3C2410_IISCON (0x00)
17
18#define S3C2410_IISCON_LRINDEX (1 << 8)
19#define S3C2410_IISCON_TXFIFORDY (1 << 7)
20#define S3C2410_IISCON_RXFIFORDY (1 << 6)
21#define S3C2410_IISCON_TXDMAEN (1 << 5)
22#define S3C2410_IISCON_RXDMAEN (1 << 4)
23#define S3C2410_IISCON_TXIDLE (1 << 3)
24#define S3C2410_IISCON_RXIDLE (1 << 2)
25#define S3C2410_IISCON_PSCEN (1 << 1)
26#define S3C2410_IISCON_IISEN (1 << 0)
27
28#define S3C2410_IISMOD (0x04)
29
30#define S3C2440_IISMOD_MPLL (1 << 9)
31#define S3C2410_IISMOD_SLAVE (1 << 8)
32#define S3C2410_IISMOD_NOXFER (0 << 6)
33#define S3C2410_IISMOD_RXMODE (1 << 6)
34#define S3C2410_IISMOD_TXMODE (2 << 6)
35#define S3C2410_IISMOD_TXRXMODE (3 << 6)
36#define S3C2410_IISMOD_LR_LLOW (0 << 5)
37#define S3C2410_IISMOD_LR_RLOW (1 << 5)
38#define S3C2410_IISMOD_IIS (0 << 4)
39#define S3C2410_IISMOD_MSB (1 << 4)
40#define S3C2410_IISMOD_8BIT (0 << 3)
41#define S3C2410_IISMOD_16BIT (1 << 3)
42#define S3C2410_IISMOD_BITMASK (1 << 3)
43#define S3C2410_IISMOD_256FS (0 << 2)
44#define S3C2410_IISMOD_384FS (1 << 2)
45#define S3C2410_IISMOD_16FS (0 << 0)
46#define S3C2410_IISMOD_32FS (1 << 0)
47#define S3C2410_IISMOD_48FS (2 << 0)
48#define S3C2410_IISMOD_FS_MASK (3 << 0)
49
50#define S3C2410_IISPSR (0x08)
51
52#define S3C2410_IISPSR_INTMASK (31 << 5)
53#define S3C2410_IISPSR_INTSHIFT (5)
54#define S3C2410_IISPSR_EXTMASK (31 << 0)
55#define S3C2410_IISPSR_EXTSHFIT (0)
56
57#define S3C2410_IISFCON (0x0c)
58
59#define S3C2410_IISFCON_TXDMA (1 << 15)
60#define S3C2410_IISFCON_RXDMA (1 << 14)
61#define S3C2410_IISFCON_TXENABLE (1 << 13)
62#define S3C2410_IISFCON_RXENABLE (1 << 12)
63#define S3C2410_IISFCON_TXMASK (0x3f << 6)
64#define S3C2410_IISFCON_TXSHIFT (6)
65#define S3C2410_IISFCON_RXMASK (0x3f)
66#define S3C2410_IISFCON_RXSHIFT (0)
67
68#define S3C2410_IISFIFO (0x10)
69
70#endif /* __ASM_ARCH_REGS_IIS_H */
diff --git a/arch/arm/plat-samsung/include/plat/regs-spi.h b/arch/arm/plat-samsung/include/plat/regs-spi.h
new file mode 100644
index 000000000000..552fe7cfe281
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/regs-spi.h
@@ -0,0 +1,48 @@
1/* arch/arm/plat-samsung/include/plat/regs-spi.h
2 *
3 * Copyright (c) 2004 Fetron GmbH
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C2410 SPI register definition
10*/
11
12#ifndef __ASM_ARCH_REGS_SPI_H
13#define __ASM_ARCH_REGS_SPI_H
14
15#define S3C2410_SPI1 (0x20)
16#define S3C2412_SPI1 (0x100)
17
18#define S3C2410_SPCON (0x00)
19
20#define S3C2410_SPCON_SMOD_DMA (2 << 5) /* DMA mode */
21#define S3C2410_SPCON_SMOD_INT (1 << 5) /* interrupt mode */
22#define S3C2410_SPCON_SMOD_POLL (0 << 5) /* polling mode */
23#define S3C2410_SPCON_ENSCK (1 << 4) /* Enable SCK */
24#define S3C2410_SPCON_MSTR (1 << 3) /* Master:1, Slave:0 select */
25#define S3C2410_SPCON_CPOL_HIGH (1 << 2) /* Clock polarity select */
26#define S3C2410_SPCON_CPOL_LOW (0 << 2) /* Clock polarity select */
27
28#define S3C2410_SPCON_CPHA_FMTB (1 << 1) /* Clock Phase Select */
29#define S3C2410_SPCON_CPHA_FMTA (0 << 1) /* Clock Phase Select */
30
31#define S3C2410_SPSTA (0x04)
32
33#define S3C2410_SPSTA_DCOL (1 << 2) /* Data Collision Error */
34#define S3C2410_SPSTA_MULD (1 << 1) /* Multi Master Error */
35#define S3C2410_SPSTA_READY (1 << 0) /* Data Tx/Rx ready */
36#define S3C2412_SPSTA_READY_ORG (1 << 3)
37
38#define S3C2410_SPPIN (0x08)
39
40#define S3C2410_SPPIN_ENMUL (1 << 2) /* Multi Master Error detect */
41#define S3C2410_SPPIN_RESERVED (1 << 1)
42#define S3C2410_SPPIN_KEEP (1 << 0) /* Master Out keep */
43
44#define S3C2410_SPPRE (0x0C)
45#define S3C2410_SPTDAT (0x10)
46#define S3C2410_SPRDAT (0x14)
47
48#endif /* __ASM_ARCH_REGS_SPI_H */
diff --git a/arch/arm/plat-s5p/include/plat/regs-srom.h b/arch/arm/plat-samsung/include/plat/regs-srom.h
index f121ab5e76cb..9b6729c81cda 100644
--- a/arch/arm/plat-s5p/include/plat/regs-srom.h
+++ b/arch/arm/plat-samsung/include/plat/regs-srom.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/regs-srom.h 1/* linux/arch/arm/plat-samsung/include/plat/regs-srom.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
@@ -10,8 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#ifndef __ASM_PLAT_S5P_REGS_SROM_H 13#ifndef __PLAT_SAMSUNG_REGS_SROM_H
14#define __ASM_PLAT_S5P_REGS_SROM_H __FILE__ 14#define __PLAT_SAMSUNG_REGS_SROM_H __FILE__
15 15
16#include <mach/map.h> 16#include <mach/map.h>
17 17
@@ -51,4 +51,4 @@
51#define S5P_SROM_BCX__TCOS__SHIFT 24 51#define S5P_SROM_BCX__TCOS__SHIFT 24
52#define S5P_SROM_BCX__TACS__SHIFT 28 52#define S5P_SROM_BCX__TACS__SHIFT 28
53 53
54#endif /* __ASM_PLAT_S5P_REGS_SROM_H */ 54#endif /* __PLAT_SAMSUNG_REGS_SROM_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-udc.h b/arch/arm/plat-samsung/include/plat/regs-udc.h
index f0dd4a41b37b..4003d3dab4e7 100644
--- a/arch/arm/plat-s3c24xx/include/plat/regs-udc.h
+++ b/arch/arm/plat-samsung/include/plat/regs-udc.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-udc.h 1/* arch/arm/plat-samsung/include/plat/regs-udc.h
2 * 2 *
3 * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at> 3 * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at>
4 * 4 *
@@ -75,79 +75,77 @@
75#define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198) 75#define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198)
76#define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c) 76#define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c)
77 77
78#define S3C2410_UDC_FUNCADDR_UPDATE (1<<7) 78#define S3C2410_UDC_FUNCADDR_UPDATE (1 << 7)
79 79
80#define S3C2410_UDC_PWR_ISOUP (1<<7) // R/W 80#define S3C2410_UDC_PWR_ISOUP (1 << 7) /* R/W */
81#define S3C2410_UDC_PWR_RESET (1<<3) // R 81#define S3C2410_UDC_PWR_RESET (1 << 3) /* R */
82#define S3C2410_UDC_PWR_RESUME (1<<2) // R/W 82#define S3C2410_UDC_PWR_RESUME (1 << 2) /* R/W */
83#define S3C2410_UDC_PWR_SUSPEND (1<<1) // R 83#define S3C2410_UDC_PWR_SUSPEND (1 << 1) /* R */
84#define S3C2410_UDC_PWR_ENSUSPEND (1<<0) // R/W 84#define S3C2410_UDC_PWR_ENSUSPEND (1 << 0) /* R/W */
85 85
86#define S3C2410_UDC_PWR_DEFAULT 0x00 86#define S3C2410_UDC_PWR_DEFAULT (0x00)
87 87
88#define S3C2410_UDC_INT_EP4 (1<<4) // R/W (clear only) 88#define S3C2410_UDC_INT_EP4 (1 << 4) /* R/W (clear only) */
89#define S3C2410_UDC_INT_EP3 (1<<3) // R/W (clear only) 89#define S3C2410_UDC_INT_EP3 (1 << 3) /* R/W (clear only) */
90#define S3C2410_UDC_INT_EP2 (1<<2) // R/W (clear only) 90#define S3C2410_UDC_INT_EP2 (1 << 2) /* R/W (clear only) */
91#define S3C2410_UDC_INT_EP1 (1<<1) // R/W (clear only) 91#define S3C2410_UDC_INT_EP1 (1 << 1) /* R/W (clear only) */
92#define S3C2410_UDC_INT_EP0 (1<<0) // R/W (clear only) 92#define S3C2410_UDC_INT_EP0 (1 << 0) /* R/W (clear only) */
93 93
94#define S3C2410_UDC_USBINT_RESET (1<<2) // R/W (clear only) 94#define S3C2410_UDC_USBINT_RESET (1 << 2) /* R/W (clear only) */
95#define S3C2410_UDC_USBINT_RESUME (1<<1) // R/W (clear only) 95#define S3C2410_UDC_USBINT_RESUME (1 << 1) /* R/W (clear only) */
96#define S3C2410_UDC_USBINT_SUSPEND (1<<0) // R/W (clear only) 96#define S3C2410_UDC_USBINT_SUSPEND (1 << 0) /* R/W (clear only) */
97 97
98#define S3C2410_UDC_INTE_EP4 (1<<4) // R/W 98#define S3C2410_UDC_INTE_EP4 (1 << 4) /* R/W */
99#define S3C2410_UDC_INTE_EP3 (1<<3) // R/W 99#define S3C2410_UDC_INTE_EP3 (1 << 3) /* R/W */
100#define S3C2410_UDC_INTE_EP2 (1<<2) // R/W 100#define S3C2410_UDC_INTE_EP2 (1 << 2) /* R/W */
101#define S3C2410_UDC_INTE_EP1 (1<<1) // R/W 101#define S3C2410_UDC_INTE_EP1 (1 << 1) /* R/W */
102#define S3C2410_UDC_INTE_EP0 (1<<0) // R/W 102#define S3C2410_UDC_INTE_EP0 (1 << 0) /* R/W */
103
104#define S3C2410_UDC_USBINTE_RESET (1<<2) // R/W
105#define S3C2410_UDC_USBINTE_SUSPEND (1<<0) // R/W
106 103
104#define S3C2410_UDC_USBINTE_RESET (1 << 2) /* R/W */
105#define S3C2410_UDC_USBINTE_SUSPEND (1 << 0) /* R/W */
107 106
108#define S3C2410_UDC_INDEX_EP0 (0x00) 107#define S3C2410_UDC_INDEX_EP0 (0x00)
109#define S3C2410_UDC_INDEX_EP1 (0x01) // ?? 108#define S3C2410_UDC_INDEX_EP1 (0x01)
110#define S3C2410_UDC_INDEX_EP2 (0x02) // ?? 109#define S3C2410_UDC_INDEX_EP2 (0x02)
111#define S3C2410_UDC_INDEX_EP3 (0x03) // ?? 110#define S3C2410_UDC_INDEX_EP3 (0x03)
112#define S3C2410_UDC_INDEX_EP4 (0x04) // ?? 111#define S3C2410_UDC_INDEX_EP4 (0x04)
113 112
114#define S3C2410_UDC_ICSR1_CLRDT (1<<6) // R/W 113#define S3C2410_UDC_ICSR1_CLRDT (1 << 6) /* R/W */
115#define S3C2410_UDC_ICSR1_SENTSTL (1<<5) // R/W (clear only) 114#define S3C2410_UDC_ICSR1_SENTSTL (1 << 5) /* R/W (clear only) */
116#define S3C2410_UDC_ICSR1_SENDSTL (1<<4) // R/W 115#define S3C2410_UDC_ICSR1_SENDSTL (1 << 4) /* R/W */
117#define S3C2410_UDC_ICSR1_FFLUSH (1<<3) // W (set only) 116#define S3C2410_UDC_ICSR1_FFLUSH (1 << 3) /* W (set only) */
118#define S3C2410_UDC_ICSR1_UNDRUN (1<<2) // R/W (clear only) 117#define S3C2410_UDC_ICSR1_UNDRUN (1 << 2) /* R/W (clear only) */
119#define S3C2410_UDC_ICSR1_PKTRDY (1<<0) // R/W (set only) 118#define S3C2410_UDC_ICSR1_PKTRDY (1 << 0) /* R/W (set only) */
120 119
121#define S3C2410_UDC_ICSR2_AUTOSET (1<<7) // R/W 120#define S3C2410_UDC_ICSR2_AUTOSET (1 << 7) /* R/W */
122#define S3C2410_UDC_ICSR2_ISO (1<<6) // R/W 121#define S3C2410_UDC_ICSR2_ISO (1 << 6) /* R/W */
123#define S3C2410_UDC_ICSR2_MODEIN (1<<5) // R/W 122#define S3C2410_UDC_ICSR2_MODEIN (1 << 5) /* R/W */
124#define S3C2410_UDC_ICSR2_DMAIEN (1<<4) // R/W 123#define S3C2410_UDC_ICSR2_DMAIEN (1 << 4) /* R/W */
125 124
126#define S3C2410_UDC_OCSR1_CLRDT (1<<7) // R/W 125#define S3C2410_UDC_OCSR1_CLRDT (1 << 7) /* R/W */
127#define S3C2410_UDC_OCSR1_SENTSTL (1<<6) // R/W (clear only) 126#define S3C2410_UDC_OCSR1_SENTSTL (1 << 6) /* R/W (clear only) */
128#define S3C2410_UDC_OCSR1_SENDSTL (1<<5) // R/W 127#define S3C2410_UDC_OCSR1_SENDSTL (1 << 5) /* R/W */
129#define S3C2410_UDC_OCSR1_FFLUSH (1<<4) // R/W 128#define S3C2410_UDC_OCSR1_FFLUSH (1 << 4) /* R/W */
130#define S3C2410_UDC_OCSR1_DERROR (1<<3) // R 129#define S3C2410_UDC_OCSR1_DERROR (1 << 3) /* R */
131#define S3C2410_UDC_OCSR1_OVRRUN (1<<2) // R/W (clear only) 130#define S3C2410_UDC_OCSR1_OVRRUN (1 << 2) /* R/W (clear only) */
132#define S3C2410_UDC_OCSR1_PKTRDY (1<<0) // R/W (clear only) 131#define S3C2410_UDC_OCSR1_PKTRDY (1 << 0) /* R/W (clear only) */
133 132
134#define S3C2410_UDC_OCSR2_AUTOCLR (1<<7) // R/W 133#define S3C2410_UDC_OCSR2_AUTOCLR (1 << 7) /* R/W */
135#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W 134#define S3C2410_UDC_OCSR2_ISO (1 << 6) /* R/W */
136#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W 135#define S3C2410_UDC_OCSR2_DMAIEN (1 << 5) /* R/W */
137 136
138#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0) 137#define S3C2410_UDC_EP0_CSR_OPKRDY (1 << 0)
139#define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1) 138#define S3C2410_UDC_EP0_CSR_IPKRDY (1 << 1)
140#define S3C2410_UDC_EP0_CSR_SENTSTL (1<<2) 139#define S3C2410_UDC_EP0_CSR_SENTSTL (1 << 2)
141#define S3C2410_UDC_EP0_CSR_DE (1<<3) 140#define S3C2410_UDC_EP0_CSR_DE (1 << 3)
142#define S3C2410_UDC_EP0_CSR_SE (1<<4) 141#define S3C2410_UDC_EP0_CSR_SE (1 << 4)
143#define S3C2410_UDC_EP0_CSR_SENDSTL (1<<5) 142#define S3C2410_UDC_EP0_CSR_SENDSTL (1 << 5)
144#define S3C2410_UDC_EP0_CSR_SOPKTRDY (1<<6) 143#define S3C2410_UDC_EP0_CSR_SOPKTRDY (1 << 6)
145#define S3C2410_UDC_EP0_CSR_SSE (1<<7) 144#define S3C2410_UDC_EP0_CSR_SSE (1 << 7)
146 145
147#define S3C2410_UDC_MAXP_8 (1<<0) 146#define S3C2410_UDC_MAXP_8 (1 << 0)
148#define S3C2410_UDC_MAXP_16 (1<<1) 147#define S3C2410_UDC_MAXP_16 (1 << 1)
149#define S3C2410_UDC_MAXP_32 (1<<2) 148#define S3C2410_UDC_MAXP_32 (1 << 2)
150#define S3C2410_UDC_MAXP_64 (1<<3) 149#define S3C2410_UDC_MAXP_64 (1 << 3)
151
152 150
153#endif 151#endif
diff --git a/arch/arm/plat-s5p/include/plat/reset.h b/arch/arm/plat-samsung/include/plat/reset.h
index 335e97812eed..32ca5179c6e1 100644
--- a/arch/arm/plat-s5p/include/plat/reset.h
+++ b/arch/arm/plat-samsung/include/plat/reset.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/reset.h 1/* linux/arch/arm/plat-samsung/include/plat/reset.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
@@ -8,9 +8,9 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9*/ 9*/
10 10
11#ifndef __ASM_PLAT_S5P_RESET_H 11#ifndef __PLAT_SAMSUNG_RESET_H
12#define __ASM_PLAT_S5P_RESET_H __FILE__ 12#define __PLAT_SAMSUNG_RESET_H __FILE__
13 13
14extern void (*s5p_reset_hook)(void); 14extern void (*s5p_reset_hook)(void);
15 15
16#endif /* __ASM_PLAT_S5P_RESET_H */ 16#endif /* __PLAT_SAMSUNG_RESET_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-samsung/include/plat/s3c2410.h
index 82ab4aad1bbe..3986497dd3f7 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2410.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2410.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c2410.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h b/arch/arm/plat-samsung/include/plat/s3c2412.h
index bb15d3b68be5..5bcfd143ba16 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2412.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2412.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c2412.h
2 * 2 *
3 * Copyright (c) 2006 Simtec Electronics 3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h b/arch/arm/plat-samsung/include/plat/s3c2416.h
index dc3c0907d221..a764f8503f52 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2443.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c2416.h
2 * 2 *
3 * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com> 3 * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>
4 * 4 *
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index a19715feb798..4b2ac9a272b2 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2443.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c2443.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h b/arch/arm/plat-samsung/include/plat/s3c244x.h
index 89e8d0a25f87..ea0c961b7603 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
+++ b/arch/arm/plat-samsung/include/plat/s3c244x.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/include/plat/s3c244x.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c244x.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/mach-s3c64xx/include/mach/s3c6400.h b/arch/arm/plat-samsung/include/plat/s3c6400.h
index f86958d05352..37d428aaaebb 100644
--- a/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
+++ b/arch/arm/plat-samsung/include/plat/s3c6400.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c64xx/include/macht/s3c6400.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c6400.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/mach-s3c64xx/include/mach/s3c6410.h b/arch/arm/plat-samsung/include/plat/s3c6410.h
index 24f1141ffcb7..20a6675b9d17 100644
--- a/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
+++ b/arch/arm/plat-samsung/include/plat/s3c6410.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c64xx/include/mach/s3c6410.h 1/* linux/arch/arm/plat-samsung/include/plat/s3c6410.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-samsung/include/plat/s5p-clock.h
index 769b5bdfb046..984bf9e7bc89 100644
--- a/arch/arm/plat-s5p/include/plat/s5p-clock.h
+++ b/arch/arm/plat-samsung/include/plat/s5p-clock.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5p-clock.h 1/* linux/arch/arm/plat-samsung/include/plat/s5p-clock.h
2 * 2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
diff --git a/arch/arm/plat-s5p/include/plat/s5p-time.h b/arch/arm/plat-samsung/include/plat/s5p-time.h
index 575e88109db8..3a70aebc9205 100644
--- a/arch/arm/plat-s5p/include/plat/s5p-time.h
+++ b/arch/arm/plat-samsung/include/plat/s5p-time.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5p-time.h 1/* linux/arch/arm/plat-samsung/include/plat/s5p-time.h
2 * 2 *
3 * Copyright 2011 Samsung Electronics Co., Ltd. 3 * Copyright 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
diff --git a/arch/arm/plat-s5p/include/plat/s5p6440.h b/arch/arm/plat-samsung/include/plat/s5p6440.h
index 528585d2cafc..bf85ebbb4fbc 100644
--- a/arch/arm/plat-s5p/include/plat/s5p6440.h
+++ b/arch/arm/plat-samsung/include/plat/s5p6440.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s5p/include/plat/s5p6440.h 1/* linux/arch/arm/plat-samsung/include/plat/s5p6440.h
2 * 2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
diff --git a/arch/arm/plat-s5p/include/plat/s5p6450.h b/arch/arm/plat-samsung/include/plat/s5p6450.h
index 640a41c26be3..da25f9a1c54a 100644
--- a/arch/arm/plat-s5p/include/plat/s5p6450.h
+++ b/arch/arm/plat-samsung/include/plat/s5p6450.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s5p/include/plat/s5p6450.h 1/* linux/arch/arm/plat-samsung/include/plat/s5p6450.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
diff --git a/arch/arm/plat-s5p/include/plat/s5pc100.h b/arch/arm/plat-samsung/include/plat/s5pc100.h
index 5f6099dd7cad..9a21aeaaf452 100644
--- a/arch/arm/plat-s5p/include/plat/s5pc100.h
+++ b/arch/arm/plat-samsung/include/plat/s5pc100.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s5p/include/plat/s5pc100.h 1/* linux/arch/arm/plat-samsung/include/plat/s5pc100.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
diff --git a/arch/arm/plat-s5p/include/plat/s5pv210.h b/arch/arm/plat-samsung/include/plat/s5pv210.h
index 6c93a0c78100..b4bc6be77072 100644
--- a/arch/arm/plat-s5p/include/plat/s5pv210.h
+++ b/arch/arm/plat-samsung/include/plat/s5pv210.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5pv210.h 1/* linux/arch/arm/plat-samsung/include/plat/s5pv210.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 4a6552066c7e..e7b3c752e919 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -55,10 +55,6 @@ enum clk_types {
55 * cd_type == S3C_SDHCI_CD_GPIO 55 * cd_type == S3C_SDHCI_CD_GPIO
56 * @ext_cd_gpio_invert: invert values for external CD gpio line 56 * @ext_cd_gpio_invert: invert values for external CD gpio line
57 * @cfg_gpio: Configure the GPIO for a specific card bit-width 57 * @cfg_gpio: Configure the GPIO for a specific card bit-width
58 * @cfg_card: Configure the interface for a specific card and speed. This
59 * is necessary the controllers and/or GPIO blocks require the
60 * changing of driver-strength and other controls dependent on
61 * the card and speed of operation.
62 * 58 *
63 * Initialisation data specific to either the machine or the platform 59 * Initialisation data specific to either the machine or the platform
64 * for the device driver to use or call-back when configuring gpio or 60 * for the device driver to use or call-back when configuring gpio or
@@ -80,10 +76,6 @@ struct s3c_sdhci_platdata {
80 int state)); 76 int state));
81 77
82 void (*cfg_gpio)(struct platform_device *dev, int width); 78 void (*cfg_gpio)(struct platform_device *dev, int width);
83 void (*cfg_card)(struct platform_device *dev,
84 void __iomem *regbase,
85 struct mmc_ios *ios,
86 struct mmc_card *card);
87}; 79};
88 80
89/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data 81/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
@@ -139,17 +131,11 @@ extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
139#ifdef CONFIG_S3C2416_SETUP_SDHCI 131#ifdef CONFIG_S3C2416_SETUP_SDHCI
140extern char *s3c2416_hsmmc_clksrcs[4]; 132extern char *s3c2416_hsmmc_clksrcs[4];
141 133
142extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
143 void __iomem *r,
144 struct mmc_ios *ios,
145 struct mmc_card *card);
146
147static inline void s3c2416_default_sdhci0(void) 134static inline void s3c2416_default_sdhci0(void)
148{ 135{
149#ifdef CONFIG_S3C_DEV_HSMMC 136#ifdef CONFIG_S3C_DEV_HSMMC
150 s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 137 s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
151 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; 138 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
152 s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
153#endif /* CONFIG_S3C_DEV_HSMMC */ 139#endif /* CONFIG_S3C_DEV_HSMMC */
154} 140}
155 141
@@ -158,7 +144,6 @@ static inline void s3c2416_default_sdhci1(void)
158#ifdef CONFIG_S3C_DEV_HSMMC1 144#ifdef CONFIG_S3C_DEV_HSMMC1
159 s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 145 s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
160 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; 146 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
161 s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
162#endif /* CONFIG_S3C_DEV_HSMMC1 */ 147#endif /* CONFIG_S3C_DEV_HSMMC1 */
163} 148}
164 149
@@ -172,17 +157,11 @@ static inline void s3c2416_default_sdhci1(void) { }
172#ifdef CONFIG_S3C64XX_SETUP_SDHCI 157#ifdef CONFIG_S3C64XX_SETUP_SDHCI
173extern char *s3c64xx_hsmmc_clksrcs[4]; 158extern char *s3c64xx_hsmmc_clksrcs[4];
174 159
175extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
176 void __iomem *r,
177 struct mmc_ios *ios,
178 struct mmc_card *card);
179
180static inline void s3c6400_default_sdhci0(void) 160static inline void s3c6400_default_sdhci0(void)
181{ 161{
182#ifdef CONFIG_S3C_DEV_HSMMC 162#ifdef CONFIG_S3C_DEV_HSMMC
183 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 163 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
184 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 164 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
185 s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
186#endif 165#endif
187} 166}
188 167
@@ -191,7 +170,6 @@ static inline void s3c6400_default_sdhci1(void)
191#ifdef CONFIG_S3C_DEV_HSMMC1 170#ifdef CONFIG_S3C_DEV_HSMMC1
192 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 171 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
193 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 172 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
194 s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
195#endif 173#endif
196} 174}
197 175
@@ -200,21 +178,14 @@ static inline void s3c6400_default_sdhci2(void)
200#ifdef CONFIG_S3C_DEV_HSMMC2 178#ifdef CONFIG_S3C_DEV_HSMMC2
201 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 179 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
202 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; 180 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
203 s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
204#endif 181#endif
205} 182}
206 183
207extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
208 void __iomem *r,
209 struct mmc_ios *ios,
210 struct mmc_card *card);
211
212static inline void s3c6410_default_sdhci0(void) 184static inline void s3c6410_default_sdhci0(void)
213{ 185{
214#ifdef CONFIG_S3C_DEV_HSMMC 186#ifdef CONFIG_S3C_DEV_HSMMC
215 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 187 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
216 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 188 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
217 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
218#endif 189#endif
219} 190}
220 191
@@ -223,7 +194,6 @@ static inline void s3c6410_default_sdhci1(void)
223#ifdef CONFIG_S3C_DEV_HSMMC1 194#ifdef CONFIG_S3C_DEV_HSMMC1
224 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 195 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
225 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 196 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
226 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
227#endif 197#endif
228} 198}
229 199
@@ -232,7 +202,6 @@ static inline void s3c6410_default_sdhci2(void)
232#ifdef CONFIG_S3C_DEV_HSMMC2 202#ifdef CONFIG_S3C_DEV_HSMMC2
233 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; 203 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
234 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; 204 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
235 s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
236#endif 205#endif
237} 206}
238 207
@@ -251,17 +220,11 @@ static inline void s3c6400_default_sdhci2(void) { }
251#ifdef CONFIG_S5PC100_SETUP_SDHCI 220#ifdef CONFIG_S5PC100_SETUP_SDHCI
252extern char *s5pc100_hsmmc_clksrcs[4]; 221extern char *s5pc100_hsmmc_clksrcs[4];
253 222
254extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
255 void __iomem *r,
256 struct mmc_ios *ios,
257 struct mmc_card *card);
258
259static inline void s5pc100_default_sdhci0(void) 223static inline void s5pc100_default_sdhci0(void)
260{ 224{
261#ifdef CONFIG_S3C_DEV_HSMMC 225#ifdef CONFIG_S3C_DEV_HSMMC
262 s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; 226 s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
263 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; 227 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
264 s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
265#endif 228#endif
266} 229}
267 230
@@ -270,7 +233,6 @@ static inline void s5pc100_default_sdhci1(void)
270#ifdef CONFIG_S3C_DEV_HSMMC1 233#ifdef CONFIG_S3C_DEV_HSMMC1
271 s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs; 234 s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
272 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; 235 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
273 s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
274#endif 236#endif
275} 237}
276 238
@@ -279,7 +241,6 @@ static inline void s5pc100_default_sdhci2(void)
279#ifdef CONFIG_S3C_DEV_HSMMC2 241#ifdef CONFIG_S3C_DEV_HSMMC2
280 s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; 242 s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
281 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; 243 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
282 s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
283#endif 244#endif
284} 245}
285 246
@@ -295,17 +256,11 @@ static inline void s5pc100_default_sdhci2(void) { }
295#ifdef CONFIG_S5PV210_SETUP_SDHCI 256#ifdef CONFIG_S5PV210_SETUP_SDHCI
296extern char *s5pv210_hsmmc_clksrcs[4]; 257extern char *s5pv210_hsmmc_clksrcs[4];
297 258
298extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
299 void __iomem *r,
300 struct mmc_ios *ios,
301 struct mmc_card *card);
302
303static inline void s5pv210_default_sdhci0(void) 259static inline void s5pv210_default_sdhci0(void)
304{ 260{
305#ifdef CONFIG_S3C_DEV_HSMMC 261#ifdef CONFIG_S3C_DEV_HSMMC
306 s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; 262 s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
307 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; 263 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
308 s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
309#endif 264#endif
310} 265}
311 266
@@ -314,7 +269,6 @@ static inline void s5pv210_default_sdhci1(void)
314#ifdef CONFIG_S3C_DEV_HSMMC1 269#ifdef CONFIG_S3C_DEV_HSMMC1
315 s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; 270 s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
316 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; 271 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
317 s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
318#endif 272#endif
319} 273}
320 274
@@ -323,7 +277,6 @@ static inline void s5pv210_default_sdhci2(void)
323#ifdef CONFIG_S3C_DEV_HSMMC2 277#ifdef CONFIG_S3C_DEV_HSMMC2
324 s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; 278 s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
325 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; 279 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
326 s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
327#endif 280#endif
328} 281}
329 282
@@ -332,7 +285,6 @@ static inline void s5pv210_default_sdhci3(void)
332#ifdef CONFIG_S3C_DEV_HSMMC3 285#ifdef CONFIG_S3C_DEV_HSMMC3
333 s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs; 286 s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
334 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio; 287 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
335 s3c_hsmmc3_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
336#endif 288#endif
337} 289}
338 290
@@ -348,17 +300,11 @@ static inline void s5pv210_default_sdhci3(void) { }
348#ifdef CONFIG_EXYNOS4_SETUP_SDHCI 300#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
349extern char *exynos4_hsmmc_clksrcs[4]; 301extern char *exynos4_hsmmc_clksrcs[4];
350 302
351extern void exynos4_setup_sdhci_cfg_card(struct platform_device *dev,
352 void __iomem *r,
353 struct mmc_ios *ios,
354 struct mmc_card *card);
355
356static inline void exynos4_default_sdhci0(void) 303static inline void exynos4_default_sdhci0(void)
357{ 304{
358#ifdef CONFIG_S3C_DEV_HSMMC 305#ifdef CONFIG_S3C_DEV_HSMMC
359 s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs; 306 s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
360 s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio; 307 s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
361 s3c_hsmmc0_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
362#endif 308#endif
363} 309}
364 310
@@ -367,7 +313,6 @@ static inline void exynos4_default_sdhci1(void)
367#ifdef CONFIG_S3C_DEV_HSMMC1 313#ifdef CONFIG_S3C_DEV_HSMMC1
368 s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs; 314 s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
369 s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio; 315 s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
370 s3c_hsmmc1_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
371#endif 316#endif
372} 317}
373 318
@@ -376,7 +321,6 @@ static inline void exynos4_default_sdhci2(void)
376#ifdef CONFIG_S3C_DEV_HSMMC2 321#ifdef CONFIG_S3C_DEV_HSMMC2
377 s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs; 322 s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
378 s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio; 323 s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
379 s3c_hsmmc2_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
380#endif 324#endif
381} 325}
382 326
@@ -385,7 +329,6 @@ static inline void exynos4_default_sdhci3(void)
385#ifdef CONFIG_S3C_DEV_HSMMC3 329#ifdef CONFIG_S3C_DEV_HSMMC3
386 s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs; 330 s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
387 s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio; 331 s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
388 s3c_hsmmc3_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
389#endif 332#endif
390} 333}
391 334
diff --git a/arch/arm/plat-s5p/include/plat/sysmmu.h b/arch/arm/plat-samsung/include/plat/sysmmu.h
index bf5283c2a19d..5fe8ee01a5ba 100644
--- a/arch/arm/plat-s5p/include/plat/sysmmu.h
+++ b/arch/arm/plat-samsung/include/plat/sysmmu.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/sysmmu.h 1/* linux/arch/arm/plat-samsung/include/plat/sysmmu.h
2 * 2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
@@ -10,8 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#ifndef __ASM__PLAT_SYSMMU_H 13#ifndef __PLAT_SAMSUNG_SYSMMU_H
14#define __ASM__PLAT_SYSMMU_H __FILE__ 14#define __PLAT_SAMSUNG_SYSMMU_H __FILE__
15 15
16enum S5P_SYSMMU_INTERRUPT_TYPE { 16enum S5P_SYSMMU_INTERRUPT_TYPE {
17 SYSMMU_PAGEFAULT, 17 SYSMMU_PAGEFAULT,
diff --git a/arch/arm/plat-s5p/include/plat/system-reset.h b/arch/arm/plat-samsung/include/plat/system-reset.h
index f307f34e6422..a448e990964d 100644
--- a/arch/arm/plat-s5p/include/plat/system-reset.h
+++ b/arch/arm/plat-samsung/include/plat/system-reset.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s5p/include/plat/system-reset.h 1/* linux/arch/arm/plat-samsung/include/plat/system-reset.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
diff --git a/arch/arm/plat-samsung/include/plat/tv-core.h b/arch/arm/plat-samsung/include/plat/tv-core.h
new file mode 100644
index 000000000000..3bc34f3ce28f
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/tv-core.h
@@ -0,0 +1,44 @@
1/*
2 * arch/arm/plat-samsung/include/plat/tv.h
3 *
4 * Copyright 2011 Samsung Electronics Co., Ltd.
5 * Tomasz Stanislawski <t.stanislaws@samsung.com>
6 *
7 * Samsung TV driver core functions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __SAMSUNG_PLAT_TV_H
15#define __SAMSUNG_PLAT_TV_H __FILE__
16
17/*
18 * These functions are only for use with the core support code, such as
19 * the CPU-specific initialization code.
20 */
21
22/* Re-define device name to differentiate the subsystem in various SoCs. */
23static inline void s5p_hdmi_setname(char *name)
24{
25#ifdef CONFIG_S5P_DEV_TV
26 s5p_device_hdmi.name = name;
27#endif
28}
29
30static inline void s5p_mixer_setname(char *name)
31{
32#ifdef CONFIG_S5P_DEV_TV
33 s5p_device_mixer.name = name;
34#endif
35}
36
37static inline void s5p_sdo_setname(char *name)
38{
39#ifdef CONFIG_S5P_DEV_TV
40 s5p_device_sdo.name = name;
41#endif
42}
43
44#endif /* __SAMSUNG_PLAT_TV_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-samsung/include/plat/udc.h
index f63884242506..8c22d586befb 100644
--- a/arch/arm/plat-s3c24xx/include/plat/udc.h
+++ b/arch/arm/plat-samsung/include/plat/udc.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/udc.h 1/* arch/arm/plat-samsung/include/plat/udc.h
2 * 2 *
3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org> 3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
4 * 4 *
@@ -26,7 +26,7 @@ enum s3c2410_udc_cmd_e {
26 26
27struct s3c2410_udc_mach_info { 27struct s3c2410_udc_mach_info {
28 void (*udc_command)(enum s3c2410_udc_cmd_e); 28 void (*udc_command)(enum s3c2410_udc_cmd_e);
29 void (*vbus_draw)(unsigned int ma); 29 void (*vbus_draw)(unsigned int ma);
30 30
31 unsigned int pullup_pin; 31 unsigned int pullup_pin;
32 unsigned int pullup_pin_inverted; 32 unsigned int pullup_pin_inverted;
diff --git a/arch/arm/plat-s5p/include/plat/usb-phy.h b/arch/arm/plat-samsung/include/plat/usb-phy.h
index 6dd6bcfca3ce..959bcdb03a25 100644
--- a/arch/arm/plat-s5p/include/plat/usb-phy.h
+++ b/arch/arm/plat-samsung/include/plat/usb-phy.h
@@ -8,8 +8,8 @@
8 * option) any later version. 8 * option) any later version.
9 */ 9 */
10 10
11#ifndef __PLAT_S5P_USB_PHY_H 11#ifndef __PLAT_SAMSUNG_USB_PHY_H
12#define __PLAT_S5P_USB_PHY_H 12#define __PLAT_SAMSUNG_USB_PHY_H __FILE__
13 13
14enum s5p_usb_phy_type { 14enum s5p_usb_phy_type {
15 S5P_USB_PHY_DEVICE, 15 S5P_USB_PHY_DEVICE,
@@ -19,4 +19,4 @@ enum s5p_usb_phy_type {
19extern int s5p_usb_phy_init(struct platform_device *pdev, int type); 19extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
20extern int s5p_usb_phy_exit(struct platform_device *pdev, int type); 20extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
21 21
22#endif /* __PLAT_S5P_REGS_USB_PHY_H */ 22#endif /* __PLAT_SAMSUNG_USB_PHY_H */
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c
index 6de1a3825927..4c9a20734fe3 100644
--- a/arch/arm/plat-samsung/platformdata.c
+++ b/arch/arm/plat-samsung/platformdata.c
@@ -50,8 +50,6 @@ void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
50 set->max_width = pd->max_width; 50 set->max_width = pd->max_width;
51 if (pd->cfg_gpio) 51 if (pd->cfg_gpio)
52 set->cfg_gpio = pd->cfg_gpio; 52 set->cfg_gpio = pd->cfg_gpio;
53 if (pd->cfg_card)
54 set->cfg_card = pd->cfg_card;
55 if (pd->host_caps) 53 if (pd->host_caps)
56 set->host_caps |= pd->host_caps; 54 set->host_caps |= pd->host_caps;
57 if (pd->clk_type) 55 if (pd->clk_type)
diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index 96528200eb79..4be016eaa6db 100644
--- a/arch/arm/plat-samsung/pm-gpio.c
+++ b/arch/arm/plat-samsung/pm-gpio.c
@@ -28,13 +28,13 @@
28#define OFFS_DAT (0x04) 28#define OFFS_DAT (0x04)
29#define OFFS_UP (0x08) 29#define OFFS_UP (0x08)
30 30
31static void s3c_gpio_pm_1bit_save(struct s3c_gpio_chip *chip) 31static void samsung_gpio_pm_1bit_save(struct samsung_gpio_chip *chip)
32{ 32{
33 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); 33 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON);
34 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); 34 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT);
35} 35}
36 36
37static void s3c_gpio_pm_1bit_resume(struct s3c_gpio_chip *chip) 37static void samsung_gpio_pm_1bit_resume(struct samsung_gpio_chip *chip)
38{ 38{
39 void __iomem *base = chip->base; 39 void __iomem *base = chip->base;
40 u32 old_gpcon = __raw_readl(base + OFFS_CON); 40 u32 old_gpcon = __raw_readl(base + OFFS_CON);
@@ -60,12 +60,12 @@ static void s3c_gpio_pm_1bit_resume(struct s3c_gpio_chip *chip)
60 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 60 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
61} 61}
62 62
63struct s3c_gpio_pm s3c_gpio_pm_1bit = { 63struct samsung_gpio_pm samsung_gpio_pm_1bit = {
64 .save = s3c_gpio_pm_1bit_save, 64 .save = samsung_gpio_pm_1bit_save,
65 .resume = s3c_gpio_pm_1bit_resume, 65 .resume = samsung_gpio_pm_1bit_resume,
66}; 66};
67 67
68static void s3c_gpio_pm_2bit_save(struct s3c_gpio_chip *chip) 68static void samsung_gpio_pm_2bit_save(struct samsung_gpio_chip *chip)
69{ 69{
70 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); 70 chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON);
71 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); 71 chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT);
@@ -95,7 +95,7 @@ static inline int is_out(unsigned long con)
95} 95}
96 96
97/** 97/**
98 * s3c_gpio_pm_2bit_resume() - restore the given GPIO bank 98 * samsung_gpio_pm_2bit_resume() - restore the given GPIO bank
99 * @chip: The chip information to resume. 99 * @chip: The chip information to resume.
100 * 100 *
101 * Restore one of the GPIO banks that was saved during suspend. This is 101 * Restore one of the GPIO banks that was saved during suspend. This is
@@ -121,7 +121,7 @@ static inline int is_out(unsigned long con)
121 * [1] this assumes that writing to a pin DAT whilst in SFN will set the 121 * [1] this assumes that writing to a pin DAT whilst in SFN will set the
122 * state for when it is next output. 122 * state for when it is next output.
123 */ 123 */
124static void s3c_gpio_pm_2bit_resume(struct s3c_gpio_chip *chip) 124static void samsung_gpio_pm_2bit_resume(struct samsung_gpio_chip *chip)
125{ 125{
126 void __iomem *base = chip->base; 126 void __iomem *base = chip->base;
127 u32 old_gpcon = __raw_readl(base + OFFS_CON); 127 u32 old_gpcon = __raw_readl(base + OFFS_CON);
@@ -187,13 +187,13 @@ static void s3c_gpio_pm_2bit_resume(struct s3c_gpio_chip *chip)
187 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 187 chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
188} 188}
189 189
190struct s3c_gpio_pm s3c_gpio_pm_2bit = { 190struct samsung_gpio_pm samsung_gpio_pm_2bit = {
191 .save = s3c_gpio_pm_2bit_save, 191 .save = samsung_gpio_pm_2bit_save,
192 .resume = s3c_gpio_pm_2bit_resume, 192 .resume = samsung_gpio_pm_2bit_resume,
193}; 193};
194 194
195#if defined(CONFIG_ARCH_S3C64XX) || defined(CONFIG_PLAT_S5P) 195#if defined(CONFIG_ARCH_S3C64XX) || defined(CONFIG_PLAT_S5P)
196static void s3c_gpio_pm_4bit_save(struct s3c_gpio_chip *chip) 196static void samsung_gpio_pm_4bit_save(struct samsung_gpio_chip *chip)
197{ 197{
198 chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON); 198 chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON);
199 chip->pm_save[2] = __raw_readl(chip->base + OFFS_DAT); 199 chip->pm_save[2] = __raw_readl(chip->base + OFFS_DAT);
@@ -203,7 +203,7 @@ static void s3c_gpio_pm_4bit_save(struct s3c_gpio_chip *chip)
203 chip->pm_save[0] = __raw_readl(chip->base - 4); 203 chip->pm_save[0] = __raw_readl(chip->base - 4);
204} 204}
205 205
206static u32 s3c_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon) 206static u32 samsung_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon)
207{ 207{
208 u32 old, new, mask; 208 u32 old, new, mask;
209 u32 change_mask = 0x0; 209 u32 change_mask = 0x0;
@@ -242,14 +242,14 @@ static u32 s3c_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon)
242 return change_mask; 242 return change_mask;
243} 243}
244 244
245static void s3c_gpio_pm_4bit_con(struct s3c_gpio_chip *chip, int index) 245static void samsung_gpio_pm_4bit_con(struct samsung_gpio_chip *chip, int index)
246{ 246{
247 void __iomem *con = chip->base + (index * 4); 247 void __iomem *con = chip->base + (index * 4);
248 u32 old_gpcon = __raw_readl(con); 248 u32 old_gpcon = __raw_readl(con);
249 u32 gps_gpcon = chip->pm_save[index + 1]; 249 u32 gps_gpcon = chip->pm_save[index + 1];
250 u32 gpcon, mask; 250 u32 gpcon, mask;
251 251
252 mask = s3c_gpio_pm_4bit_mask(old_gpcon, gps_gpcon); 252 mask = samsung_gpio_pm_4bit_mask(old_gpcon, gps_gpcon);
253 253
254 gpcon = old_gpcon & ~mask; 254 gpcon = old_gpcon & ~mask;
255 gpcon |= gps_gpcon & mask; 255 gpcon |= gps_gpcon & mask;
@@ -257,7 +257,7 @@ static void s3c_gpio_pm_4bit_con(struct s3c_gpio_chip *chip, int index)
257 __raw_writel(gpcon, con); 257 __raw_writel(gpcon, con);
258} 258}
259 259
260static void s3c_gpio_pm_4bit_resume(struct s3c_gpio_chip *chip) 260static void samsung_gpio_pm_4bit_resume(struct samsung_gpio_chip *chip)
261{ 261{
262 void __iomem *base = chip->base; 262 void __iomem *base = chip->base;
263 u32 old_gpcon[2]; 263 u32 old_gpcon[2];
@@ -269,10 +269,10 @@ static void s3c_gpio_pm_4bit_resume(struct s3c_gpio_chip *chip)
269 old_gpcon[0] = 0; 269 old_gpcon[0] = 0;
270 old_gpcon[1] = __raw_readl(base + OFFS_CON); 270 old_gpcon[1] = __raw_readl(base + OFFS_CON);
271 271
272 s3c_gpio_pm_4bit_con(chip, 0); 272 samsung_gpio_pm_4bit_con(chip, 0);
273 if (chip->chip.ngpio > 8) { 273 if (chip->chip.ngpio > 8) {
274 old_gpcon[0] = __raw_readl(base - 4); 274 old_gpcon[0] = __raw_readl(base - 4);
275 s3c_gpio_pm_4bit_con(chip, -1); 275 samsung_gpio_pm_4bit_con(chip, -1);
276 } 276 }
277 277
278 /* Now change the configurations that require DAT,CON */ 278 /* Now change the configurations that require DAT,CON */
@@ -298,19 +298,19 @@ static void s3c_gpio_pm_4bit_resume(struct s3c_gpio_chip *chip)
298 old_gpdat, gps_gpdat); 298 old_gpdat, gps_gpdat);
299} 299}
300 300
301struct s3c_gpio_pm s3c_gpio_pm_4bit = { 301struct samsung_gpio_pm samsung_gpio_pm_4bit = {
302 .save = s3c_gpio_pm_4bit_save, 302 .save = samsung_gpio_pm_4bit_save,
303 .resume = s3c_gpio_pm_4bit_resume, 303 .resume = samsung_gpio_pm_4bit_resume,
304}; 304};
305#endif /* CONFIG_ARCH_S3C64XX || CONFIG_PLAT_S5P */ 305#endif /* CONFIG_ARCH_S3C64XX || CONFIG_PLAT_S5P */
306 306
307/** 307/**
308 * s3c_pm_save_gpio() - save gpio chip data for suspend 308 * samsung_pm_save_gpio() - save gpio chip data for suspend
309 * @ourchip: The chip for suspend. 309 * @ourchip: The chip for suspend.
310 */ 310 */
311static void s3c_pm_save_gpio(struct s3c_gpio_chip *ourchip) 311static void samsung_pm_save_gpio(struct samsung_gpio_chip *ourchip)
312{ 312{
313 struct s3c_gpio_pm *pm = ourchip->pm; 313 struct samsung_gpio_pm *pm = ourchip->pm;
314 314
315 if (pm == NULL || pm->save == NULL) 315 if (pm == NULL || pm->save == NULL)
316 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); 316 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label);
@@ -319,24 +319,24 @@ static void s3c_pm_save_gpio(struct s3c_gpio_chip *ourchip)
319} 319}
320 320
321/** 321/**
322 * s3c_pm_save_gpios() - Save the state of the GPIO banks. 322 * samsung_pm_save_gpios() - Save the state of the GPIO banks.
323 * 323 *
324 * For all the GPIO banks, save the state of each one ready for going 324 * For all the GPIO banks, save the state of each one ready for going
325 * into a suspend mode. 325 * into a suspend mode.
326 */ 326 */
327void s3c_pm_save_gpios(void) 327void samsung_pm_save_gpios(void)
328{ 328{
329 struct s3c_gpio_chip *ourchip; 329 struct samsung_gpio_chip *ourchip;
330 unsigned int gpio_nr; 330 unsigned int gpio_nr;
331 331
332 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { 332 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) {
333 ourchip = s3c_gpiolib_getchip(gpio_nr); 333 ourchip = samsung_gpiolib_getchip(gpio_nr);
334 if (!ourchip) { 334 if (!ourchip) {
335 gpio_nr++; 335 gpio_nr++;
336 continue; 336 continue;
337 } 337 }
338 338
339 s3c_pm_save_gpio(ourchip); 339 samsung_pm_save_gpio(ourchip);
340 340
341 S3C_PMDBG("%s: save %08x,%08x,%08x,%08x\n", 341 S3C_PMDBG("%s: save %08x,%08x,%08x,%08x\n",
342 ourchip->chip.label, 342 ourchip->chip.label,
@@ -351,12 +351,12 @@ void s3c_pm_save_gpios(void)
351} 351}
352 352
353/** 353/**
354 * s3c_pm_resume_gpio() - restore gpio chip data after suspend 354 * samsung_pm_resume_gpio() - restore gpio chip data after suspend
355 * @ourchip: The suspended chip. 355 * @ourchip: The suspended chip.
356 */ 356 */
357static void s3c_pm_resume_gpio(struct s3c_gpio_chip *ourchip) 357static void samsung_pm_resume_gpio(struct samsung_gpio_chip *ourchip)
358{ 358{
359 struct s3c_gpio_pm *pm = ourchip->pm; 359 struct samsung_gpio_pm *pm = ourchip->pm;
360 360
361 if (pm == NULL || pm->resume == NULL) 361 if (pm == NULL || pm->resume == NULL)
362 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); 362 S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label);
@@ -364,19 +364,19 @@ static void s3c_pm_resume_gpio(struct s3c_gpio_chip *ourchip)
364 pm->resume(ourchip); 364 pm->resume(ourchip);
365} 365}
366 366
367void s3c_pm_restore_gpios(void) 367void samsung_pm_restore_gpios(void)
368{ 368{
369 struct s3c_gpio_chip *ourchip; 369 struct samsung_gpio_chip *ourchip;
370 unsigned int gpio_nr; 370 unsigned int gpio_nr;
371 371
372 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { 372 for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) {
373 ourchip = s3c_gpiolib_getchip(gpio_nr); 373 ourchip = samsung_gpiolib_getchip(gpio_nr);
374 if (!ourchip) { 374 if (!ourchip) {
375 gpio_nr++; 375 gpio_nr++;
376 continue; 376 continue;
377 } 377 }
378 378
379 s3c_pm_resume_gpio(ourchip); 379 samsung_pm_resume_gpio(ourchip);
380 380
381 gpio_nr += ourchip->chip.ngpio; 381 gpio_nr += ourchip->chip.ngpio;
382 gpio_nr += CONFIG_S3C_GPIO_SPACE; 382 gpio_nr += CONFIG_S3C_GPIO_SPACE;
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index ae6f99834cdd..64ab65f0fdbc 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -268,8 +268,8 @@ static int s3c_pm_enter(suspend_state_t state)
268 268
269 /* save all necessary core registers not covered by the drivers */ 269 /* save all necessary core registers not covered by the drivers */
270 270
271 s3c_pm_save_gpios(); 271 samsung_pm_save_gpios();
272 s3c_pm_saved_gpios(); 272 samsung_pm_saved_gpios();
273 s3c_pm_save_uarts(); 273 s3c_pm_save_uarts();
274 s3c_pm_save_core(); 274 s3c_pm_save_core();
275 275
@@ -306,7 +306,7 @@ static int s3c_pm_enter(suspend_state_t state)
306 306
307 s3c_pm_restore_core(); 307 s3c_pm_restore_core();
308 s3c_pm_restore_uarts(); 308 s3c_pm_restore_uarts();
309 s3c_pm_restore_gpios(); 309 samsung_pm_restore_gpios();
310 s3c_pm_restored_gpios(); 310 s3c_pm_restored_gpios();
311 311
312 s3c_pm_debug_init(); 312 s3c_pm_debug_init();
diff --git a/arch/arm/plat-samsung/pwm-clock.c b/arch/arm/plat-samsung/pwm-clock.c
index f1bba88ed2f5..a35ff3bcffe4 100644
--- a/arch/arm/plat-samsung/pwm-clock.c
+++ b/arch/arm/plat-samsung/pwm-clock.c
@@ -27,7 +27,7 @@
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28 28
29#include <plat/regs-timer.h> 29#include <plat/regs-timer.h>
30#include <mach/pwm-clock.h> 30#include <plat/pwm-clock.h>
31 31
32/* Each of the timers 0 through 5 go through the following 32/* Each of the timers 0 through 5 go through the following
33 * clock tree, with the inputs depending on the timers. 33 * clock tree, with the inputs depending on the timers.
@@ -339,8 +339,17 @@ static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent)
339 unsigned long bits; 339 unsigned long bits;
340 unsigned long shift = S3C2410_TCFG1_SHIFT(id); 340 unsigned long shift = S3C2410_TCFG1_SHIFT(id);
341 341
342 unsigned long mux_tclk;
343
344 if (soc_is_s3c24xx())
345 mux_tclk = S3C2410_TCFG1_MUX_TCLK;
346 else if (soc_is_s5p6440() || soc_is_s5p6450())
347 mux_tclk = 0;
348 else
349 mux_tclk = S3C64XX_TCFG1_MUX_TCLK;
350
342 if (parent == s3c24xx_pwmclk_tclk(id)) 351 if (parent == s3c24xx_pwmclk_tclk(id))
343 bits = S3C_TCFG1_MUX_TCLK << shift; 352 bits = mux_tclk << shift;
344 else if (parent == s3c24xx_pwmclk_tdiv(id)) 353 else if (parent == s3c24xx_pwmclk_tdiv(id))
345 bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift; 354 bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift;
346 else 355 else