瀏覽代碼

Merge branch 'samsung/exynos-multiplatform' into next/multiplatform

These patches get us closer to adding multiplatform support on
the Exynos platform, they are part of a longer series of
patches.  This would get all the simple stuff out of the
way, and I don't think there is a big risk of introducing
regressions with these.

A lot of the other patches have already been merged into
subsystem trees. After this series in in arm-soc, what is
left comes down to

* The ASoC conversion to dmaengine won't make it unless someone
  who knows that code better steps up to do it right away. This
  means that we won't have audio in a 3.10 multiplatform kernel
  on Exynos, but it will still work for users that don't enable
  multiplatform.

* The irqchip (combiner), clk and clksource patches are all based
  on top   of other changesets we pulled in from your trees, so I
  would not make them part of the next/multiplatform branch. We can
  apply them on top of the next/drivers branch once they are
  tested successfully.

* A trivial patch is needed in the end to actually make
  CONFIG_ARCH_EXYNOS visible in multiplatform configurations.
  We will do that as a separate patch once everything else is
  there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 12 年之前
父節點
當前提交
56b690481c
共有 42 個文件被更改,包括 203 次插入149 次删除
  1. 1 8
      arch/arm/Kconfig
  2. 8 0
      arch/arm/Kconfig.debug
  3. 1 1
      arch/arm/configs/exynos4_defconfig
  4. 6 6
      arch/arm/include/debug/exynos.S
  5. 0 0
      arch/arm/include/debug/samsung.S
  6. 36 4
      arch/arm/mach-exynos/Kconfig
  7. 3 2
      arch/arm/mach-exynos/Makefile
  8. 6 0
      arch/arm/mach-exynos/common.c
  9. 1 0
      arch/arm/mach-exynos/dev-uart.c
  10. 4 1
      arch/arm/mach-exynos/include/mach/irqs.h
  11. 1 0
      arch/arm/mach-exynos/mach-armlex4210.c
  12. 1 0
      arch/arm/mach-exynos/mach-nuri.c
  13. 1 0
      arch/arm/mach-exynos/mach-origen.c
  14. 1 0
      arch/arm/mach-exynos/mach-smdk4x12.c
  15. 1 0
      arch/arm/mach-exynos/mach-smdkv310.c
  16. 1 1
      arch/arm/mach-exynos/setup-sdhci-gpio.c
  17. 1 1
      arch/arm/mach-s3c24xx/include/mach/debug-macro.S
  18. 1 1
      arch/arm/mach-s3c64xx/include/mach/debug-macro.S
  19. 1 1
      arch/arm/mach-s5p64x0/include/mach/debug-macro.S
  20. 1 1
      arch/arm/mach-s5pc100/include/mach/debug-macro.S
  21. 0 1
      arch/arm/mach-s5pc100/setup-sdhci-gpio.c
  22. 1 1
      arch/arm/mach-s5pv210/include/mach/debug-macro.S
  23. 0 1
      arch/arm/mach-s5pv210/setup-sdhci-gpio.c
  24. 6 1
      arch/arm/plat-samsung/Kconfig
  25. 6 2
      arch/arm/plat-samsung/Makefile
  26. 0 45
      arch/arm/plat-samsung/devs.c
  27. 5 0
      arch/arm/plat-samsung/include/plat/pm.h
  28. 1 55
      arch/arm/plat-samsung/include/plat/sdhci.h
  29. 1 0
      arch/arm/plat-samsung/irq-vic-timer.c
  30. 1 0
      arch/arm/plat-samsung/pm.c
  31. 41 1
      arch/arm/plat-samsung/s5p-dev-mfc.c
  32. 1 0
      arch/arm/plat-samsung/s5p-irq.c
  33. 1 1
      drivers/gpio/Makefile
  34. 1 1
      drivers/mmc/host/Kconfig
  35. 0 0
      drivers/mmc/host/sdhci-s3c-regs.h
  36. 2 3
      drivers/mmc/host/sdhci-s3c.c
  37. 2 2
      drivers/mtd/onenand/samsung.c
  38. 0 2
      drivers/mtd/onenand/samsung.h
  39. 1 2
      drivers/rtc/rtc-s3c.c
  40. 1 2
      drivers/rtc/rtc-s3c.h
  41. 0 2
      drivers/thermal/exynos_thermal.c
  42. 56 0
      include/linux/platform_data/mmc-sdhci-s3c.h

+ 1 - 8
arch/arm/Kconfig

@@ -776,18 +776,11 @@ config ARCH_S5PV210
 	help
 	help
 	  Samsung S5PV210/S5PC110 series based systems
 	  Samsung S5PV210/S5PC110 series based systems
 
 
-config ARCH_EXYNOS
+config ARCH_EXYNOS_SINGLE
 	bool "Samsung EXYNOS"
 	bool "Samsung EXYNOS"
-	select ARCH_HAS_CPUFREQ
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_SPARSEMEM_ENABLE
 	select ARCH_SPARSEMEM_ENABLE
-	select CLKDEV_LOOKUP
-	select CPU_V7
-	select GENERIC_CLOCKEVENTS
-	select HAVE_CLK
-	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
-	select HAVE_S3C_RTC if RTC_CLASS
 	select NEED_MACH_GPIO_H
 	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	select NEED_MACH_MEMORY_H
 	help
 	help

+ 8 - 0
arch/arm/Kconfig.debug

@@ -348,6 +348,7 @@ choice
 
 
 	config DEBUG_S3C_UART0
 	config DEBUG_S3C_UART0
 		depends on PLAT_SAMSUNG
 		depends on PLAT_SAMSUNG
+		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		bool "Use S3C UART 0 for low-level debug"
 		bool "Use S3C UART 0 for low-level debug"
 		help
 		help
 		  Say Y here if you want the debug print routines to direct
 		  Say Y here if you want the debug print routines to direct
@@ -359,6 +360,7 @@ choice
 
 
 	config DEBUG_S3C_UART1
 	config DEBUG_S3C_UART1
 		depends on PLAT_SAMSUNG
 		depends on PLAT_SAMSUNG
+		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		bool "Use S3C UART 1 for low-level debug"
 		bool "Use S3C UART 1 for low-level debug"
 		help
 		help
 		  Say Y here if you want the debug print routines to direct
 		  Say Y here if you want the debug print routines to direct
@@ -370,6 +372,7 @@ choice
 
 
 	config DEBUG_S3C_UART2
 	config DEBUG_S3C_UART2
 		depends on PLAT_SAMSUNG
 		depends on PLAT_SAMSUNG
+		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		bool "Use S3C UART 2 for low-level debug"
 		bool "Use S3C UART 2 for low-level debug"
 		help
 		help
 		  Say Y here if you want the debug print routines to direct
 		  Say Y here if you want the debug print routines to direct
@@ -381,6 +384,7 @@ choice
 
 
 	config DEBUG_S3C_UART3
 	config DEBUG_S3C_UART3
 		depends on PLAT_SAMSUNG && ARCH_EXYNOS
 		depends on PLAT_SAMSUNG && ARCH_EXYNOS
+		select DEBUG_EXYNOS_UART
 		bool "Use S3C UART 3 for low-level debug"
 		bool "Use S3C UART 3 for low-level debug"
 		help
 		help
 		  Say Y here if you want the debug print routines to direct
 		  Say Y here if you want the debug print routines to direct
@@ -510,6 +514,9 @@ choice
 
 
 endchoice
 endchoice
 
 
+config DEBUG_EXYNOS_UART
+	bool
+
 config DEBUG_IMX_UART_PORT
 config DEBUG_IMX_UART_PORT
 	int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
 	int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
 						DEBUG_IMX25_UART || \
 						DEBUG_IMX25_UART || \
@@ -607,6 +614,7 @@ config DEBUG_LL_INCLUDE
 	string
 	string
 	default "debug/bcm2835.S" if DEBUG_BCM2835
 	default "debug/bcm2835.S" if DEBUG_BCM2835
 	default "debug/cns3xxx.S" if DEBUG_CNS3XXX
 	default "debug/cns3xxx.S" if DEBUG_CNS3XXX
+	default "debug/exynos.S" if DEBUG_EXYNOS_UART
 	default "debug/icedcc.S" if DEBUG_ICEDCC
 	default "debug/icedcc.S" if DEBUG_ICEDCC
 	default "debug/imx.S" if DEBUG_IMX1_UART || \
 	default "debug/imx.S" if DEBUG_IMX1_UART || \
 				 DEBUG_IMX25_UART || \
 				 DEBUG_IMX25_UART || \

+ 1 - 1
arch/arm/configs/exynos4_defconfig

@@ -4,7 +4,7 @@ CONFIG_KALLSYMS_ALL=y
 CONFIG_MODULES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_EXYNOS=y
+CONFIG_ARCH_EXYNOS_SINGLE=y
 CONFIG_S3C_LOWLEVEL_UART_PORT=1
 CONFIG_S3C_LOWLEVEL_UART_PORT=1
 CONFIG_MACH_SMDKC210=y
 CONFIG_MACH_SMDKC210=y
 CONFIG_MACH_ARMLEX4210=y
 CONFIG_MACH_ARMLEX4210=y

+ 6 - 6
arch/arm/mach-exynos/include/mach/debug-macro.S → arch/arm/include/debug/exynos.S

@@ -1,10 +1,7 @@
-/* linux/arch/arm/mach-exynos4/include/mach/debug-macro.S
- *
+/*
  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
  *		http://www.samsung.com
  *		http://www.samsung.com
  *
  *
- * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
- *
  * This program is free software; you can redistribute it and/or modify
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  * published by the Free Software Foundation.
@@ -12,7 +9,10 @@
 
 
 /* pull in the relevant register and map files. */
 /* pull in the relevant register and map files. */
 
 
-#include <mach/map.h>
+#define S3C_ADDR_BASE   0xF6000000
+#define S3C_VA_UART	S3C_ADDR_BASE + 0x01000000
+#define EXYNOS4_PA_UART	0x13800000
+#define EXYNOS5_PA_UART	0x12C00000
 
 
 	/* note, for the boot process to work we have to keep the UART
 	/* note, for the boot process to work we have to keep the UART
 	 * virtual address aligned to an 1MiB boundary for the L1
 	 * virtual address aligned to an 1MiB boundary for the L1
@@ -36,4 +36,4 @@
 #define fifo_full fifo_full_s5pv210
 #define fifo_full fifo_full_s5pv210
 #define fifo_level fifo_level_s5pv210
 #define fifo_level fifo_level_s5pv210
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 0 - 0
arch/arm/plat-samsung/include/plat/debug-macro.S → arch/arm/include/debug/samsung.S


+ 36 - 4
arch/arm/mach-exynos/Kconfig

@@ -7,6 +7,20 @@
 
 
 # Configuration options for the EXYNOS4
 # Configuration options for the EXYNOS4
 
 
+config ARCH_EXYNOS
+	# TODO: make this visible after all drivers are converted
+	bool "Samsung EXYNOS" if ARCH_MULTI_V7 && BROKEN
+	default ARCH_EXYNOS_SINGLE
+	select ARCH_HAS_CPUFREQ
+	select CLKDEV_LOOKUP
+	select CPU_V7
+	select GENERIC_CLOCKEVENTS
+	select HAVE_CLK
+	select HAVE_S3C2410_I2C if I2C
+	select HAVE_S3C_RTC if RTC_CLASS
+	help
+	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
+
 if ARCH_EXYNOS
 if ARCH_EXYNOS
 
 
 menu "SAMSUNG EXYNOS SoCs Support"
 menu "SAMSUNG EXYNOS SoCs Support"
@@ -20,6 +34,9 @@ config ARCH_EXYNOS4
 	help
 	help
 	  Samsung EXYNOS4 SoCs based systems
 	  Samsung EXYNOS4 SoCs based systems
 
 
+config ARCH_EXYNOS4_SINGLE
+	def_bool ARCH_EXYNOS4 && ARCH_EXYNOS_SINGLE
+
 config ARCH_EXYNOS5
 config ARCH_EXYNOS5
 	bool "SAMSUNG EXYNOS5"
 	bool "SAMSUNG EXYNOS5"
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_SCU if SMP
@@ -37,7 +54,7 @@ config CPU_EXYNOS4210
 	select PM_GENERIC_DOMAINS
 	select PM_GENERIC_DOMAINS
 	select S5P_PM if PM
 	select S5P_PM if PM
 	select S5P_SLEEP if PM
 	select S5P_SLEEP if PM
-	select SAMSUNG_DMADEV
+	select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
 	help
 	help
 	  Enable EXYNOS4210 CPU support
 	  Enable EXYNOS4210 CPU support
 
 
@@ -47,7 +64,7 @@ config SOC_EXYNOS4212
 	depends on ARCH_EXYNOS4
 	depends on ARCH_EXYNOS4
 	select S5P_PM if PM
 	select S5P_PM if PM
 	select S5P_SLEEP if PM
 	select S5P_SLEEP if PM
-	select SAMSUNG_DMADEV
+	select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
 	help
 	help
 	  Enable EXYNOS4212 SoC support
 	  Enable EXYNOS4212 SoC support
 
 
@@ -55,7 +72,7 @@ config SOC_EXYNOS4412
 	bool "SAMSUNG EXYNOS4412"
 	bool "SAMSUNG EXYNOS4412"
 	default y
 	default y
 	depends on ARCH_EXYNOS4
 	depends on ARCH_EXYNOS4
-	select SAMSUNG_DMADEV
+	select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
 	help
 	help
 	  Enable EXYNOS4412 SoC support
 	  Enable EXYNOS4412 SoC support
 
 
@@ -66,7 +83,7 @@ config SOC_EXYNOS5250
 	select S5P_PM if PM
 	select S5P_PM if PM
 	select S5P_SLEEP if PM
 	select S5P_SLEEP if PM
 	select S5P_DEV_MFC
 	select S5P_DEV_MFC
-	select SAMSUNG_DMADEV
+	select SAMSUNG_DMADEV if ARCH_EXYNOS_SINGLE
 	help
 	help
 	  Enable EXYNOS5250 SoC support
 	  Enable EXYNOS5250 SoC support
 
 
@@ -87,6 +104,19 @@ config EXYNOS4_MCT
 	help
 	help
 	  Use MCT (Multi Core Timer) as kernel timers
 	  Use MCT (Multi Core Timer) as kernel timers
 
 
+config EXYNOS_ATAGS
+	bool "ATAGS based boot for EXYNOS (deprecated)"
+	depends on !ARCH_MULTIPLATFORM
+	depends on ATAGS
+	default y
+	help
+	  The EXYNOS platform is moving towards being completely probed
+	  through device tree. This enables support for board files using
+	  the traditional ATAGS boot format.
+	  Note that this option is not available for multiplatform builds.
+
+if EXYNOS_ATAGS
+
 config EXYNOS_DEV_DMA
 config EXYNOS_DEV_DMA
 	bool
 	bool
 	help
 	help
@@ -402,6 +432,8 @@ config MACH_SMDK4412
 	  Machine support for Samsung SMDK4412
 	  Machine support for Samsung SMDK4412
 endif
 endif
 
 
+endif
+
 comment "Flattened Device Tree based board for EXYNOS SoCs"
 comment "Flattened Device Tree based board for EXYNOS SoCs"
 
 
 config MACH_EXYNOS4_DT
 config MACH_EXYNOS4_DT

+ 3 - 2
arch/arm/mach-exynos/Makefile

@@ -4,6 +4,7 @@
 #		http://www.samsung.com/
 #		http://www.samsung.com/
 #
 #
 # Licensed under GPLv2
 # Licensed under GPLv2
+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
 
 
 obj-y				:=
 obj-y				:=
 obj-m				:=
 obj-m				:=
@@ -48,12 +49,12 @@ obj-$(CONFIG_MACH_EXYNOS5_DT)		+= mach-exynos5-dt.o
 # device support
 # device support
 
 
 obj-y					+= dev-uart.o
 obj-y					+= dev-uart.o
-obj-$(CONFIG_ARCH_EXYNOS4)		+= dev-audio.o
+obj-$(CONFIG_ARCH_EXYNOS4_SINGLE)	+= dev-audio.o
 obj-$(CONFIG_EXYNOS4_DEV_AHCI)		+= dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_AHCI)		+= dev-ahci.o
 obj-$(CONFIG_EXYNOS_DEV_DMA)		+= dma.o
 obj-$(CONFIG_EXYNOS_DEV_DMA)		+= dma.o
 obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI)	+= dev-ohci.o
 obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI)	+= dev-ohci.o
 
 
-obj-$(CONFIG_ARCH_EXYNOS)		+= setup-i2c0.o
+obj-$(CONFIG_ARCH_EXYNOS_SINGLE)	+= setup-i2c0.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)	+= setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)	+= setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMD0)	+= setup-fimd0.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMD0)	+= setup-fimd0.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C1)	+= setup-i2c1.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C1)	+= setup-i2c1.o

+ 6 - 0
arch/arm/mach-exynos/common.c

@@ -368,6 +368,9 @@ static void __init exynos4_map_io(void)
 	else
 	else
 		iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
 		iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
 
 
+	if (!IS_ENABLED(CONFIG_EXYNOS_ATAGS))
+		return
+
 	/* initialize device information early */
 	/* initialize device information early */
 	exynos4_default_sdhci0();
 	exynos4_default_sdhci0();
 	exynos4_default_sdhci1();
 	exynos4_default_sdhci1();
@@ -570,6 +573,8 @@ static void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 	s3c24xx_init_uartdevs("exynos4210-uart", exynos4_uart_resources, cfg, no);
 	s3c24xx_init_uartdevs("exynos4210-uart", exynos4_uart_resources, cfg, no);
 }
 }
 
 
+
+#ifdef CONFIG_EXYNOS_ATAGS
 static void __iomem *exynos_eint_base;
 static void __iomem *exynos_eint_base;
 
 
 static DEFINE_SPINLOCK(eint_lock);
 static DEFINE_SPINLOCK(eint_lock);
@@ -875,3 +880,4 @@ static int __init exynos_init_irq_eint(void)
 	return 0;
 	return 0;
 }
 }
 arch_initcall(exynos_init_irq_eint);
 arch_initcall(exynos_init_irq_eint);
+#endif

+ 1 - 0
arch/arm/mach-exynos/dev-uart.c

@@ -20,6 +20,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/irq.h>
 #include <mach/hardware.h>
 #include <mach/hardware.h>
 #include <mach/map.h>
 #include <mach/map.h>
+#include <mach/irqs.h>
 
 
 #include <plat/devs.h>
 #include <plat/devs.h>
 
 

+ 4 - 1
arch/arm/mach-exynos/include/mach/irqs.h

@@ -466,7 +466,10 @@
 #define IRQ_TIMER_BASE			(IRQ_GPIO_END + 64)
 #define IRQ_TIMER_BASE			(IRQ_GPIO_END + 64)
 
 
 /* Set the default NR_IRQS */
 /* Set the default NR_IRQS */
+#define EXYNOS_NR_IRQS			(IRQ_TIMER_BASE + IRQ_TIMER_COUNT)
 
 
-#define NR_IRQS				(IRQ_TIMER_BASE + IRQ_TIMER_COUNT)
+#ifndef CONFIG_SPARSE_IRQ
+#define NR_IRQS				EXYNOS_NR_IRQS
+#endif
 
 
 #endif /* __ASM_ARCH_IRQS_H */
 #endif /* __ASM_ARCH_IRQS_H */

+ 1 - 0
arch/arm/mach-exynos/mach-armlex4210.c

@@ -25,6 +25,7 @@
 #include <plat/regs-srom.h>
 #include <plat/regs-srom.h>
 #include <plat/sdhci.h>
 #include <plat/sdhci.h>
 
 
+#include <mach/irqs.h>
 #include <mach/map.h>
 #include <mach/map.h>
 
 
 #include "common.h"
 #include "common.h"

+ 1 - 0
arch/arm/mach-exynos/mach-nuri.c

@@ -53,6 +53,7 @@
 #include <plat/fimc-core.h>
 #include <plat/fimc-core.h>
 #include <plat/camport.h>
 #include <plat/camport.h>
 
 
+#include <mach/irqs.h>
 #include <mach/map.h>
 #include <mach/map.h>
 
 
 #include "common.h"
 #include "common.h"

+ 1 - 0
arch/arm/mach-exynos/mach-origen.c

@@ -46,6 +46,7 @@
 #include <plat/hdmi.h>
 #include <plat/hdmi.h>
 
 
 #include <mach/map.h>
 #include <mach/map.h>
+#include <mach/irqs.h>
 
 
 #include <drm/exynos_drm.h>
 #include <drm/exynos_drm.h>
 #include "common.h"
 #include "common.h"

+ 1 - 0
arch/arm/mach-exynos/mach-smdk4x12.c

@@ -39,6 +39,7 @@
 #include <plat/regs-serial.h>
 #include <plat/regs-serial.h>
 #include <plat/sdhci.h>
 #include <plat/sdhci.h>
 
 
+#include <mach/irqs.h>
 #include <mach/map.h>
 #include <mach/map.h>
 
 
 #include <drm/exynos_drm.h>
 #include <drm/exynos_drm.h>

+ 1 - 0
arch/arm/mach-exynos/mach-smdkv310.c

@@ -43,6 +43,7 @@
 #include <plat/clock.h>
 #include <plat/clock.h>
 #include <plat/hdmi.h>
 #include <plat/hdmi.h>
 
 
+#include <mach/irqs.h>
 #include <mach/map.h>
 #include <mach/map.h>
 
 
 #include <drm/exynos_drm.h>
 #include <drm/exynos_drm.h>

+ 1 - 1
arch/arm/mach-exynos/setup-sdhci-gpio.c

@@ -19,8 +19,8 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
 #include <linux/mmc/card.h>
 
 
+#include <mach/gpio.h>
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg.h>
-#include <plat/regs-sdhci.h>
 #include <plat/sdhci.h>
 #include <plat/sdhci.h>
 
 
 void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

+ 1 - 1
arch/arm/mach-s3c24xx/include/mach/debug-macro.S

@@ -98,4 +98,4 @@
 
 
 /* include the reset of the code which will do the work */
 /* include the reset of the code which will do the work */
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 1 - 1
arch/arm/mach-s3c64xx/include/mach/debug-macro.S

@@ -35,4 +35,4 @@
  * will be fine with us.
  * will be fine with us.
  */
  */
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 1 - 1
arch/arm/mach-s5p64x0/include/mach/debug-macro.S

@@ -30,4 +30,4 @@
 #endif
 #endif
 	.endm
 	.endm
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 1 - 1
arch/arm/mach-s5pc100/include/mach/debug-macro.S

@@ -36,4 +36,4 @@
  * will be fine with us.
  * will be fine with us.
  */
  */
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 0 - 1
arch/arm/mach-s5pc100/setup-sdhci-gpio.c

@@ -19,7 +19,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/card.h>
 
 
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg.h>
-#include <plat/regs-sdhci.h>
 #include <plat/sdhci.h>
 #include <plat/sdhci.h>
 
 
 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

+ 1 - 1
arch/arm/mach-s5pv210/include/mach/debug-macro.S

@@ -38,4 +38,4 @@
  * will be fine with us.
  * will be fine with us.
  */
  */
 
 
-#include <plat/debug-macro.S>
+#include <debug/samsung.S>

+ 0 - 1
arch/arm/mach-s5pv210/setup-sdhci-gpio.c

@@ -20,7 +20,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/card.h>
 
 
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg.h>
-#include <plat/regs-sdhci.h>
 #include <plat/sdhci.h>
 #include <plat/sdhci.h>
 
 
 void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

+ 6 - 1
arch/arm/plat-samsung/Kconfig

@@ -13,6 +13,10 @@ config PLAT_SAMSUNG
 	help
 	help
 	  Base platform code for all Samsung SoC based systems
 	  Base platform code for all Samsung SoC based systems
 
 
+config PLAT_SAMSUNG_SINGLE
+	def_bool PLAT_SAMSUNG && !ARCH_MULTIPLATFORM
+	
+
 config PLAT_S5P
 config PLAT_S5P
 	bool
 	bool
 	depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
 	depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
@@ -23,7 +27,7 @@ config PLAT_S5P
 	select GIC_NON_BANKED if ARCH_EXYNOS4
 	select GIC_NON_BANKED if ARCH_EXYNOS4
 	select NO_IOPORT
 	select NO_IOPORT
 	select PLAT_SAMSUNG
 	select PLAT_SAMSUNG
-	select S3C_GPIO_TRACK
+	select S3C_GPIO_TRACK if PLAT_SAMSUNG_SINGLE
 	select S5P_GPIO_DRVSTR
 	select S5P_GPIO_DRVSTR
 	select SAMSUNG_CLKSRC
 	select SAMSUNG_CLKSRC
 	select SAMSUNG_GPIOLIB_4BIT
 	select SAMSUNG_GPIOLIB_4BIT
@@ -178,6 +182,7 @@ config S5P_DEV_UART
 
 
 config S3C_ADC
 config S3C_ADC
 	bool "ADC common driver support"
 	bool "ADC common driver support"
+	depends on PLAT_SAMSUNG_SINGLE
 	help
 	help
 	  Core support for the ADC block found in the Samsung SoC systems
 	  Core support for the ADC block found in the Samsung SoC systems
 	  for drivers such as the touchscreen and hwmon to use to share
 	  for drivers such as the touchscreen and hwmon to use to share

+ 6 - 2
arch/arm/plat-samsung/Makefile

@@ -4,6 +4,9 @@
 #
 #
 # Licensed under GPLv2
 # Licensed under GPLv2
 
 
+ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include
+ccflags-$(CONFIG_ARCH_EXYNOS)	+= -I$(srctree)/arch/arm/mach-exynos/include
+
 obj-y				:=
 obj-y				:=
 obj-m				:=
 obj-m				:=
 obj-n				:= dummy.o
 obj-n				:= dummy.o
@@ -34,7 +37,7 @@ obj-$(CONFIG_S3C_ADC)	+= adc.o
 
 
 obj-y				+= platformdata.o
 obj-y				+= platformdata.o
 
 
-obj-y				+= devs.o
+obj-$(CONFIG_PLAT_SAMSUNG_SINGLE)	+= devs.o
 obj-y				+= dev-uart.o
 obj-y				+= dev-uart.o
 obj-$(CONFIG_S5P_DEV_MFC)	+= s5p-dev-mfc.o
 obj-$(CONFIG_S5P_DEV_MFC)	+= s5p-dev-mfc.o
 obj-$(CONFIG_S5P_DEV_UART)	+= s5p-dev-uart.o
 obj-$(CONFIG_S5P_DEV_UART)	+= s5p-dev-uart.o
@@ -51,9 +54,10 @@ obj-$(CONFIG_S3C_DMA)		+= dma.o s3c-dma-ops.o
 obj-$(CONFIG_SAMSUNG_DMADEV)	+= dma-ops.o
 obj-$(CONFIG_SAMSUNG_DMADEV)	+= dma-ops.o
 
 
 # PM support
 # PM support
-
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_PM)		+= pm.o
+ifdef CONFIG_PLAT_SAMSUNG_SINGLE
 obj-$(CONFIG_PM)		+= pm-gpio.o
 obj-$(CONFIG_PM)		+= pm-gpio.o
+endif
 obj-$(CONFIG_SAMSUNG_PM_CHECK)	+= pm-check.o
 obj-$(CONFIG_SAMSUNG_PM_CHECK)	+= pm-check.o
 
 
 obj-$(CONFIG_SAMSUNG_WAKEMASK)	+= wakeup-mask.o
 obj-$(CONFIG_SAMSUNG_WAKEMASK)	+= wakeup-mask.o

+ 0 - 45
arch/arm/plat-samsung/devs.c

@@ -878,51 +878,6 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
 }
 }
 #endif /* CONFIG_PLAT_S3C24XX */
 #endif /* CONFIG_PLAT_S3C24XX */
 
 
-/* MFC */
-
-#ifdef CONFIG_S5P_DEV_MFC
-static struct resource s5p_mfc_resource[] = {
-	[0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K),
-	[1] = DEFINE_RES_IRQ(IRQ_MFC),
-};
-
-struct platform_device s5p_device_mfc = {
-	.name		= "s5p-mfc",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(s5p_mfc_resource),
-	.resource	= s5p_mfc_resource,
-};
-
-/*
- * MFC hardware has 2 memory interfaces which are modelled as two separate
- * platform devices to let dma-mapping distinguish between them.
- *
- * MFC parent device (s5p_device_mfc) must be registered before memory
- * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
- */
-
-struct platform_device s5p_device_mfc_l = {
-	.name		= "s5p-mfc-l",
-	.id		= -1,
-	.dev		= {
-		.parent			= &s5p_device_mfc.dev,
-		.dma_mask		= &samsung_device_dma_mask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-struct platform_device s5p_device_mfc_r = {
-	.name		= "s5p-mfc-r",
-	.id		= -1,
-	.dev		= {
-		.parent			= &s5p_device_mfc.dev,
-		.dma_mask		= &samsung_device_dma_mask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-#endif /* CONFIG_S5P_DEV_MFC */
-
 /* MIPI CSIS */
 /* MIPI CSIS */
 
 
 #ifdef CONFIG_S5P_DEV_CSIS0
 #ifdef CONFIG_S5P_DEV_CSIS0

+ 5 - 0
arch/arm/plat-samsung/include/plat/pm.h

@@ -166,6 +166,7 @@ extern void s3c_pm_check_store(void);
  */
  */
 extern void s3c_pm_configure_extint(void);
 extern void s3c_pm_configure_extint(void);
 
 
+#ifdef CONFIG_PLAT_SAMSUNG_SINGLE
 /**
 /**
  * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
  * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
  *
  *
@@ -181,6 +182,10 @@ extern void samsung_pm_restore_gpios(void);
  * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
  * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
  */
  */
 extern void samsung_pm_save_gpios(void);
 extern void samsung_pm_save_gpios(void);
+#else
+#define samsung_pm_restore_gpios()	do { } while(0)
+#define samsung_pm_save_gpios()		do { } while(0)
+#endif
 
 
 extern void s3c_pm_save_core(void);
 extern void s3c_pm_save_core(void);
 extern void s3c_pm_restore_core(void);
 extern void s3c_pm_restore_core(void);

+ 1 - 55
arch/arm/plat-samsung/include/plat/sdhci.h

@@ -18,62 +18,9 @@
 #ifndef __PLAT_S3C_SDHCI_H
 #ifndef __PLAT_S3C_SDHCI_H
 #define __PLAT_S3C_SDHCI_H __FILE__
 #define __PLAT_S3C_SDHCI_H __FILE__
 
 
+#include <linux/platform_data/mmc-sdhci-s3c.h>
 #include <plat/devs.h>
 #include <plat/devs.h>
 
 
-struct platform_device;
-struct mmc_host;
-struct mmc_card;
-struct mmc_ios;
-
-enum cd_types {
-	S3C_SDHCI_CD_INTERNAL,	/* use mmc internal CD line */
-	S3C_SDHCI_CD_EXTERNAL,	/* use external callback */
-	S3C_SDHCI_CD_GPIO,	/* use external gpio pin for CD line */
-	S3C_SDHCI_CD_NONE,	/* no CD line, use polling to detect card */
-	S3C_SDHCI_CD_PERMANENT,	/* no CD line, card permanently wired to host */
-};
-
-/**
- * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
- * @max_width: The maximum number of data bits supported.
- * @host_caps: Standard MMC host capabilities bit field.
- * @host_caps2: The second standard MMC host capabilities bit field.
- * @cd_type: Type of Card Detection method (see cd_types enum above)
- * @ext_cd_init: Initialize external card detect subsystem. Called on
- *		 sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
- *		 notify_func argument is a callback to the sdhci-s3c driver
- *		 that triggers the card detection event. Callback arguments:
- *		 dev is pointer to platform device of the host controller,
- *		 state is new state of the card (0 - removed, 1 - inserted).
- * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
- *		 sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
- *		 notify_func argument is the same callback as for ext_cd_init.
- * @ext_cd_gpio: gpio pin used for external CD line, valid only if
- *		 cd_type == S3C_SDHCI_CD_GPIO
- * @ext_cd_gpio_invert: invert values for external CD gpio line
- * @cfg_gpio: Configure the GPIO for a specific card bit-width
- *
- * Initialisation data specific to either the machine or the platform
- * for the device driver to use or call-back when configuring gpio or
- * card speed information.
-*/
-struct s3c_sdhci_platdata {
-	unsigned int	max_width;
-	unsigned int	host_caps;
-	unsigned int	host_caps2;
-	unsigned int	pm_caps;
-	enum cd_types	cd_type;
-
-	int		ext_cd_gpio;
-	bool		ext_cd_gpio_invert;
-	int	(*ext_cd_init)(void (*notify_func)(struct platform_device *,
-						   int state));
-	int	(*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
-						      int state));
-
-	void	(*cfg_gpio)(struct platform_device *dev, int width);
-};
-
 /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
 /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
  * @pd: The default platform data for this device.
  * @pd: The default platform data for this device.
  * @set: Pointer to the platform data to fill in.
  * @set: Pointer to the platform data to fill in.
@@ -378,5 +325,4 @@ static inline void s3c_sdhci_setname(int id, char *name)
 		break;
 		break;
 	}
 	}
 }
 }
-
 #endif /* __PLAT_S3C_SDHCI_H */
 #endif /* __PLAT_S3C_SDHCI_H */

+ 1 - 0
arch/arm/plat-samsung/irq-vic-timer.c

@@ -19,6 +19,7 @@
 #include <linux/io.h>
 #include <linux/io.h>
 
 
 #include <mach/map.h>
 #include <mach/map.h>
+#include <mach/irqs.h>
 #include <plat/cpu.h>
 #include <plat/cpu.h>
 #include <plat/irq-vic-timer.h>
 #include <plat/irq-vic-timer.h>
 #include <plat/regs-timer.h>
 #include <plat/regs-timer.h>

+ 1 - 0
arch/arm/plat-samsung/pm.c

@@ -27,6 +27,7 @@
 #include <plat/regs-serial.h>
 #include <plat/regs-serial.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-irq.h>
 #include <mach/regs-irq.h>
+#include <mach/irqs.h>
 #include <asm/irq.h>
 #include <asm/irq.h>
 
 
 #include <plat/pm.h>
 #include <plat/pm.h>

+ 41 - 1
arch/arm/plat-samsung/s5p-dev-mfc.c

@@ -18,10 +18,50 @@
 #include <linux/of.h>
 #include <linux/of.h>
 
 
 #include <mach/map.h>
 #include <mach/map.h>
+#include <mach/irqs.h>
 #include <plat/devs.h>
 #include <plat/devs.h>
-#include <plat/irqs.h>
 #include <plat/mfc.h>
 #include <plat/mfc.h>
 
 
+static struct resource s5p_mfc_resource[] = {
+	[0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K),
+	[1] = DEFINE_RES_IRQ(IRQ_MFC),
+};
+
+struct platform_device s5p_device_mfc = {
+	.name		= "s5p-mfc",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(s5p_mfc_resource),
+	.resource	= s5p_mfc_resource,
+};
+
+/*
+ * MFC hardware has 2 memory interfaces which are modelled as two separate
+ * platform devices to let dma-mapping distinguish between them.
+ *
+ * MFC parent device (s5p_device_mfc) must be registered before memory
+ * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
+ */
+
+struct platform_device s5p_device_mfc_l = {
+	.name		= "s5p-mfc-l",
+	.id		= -1,
+	.dev		= {
+		.parent			= &s5p_device_mfc.dev,
+		.dma_mask		= &s5p_device_mfc_l.dev.coherent_dma_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+	},
+};
+
+struct platform_device s5p_device_mfc_r = {
+	.name		= "s5p-mfc-r",
+	.id		= -1,
+	.dev		= {
+		.parent			= &s5p_device_mfc.dev,
+		.dma_mask		= &s5p_device_mfc_r.dev.coherent_dma_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+	},
+};
+
 struct s5p_mfc_reserved_mem {
 struct s5p_mfc_reserved_mem {
 	phys_addr_t	base;
 	phys_addr_t	base;
 	unsigned long	size;
 	unsigned long	size;

+ 1 - 0
arch/arm/plat-samsung/s5p-irq.c

@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/io.h>
 #include <linux/irqchip/arm-vic.h>
 #include <linux/irqchip/arm-vic.h>
 
 
+#include <mach/irqs.h>
 #include <mach/map.h>
 #include <mach/map.h>
 #include <plat/regs-timer.h>
 #include <plat/regs-timer.h>
 #include <plat/cpu.h>
 #include <plat/cpu.h>

+ 1 - 1
drivers/gpio/Makefile

@@ -57,7 +57,7 @@ obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
 obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
 obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
 obj-$(CONFIG_GPIO_RC5T583)	+= gpio-rc5t583.o
 obj-$(CONFIG_GPIO_RC5T583)	+= gpio-rc5t583.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
-obj-$(CONFIG_PLAT_SAMSUNG)	+= gpio-samsung.o
+obj-$(CONFIG_PLAT_SAMSUNG_SINGLE)	+= gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_GPIO_SCH)		+= gpio-sch.o
 obj-$(CONFIG_GPIO_SCH)		+= gpio-sch.o
 obj-$(CONFIG_GPIO_SODAVILLE)	+= gpio-sodaville.o
 obj-$(CONFIG_GPIO_SODAVILLE)	+= gpio-sodaville.o

+ 1 - 1
drivers/mmc/host/Kconfig

@@ -180,7 +180,7 @@ config MMC_SDHCI_TEGRA
 
 
 config MMC_SDHCI_S3C
 config MMC_SDHCI_S3C
 	tristate "SDHCI support on Samsung S3C SoC"
 	tristate "SDHCI support on Samsung S3C SoC"
-	depends on MMC_SDHCI && PLAT_SAMSUNG
+	depends on MMC_SDHCI && PLAT_SAMSUNG_SINGLE
 	help
 	help
 	  This selects the Secure Digital Host Controller Interface (SDHCI)
 	  This selects the Secure Digital Host Controller Interface (SDHCI)
 	  often referrered to as the HSMMC block in some of the Samsung S3C
 	  often referrered to as the HSMMC block in some of the Samsung S3C

+ 0 - 0
arch/arm/plat-samsung/include/plat/regs-sdhci.h → drivers/mmc/host/sdhci-s3c-regs.h


+ 2 - 3
drivers/mmc/host/sdhci-s3c.c

@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/mmc-sdhci-s3c.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/clk.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/io.h>
@@ -28,9 +29,7 @@
 
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/host.h>
 
 
-#include <plat/sdhci.h>
-#include <plat/regs-sdhci.h>
-
+#include "sdhci-s3c-regs.h"
 #include "sdhci.h"
 #include "sdhci.h"
 
 
 #define MAX_BUS_CLK	(4)
 #define MAX_BUS_CLK	(4)

+ 2 - 2
drivers/mtd/onenand/samsung.c

@@ -23,11 +23,11 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/partitions.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 
 
 #include <asm/mach/flash.h>
 #include <asm/mach/flash.h>
-#include <plat/regs-onenand.h>
 
 
-#include <linux/io.h>
+#include "samsung.h"
 
 
 enum soc_type {
 enum soc_type {
 	TYPE_S3C6400,
 	TYPE_S3C6400,

+ 0 - 2
arch/arm/plat-samsung/include/plat/regs-onenand.h → drivers/mtd/onenand/samsung.h

@@ -11,8 +11,6 @@
 #ifndef __SAMSUNG_ONENAND_H__
 #ifndef __SAMSUNG_ONENAND_H__
 #define __SAMSUNG_ONENAND_H__
 #define __SAMSUNG_ONENAND_H__
 
 
-#include <mach/hardware.h>
-
 /*
 /*
  * OneNAND Controller
  * OneNAND Controller
  */
  */

+ 1 - 2
drivers/rtc/rtc-s3c.c

@@ -29,9 +29,8 @@
 #include <linux/uaccess.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/io.h>
 
 
-#include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/irq.h>
-#include <plat/regs-rtc.h>
+#include "rtc-s3c.h"
 
 
 enum s3c_cpu_type {
 enum s3c_cpu_type {
 	TYPE_S3C2410,
 	TYPE_S3C2410,

+ 1 - 2
arch/arm/plat-samsung/include/plat/regs-rtc.h → drivers/rtc/rtc-s3c.h

@@ -1,5 +1,4 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-rtc.h
- *
+/*
  * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
  * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
  *		      http://www.simtec.co.uk/products/SWLINUX/
  *		      http://www.simtec.co.uk/products/SWLINUX/
  *
  *

+ 0 - 2
drivers/thermal/exynos_thermal.c

@@ -39,8 +39,6 @@
 #include <linux/cpu_cooling.h>
 #include <linux/cpu_cooling.h>
 #include <linux/of.h>
 #include <linux/of.h>
 
 
-#include <plat/cpu.h>
-
 /* Exynos generic registers */
 /* Exynos generic registers */
 #define EXYNOS_TMU_REG_TRIMINFO		0x0
 #define EXYNOS_TMU_REG_TRIMINFO		0x0
 #define EXYNOS_TMU_REG_CONTROL		0x20
 #define EXYNOS_TMU_REG_CONTROL		0x20

+ 56 - 0
include/linux/platform_data/mmc-sdhci-s3c.h

@@ -0,0 +1,56 @@
+#ifndef __PLATFORM_DATA_SDHCI_S3C_H
+#define __PLATFORM_DATA_SDHCI_S3C_H
+
+struct platform_device;
+
+enum cd_types {
+	S3C_SDHCI_CD_INTERNAL,	/* use mmc internal CD line */
+	S3C_SDHCI_CD_EXTERNAL,	/* use external callback */
+	S3C_SDHCI_CD_GPIO,	/* use external gpio pin for CD line */
+	S3C_SDHCI_CD_NONE,	/* no CD line, use polling to detect card */
+	S3C_SDHCI_CD_PERMANENT,	/* no CD line, card permanently wired to host */
+};
+
+/**
+ * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
+ * @max_width: The maximum number of data bits supported.
+ * @host_caps: Standard MMC host capabilities bit field.
+ * @host_caps2: The second standard MMC host capabilities bit field.
+ * @cd_type: Type of Card Detection method (see cd_types enum above)
+ * @ext_cd_init: Initialize external card detect subsystem. Called on
+ *		 sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
+ *		 notify_func argument is a callback to the sdhci-s3c driver
+ *		 that triggers the card detection event. Callback arguments:
+ *		 dev is pointer to platform device of the host controller,
+ *		 state is new state of the card (0 - removed, 1 - inserted).
+ * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
+ *		 sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
+ *		 notify_func argument is the same callback as for ext_cd_init.
+ * @ext_cd_gpio: gpio pin used for external CD line, valid only if
+ *		 cd_type == S3C_SDHCI_CD_GPIO
+ * @ext_cd_gpio_invert: invert values for external CD gpio line
+ * @cfg_gpio: Configure the GPIO for a specific card bit-width
+ *
+ * Initialisation data specific to either the machine or the platform
+ * for the device driver to use or call-back when configuring gpio or
+ * card speed information.
+*/
+struct s3c_sdhci_platdata {
+	unsigned int	max_width;
+	unsigned int	host_caps;
+	unsigned int	host_caps2;
+	unsigned int	pm_caps;
+	enum cd_types	cd_type;
+
+	int		ext_cd_gpio;
+	bool		ext_cd_gpio_invert;
+	int	(*ext_cd_init)(void (*notify_func)(struct platform_device *,
+						   int state));
+	int	(*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
+						      int state));
+
+	void	(*cfg_gpio)(struct platform_device *dev, int width);
+};
+
+
+#endif /* __PLATFORM_DATA_SDHCI_S3C_H */