aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt3
-rw-r--r--arch/arm/Kconfig26
-rw-r--r--arch/arm/Kconfig.debug19
-rw-r--r--arch/arm/configs/multi_v7_defconfig3
-rw-r--r--arch/arm/configs/s3c6400_defconfig2
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig31
-rw-r--r--arch/arm/mach-s3c64xx/Makefile24
-rw-r--r--arch/arm/mach-s3c64xx/common.c5
-rw-r--r--arch/arm/mach-s3c64xx/cpuidle.c5
-rw-r--r--arch/arm/mach-s3c64xx/dev-uart.c1
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/debug-macro.S38
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h3
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/irqs.h20
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pm-core.h1
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c3
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c5
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c16
-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.c3
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/pl080.c4
-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.c2
-rw-r--r--arch/arm/plat-samsung/Kconfig5
-rw-r--r--arch/arm/plat-samsung/Makefile5
-rw-r--r--arch/arm/plat-samsung/devs.c22
-rw-r--r--arch/arm/plat-samsung/gpio-samsung.c (renamed from drivers/gpio/gpio-samsung.c)12
-rw-r--r--arch/arm/plat-samsung/init.c5
-rw-r--r--arch/arm/plat-samsung/pm.c4
-rw-r--r--drivers/gpio/Kconfig7
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/iio/adc/exynos_adc.c224
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--include/linux/platform_data/touchscreen-s3c2410.h1
-rw-r--r--sound/soc/samsung/smartq_wm8987.c76
43 files changed, 409 insertions, 205 deletions
diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index f46ca9a316a2..ccaaec6014bd 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -47,6 +47,9 @@ Required properties:
47 47
48- samsung,syscon-phandle Contains the PMU system controller node 48- samsung,syscon-phandle Contains the PMU system controller node
49 (To access the ADC_PHY register on Exynos5250/5420/5800/3250) 49 (To access the ADC_PHY register on Exynos5250/5420/5800/3250)
50Optional properties:
51- has-touchscreen: If present, indicates that a touchscreen is
52 connected an usable.
50 53
51Note: child nodes can be added for auto probing from device tree. 54Note: child nodes can be added for auto probing from device tree.
52 55
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 34e1569a11ee..97adb5eda7bb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -682,32 +682,6 @@ config ARCH_S3C24XX
682 (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or the 682 (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or the
683 Samsung SMDK2410 development board (and derivatives). 683 Samsung SMDK2410 development board (and derivatives).
684 684
685config ARCH_S3C64XX
686 bool "Samsung S3C64XX"
687 select ARCH_REQUIRE_GPIOLIB
688 select ARM_AMBA
689 select ARM_VIC
690 select ATAGS
691 select CLKDEV_LOOKUP
692 select CLKSRC_SAMSUNG_PWM
693 select COMMON_CLK_SAMSUNG
694 select CPU_V6K
695 select GENERIC_CLOCKEVENTS
696 select GPIO_SAMSUNG
697 select HAVE_S3C2410_I2C if I2C
698 select HAVE_S3C2410_WATCHDOG if WATCHDOG
699 select HAVE_TCM
700 select NO_IOPORT_MAP
701 select PLAT_SAMSUNG
702 select PM_GENERIC_DOMAINS if PM
703 select S3C_DEV_NAND
704 select S3C_GPIO_TRACK
705 select SAMSUNG_ATAGS
706 select SAMSUNG_WAKEMASK
707 select SAMSUNG_WDT_RESET
708 help
709 Samsung S3C64XX series based systems
710
711config ARCH_DAVINCI 685config ARCH_DAVINCI
712 bool "TI DaVinci" 686 bool "TI DaVinci"
713 select ARCH_HAS_HOLES_MEMORYMODEL 687 select ARCH_HAS_HOLES_MEMORYMODEL
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index bb868887c83d..3626b8ba7c0d 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -914,6 +914,7 @@ choice
914 depends on PLAT_SAMSUNG 914 depends on PLAT_SAMSUNG
915 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 915 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
916 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 916 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
917 select DEBUG_S3C64XX_UART if ARCH_S3C64XX
917 select DEBUG_S5PV210_UART if ARCH_S5PV210 918 select DEBUG_S5PV210_UART if ARCH_S5PV210
918 bool "Use Samsung S3C UART 0 for low-level debug" 919 bool "Use Samsung S3C UART 0 for low-level debug"
919 help 920 help
@@ -925,6 +926,7 @@ choice
925 depends on PLAT_SAMSUNG 926 depends on PLAT_SAMSUNG
926 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 927 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
927 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 928 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
929 select DEBUG_S3C64XX_UART if ARCH_S3C64XX
928 select DEBUG_S5PV210_UART if ARCH_S5PV210 930 select DEBUG_S5PV210_UART if ARCH_S5PV210
929 bool "Use Samsung S3C UART 1 for low-level debug" 931 bool "Use Samsung S3C UART 1 for low-level debug"
930 help 932 help
@@ -936,6 +938,7 @@ choice
936 depends on PLAT_SAMSUNG 938 depends on PLAT_SAMSUNG
937 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 939 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
938 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 940 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
941 select DEBUG_S3C64XX_UART if ARCH_S3C64XX
939 select DEBUG_S5PV210_UART if ARCH_S5PV210 942 select DEBUG_S5PV210_UART if ARCH_S5PV210
940 bool "Use Samsung S3C UART 2 for low-level debug" 943 bool "Use Samsung S3C UART 2 for low-level debug"
941 help 944 help
@@ -946,6 +949,7 @@ choice
946 config DEBUG_S3C_UART3 949 config DEBUG_S3C_UART3
947 depends on PLAT_SAMSUNG && (ARCH_EXYNOS || ARCH_S5PV210) 950 depends on PLAT_SAMSUNG && (ARCH_EXYNOS || ARCH_S5PV210)
948 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 951 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
952 select DEBUG_S3C64XX_UART if ARCH_S3C64XX
949 select DEBUG_S5PV210_UART if ARCH_S5PV210 953 select DEBUG_S5PV210_UART if ARCH_S5PV210
950 bool "Use Samsung S3C UART 3 for low-level debug" 954 bool "Use Samsung S3C UART 3 for low-level debug"
951 help 955 help
@@ -1320,6 +1324,9 @@ config DEBUG_S3C2410_UART
1320config DEBUG_S3C24XX_UART 1324config DEBUG_S3C24XX_UART
1321 bool 1325 bool
1322 1326
1327config DEBUG_S3C64XX_UART
1328 bool
1329
1323config DEBUG_S5PV210_UART 1330config DEBUG_S5PV210_UART
1324 bool 1331 bool
1325 1332
@@ -1406,7 +1413,7 @@ config DEBUG_LL_INCLUDE
1406 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0 1413 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0
1407 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1 1414 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1
1408 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4 1415 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
1409 default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART 1416 default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART || DEBUG_S3C64XX_UART
1410 default "debug/s5pv210.S" if DEBUG_S5PV210_UART 1417 default "debug/s5pv210.S" if DEBUG_S5PV210_UART
1411 default "debug/sirf.S" if DEBUG_SIRFSOC_UART 1418 default "debug/sirf.S" if DEBUG_SIRFSOC_UART
1412 default "debug/sti.S" if DEBUG_STI_UART 1419 default "debug/sti.S" if DEBUG_STI_UART
@@ -1482,6 +1489,10 @@ config DEBUG_UART_PHYS
1482 DEBUG_S3C2410_UART2) 1489 DEBUG_S3C2410_UART2)
1483 default 0x78000000 if DEBUG_CNS3XXX 1490 default 0x78000000 if DEBUG_CNS3XXX
1484 default 0x7c0003f8 if DEBUG_FOOTBRIDGE_COM1 1491 default 0x7c0003f8 if DEBUG_FOOTBRIDGE_COM1
1492 default 0x7f005000 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART0
1493 default 0x7f005400 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART1
1494 default 0x7f005800 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART2
1495 default 0x7f005c00 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART3
1485 default 0x80010000 if DEBUG_ASM9260_UART 1496 default 0x80010000 if DEBUG_ASM9260_UART
1486 default 0x80070000 if DEBUG_IMX23_UART 1497 default 0x80070000 if DEBUG_IMX23_UART
1487 default 0x80074000 if DEBUG_IMX28_UART 1498 default 0x80074000 if DEBUG_IMX28_UART
@@ -1538,6 +1549,7 @@ config DEBUG_UART_PHYS
1538 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \ 1549 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
1539 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ 1550 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
1540 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \ 1551 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
1552 DEBUG_S3C64XX_UART || \
1541 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \ 1553 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
1542 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ 1554 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
1543 DEBUG_AT91_UART 1555 DEBUG_AT91_UART
@@ -1564,8 +1576,12 @@ config DEBUG_UART_VIRT
1564 default 0xf4200000 if DEBUG_GEMINI 1576 default 0xf4200000 if DEBUG_GEMINI
1565 default 0xf6200000 if DEBUG_PXA_UART1 1577 default 0xf6200000 if DEBUG_PXA_UART1
1566 default 0xf7000000 if DEBUG_SUN9I_UART0 1578 default 0xf7000000 if DEBUG_SUN9I_UART0
1579 default 0xf7000000 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART0
1567 default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \ 1580 default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
1568 DEBUG_S3C2410_UART0) 1581 DEBUG_S3C2410_UART0)
1582 default 0xf7000400 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART1
1583 default 0xf7000800 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART2
1584 default 0xf7000c00 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART3
1569 default 0xf7004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \ 1585 default 0xf7004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \
1570 DEBUG_S3C2410_UART1) 1586 DEBUG_S3C2410_UART1)
1571 default 0xf7008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ 1587 default 0xf7008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \
@@ -1629,6 +1645,7 @@ config DEBUG_UART_VIRT
1629 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ 1645 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
1630 DEBUG_NETX_UART || \ 1646 DEBUG_NETX_UART || \
1631 DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ 1647 DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
1648 DEBUG_S3C64XX_UART || \
1632 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \ 1649 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
1633 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 1650 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
1634 1651
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 69a22fdb52a5..181f269c7f3b 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -11,6 +11,9 @@ CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y 11CONFIG_MODULE_UNLOAD=y
12CONFIG_PARTITION_ADVANCED=y 12CONFIG_PARTITION_ADVANCED=y
13CONFIG_CMDLINE_PARTITION=y 13CONFIG_CMDLINE_PARTITION=y
14CONFIG_ARCH_MULTI_V7=y
15# CONFIG_ARCH_MULTI_V5 is not set
16# CONFIG_ARCH_MULTI_V4 is not set
14CONFIG_ARCH_VIRT=y 17CONFIG_ARCH_VIRT=y
15CONFIG_ARCH_ALPINE=y 18CONFIG_ARCH_ALPINE=y
16CONFIG_ARCH_MVEBU=y 19CONFIG_ARCH_MVEBU=y
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index e2f9fa5bb54b..e0f66936ae02 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -5,6 +5,8 @@ CONFIG_KALLSYMS_ALL=y
5CONFIG_MODULES=y 5CONFIG_MODULES=y
6CONFIG_MODULE_UNLOAD=y 6CONFIG_MODULE_UNLOAD=y
7# CONFIG_BLK_DEV_BSG is not set 7# CONFIG_BLK_DEV_BSG is not set
8CONFIG_ARCH_MULTI_V6=y
9# CONFIG_ARCH_MULTI_V7 is not set
8CONFIG_ARCH_S3C64XX=y 10CONFIG_ARCH_S3C64XX=y
9CONFIG_S3C_BOOT_ERROR_RESET=y 11CONFIG_S3C_BOOT_ERROR_RESET=y
10CONFIG_MACH_SMDK6400=y 12CONFIG_MACH_SMDK6400=y
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 28c7097e8506..7c0c420c3016 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -2,6 +2,26 @@
2# Simtec Electronics, Ben Dooks <ben@simtec.co.uk> 2# Simtec Electronics, Ben Dooks <ben@simtec.co.uk>
3# 3#
4# Licensed under GPLv2 4# Licensed under GPLv2
5menuconfig ARCH_S3C64XX
6 bool "Samsung S3C64XX" if ARCH_MULTI_V6
7 select ARCH_REQUIRE_GPIOLIB
8 select ARM_AMBA
9 select ARM_VIC
10 select CLKSRC_SAMSUNG_PWM
11 select COMMON_CLK_SAMSUNG
12 select GPIO_SAMSUNG if ATAGS
13 select HAVE_S3C2410_I2C if I2C
14 select HAVE_S3C2410_WATCHDOG if WATCHDOG
15 select HAVE_TCM
16 select PLAT_SAMSUNG
17 select PM_GENERIC_DOMAINS if PM
18 select S3C_DEV_NAND if ATAGS
19 select S3C_GPIO_TRACK if ATAGS
20 select SAMSUNG_ATAGS if ATAGS
21 select SAMSUNG_WAKEMASK if PM
22 select SAMSUNG_WDT_RESET
23 help
24 Samsung S3C64XX series based systems
5 25
6if ARCH_S3C64XX 26if ARCH_S3C64XX
7 27
@@ -90,6 +110,7 @@ config S3C64XX_SETUP_USB_PHY
90 110
91config MACH_SMDK6400 111config MACH_SMDK6400
92 bool "SMDK6400" 112 bool "SMDK6400"
113 depends on ATAGS
93 select CPU_S3C6400 114 select CPU_S3C6400
94 select S3C64XX_SETUP_SDHCI 115 select S3C64XX_SETUP_SDHCI
95 select S3C_DEV_HSMMC1 116 select S3C_DEV_HSMMC1
@@ -100,6 +121,7 @@ config MACH_SMDK6400
100 121
101config MACH_ANW6410 122config MACH_ANW6410
102 bool "A&W6410" 123 bool "A&W6410"
124 depends on ATAGS
103 select CPU_S3C6410 125 select CPU_S3C6410
104 select S3C64XX_SETUP_FB_24BPP 126 select S3C64XX_SETUP_FB_24BPP
105 select S3C_DEV_FB 127 select S3C_DEV_FB
@@ -108,6 +130,7 @@ config MACH_ANW6410
108 130
109config MACH_MINI6410 131config MACH_MINI6410
110 bool "MINI6410" 132 bool "MINI6410"
133 depends on ATAGS
111 select CPU_S3C6410 134 select CPU_S3C6410
112 select S3C64XX_SETUP_FB_24BPP 135 select S3C64XX_SETUP_FB_24BPP
113 select S3C64XX_SETUP_SDHCI 136 select S3C64XX_SETUP_SDHCI
@@ -123,6 +146,7 @@ config MACH_MINI6410
123 146
124config MACH_REAL6410 147config MACH_REAL6410
125 bool "REAL6410" 148 bool "REAL6410"
149 depends on ATAGS
126 select CPU_S3C6410 150 select CPU_S3C6410
127 select S3C64XX_SETUP_FB_24BPP 151 select S3C64XX_SETUP_FB_24BPP
128 select S3C64XX_SETUP_SDHCI 152 select S3C64XX_SETUP_SDHCI
@@ -138,6 +162,7 @@ config MACH_REAL6410
138 162
139config MACH_SMDK6410 163config MACH_SMDK6410
140 bool "SMDK6410" 164 bool "SMDK6410"
165 depends on ATAGS
141 select CPU_S3C6410 166 select CPU_S3C6410
142 select HAVE_S3C2410_WATCHDOG if WATCHDOG 167 select HAVE_S3C2410_WATCHDOG if WATCHDOG
143 select S3C64XX_SETUP_FB_24BPP 168 select S3C64XX_SETUP_FB_24BPP
@@ -225,6 +250,7 @@ config SMDK6410_WM1192_EV1
225 250
226config MACH_NCP 251config MACH_NCP
227 bool "NCP" 252 bool "NCP"
253 depends on ATAGS
228 select CPU_S3C6410 254 select CPU_S3C6410
229 select S3C64XX_SETUP_I2C1 255 select S3C64XX_SETUP_I2C1
230 select S3C_DEV_HSMMC1 256 select S3C_DEV_HSMMC1
@@ -234,6 +260,7 @@ config MACH_NCP
234 260
235config MACH_HMT 261config MACH_HMT
236 bool "Airgoo HMT" 262 bool "Airgoo HMT"
263 depends on ATAGS
237 select CPU_S3C6410 264 select CPU_S3C6410
238 select S3C64XX_SETUP_FB_24BPP 265 select S3C64XX_SETUP_FB_24BPP
239 select S3C_DEV_FB 266 select S3C_DEV_FB
@@ -265,18 +292,21 @@ config MACH_SMARTQ
265 292
266config MACH_SMARTQ5 293config MACH_SMARTQ5
267 bool "SmartQ 5" 294 bool "SmartQ 5"
295 depends on ATAGS
268 select MACH_SMARTQ 296 select MACH_SMARTQ
269 help 297 help
270 Machine support for the SmartQ 5 298 Machine support for the SmartQ 5
271 299
272config MACH_SMARTQ7 300config MACH_SMARTQ7
273 bool "SmartQ 7" 301 bool "SmartQ 7"
302 depends on ATAGS
274 select MACH_SMARTQ 303 select MACH_SMARTQ
275 help 304 help
276 Machine support for the SmartQ 7 305 Machine support for the SmartQ 7
277 306
278config MACH_WLF_CRAGG_6410 307config MACH_WLF_CRAGG_6410
279 bool "Wolfson Cragganmore 6410" 308 bool "Wolfson Cragganmore 6410"
309 depends on ATAGS
280 depends on I2C=y 310 depends on I2C=y
281 select CPU_S3C6410 311 select CPU_S3C6410
282 select LEDS_GPIO_REGISTER 312 select LEDS_GPIO_REGISTER
@@ -310,7 +340,6 @@ config MACH_S3C64XX_DT
310 select CPU_S3C6410 340 select CPU_S3C6410
311 select PINCTRL 341 select PINCTRL
312 select PINCTRL_S3C64XX 342 select PINCTRL_S3C64XX
313 select USE_OF
314 help 343 help
315 Machine support for Samsung S3C6400/S3C6410 machines with Device Tree 344 Machine support for Samsung S3C6400/S3C6410 machines with Device Tree
316 enabled. 345 enabled.
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index bb233f342f31..256cd5b40c60 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -5,21 +5,25 @@
5# 5#
6# Licensed under GPLv2 6# Licensed under GPLv2
7 7
8# Core 8ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
9 9asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
10obj-y += common.o
11
12# Core support
13
14obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
15obj-$(CONFIG_CPU_S3C6410) += s3c6410.o
16 10
17# PM 11# PM
18 12
19obj-$(CONFIG_PM) += pm.o 13obj-$(CONFIG_PM) += pm.o
20obj-$(CONFIG_PM_SLEEP) += irq-pm.o sleep.o 14obj-$(CONFIG_PM_SLEEP) += sleep.o
21obj-$(CONFIG_CPU_IDLE) += cpuidle.o 15obj-$(CONFIG_CPU_IDLE) += cpuidle.o
22 16
17ifdef CONFIG_SAMSUNG_ATAGS
18
19obj-$(CONFIG_PM_SLEEP) += irq-pm.o
20
21# Core
22
23obj-y += common.o
24obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
25obj-$(CONFIG_CPU_S3C6410) += s3c6410.o
26
23# DMA support 27# DMA support
24 28
25obj-$(CONFIG_S3C64XX_PL080) += pl080.o 29obj-$(CONFIG_S3C64XX_PL080) += pl080.o
@@ -55,4 +59,6 @@ obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o
55obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o 59obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
56obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 60obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
57obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o 61obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o
62endif
63
58obj-$(CONFIG_MACH_S3C64XX_DT) += mach-s3c64xx-dt.o 64obj-$(CONFIG_MACH_S3C64XX_DT) += mach-s3c64xx-dt.o
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index ddb30b8434c5..7c66ce1a6bb6 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -39,6 +39,7 @@
39#include <asm/system_misc.h> 39#include <asm/system_misc.h>
40 40
41#include <mach/map.h> 41#include <mach/map.h>
42#include <mach/irqs.h>
42#include <mach/hardware.h> 43#include <mach/hardware.h>
43#include <mach/regs-gpio.h> 44#include <mach/regs-gpio.h>
44#include <mach/gpio-samsung.h> 45#include <mach/gpio-samsung.h>
@@ -208,7 +209,7 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
208static __init int s3c64xx_dev_init(void) 209static __init int s3c64xx_dev_init(void)
209{ 210{
210 /* Not applicable when using DT. */ 211 /* Not applicable when using DT. */
211 if (of_have_populated_dt()) 212 if (of_have_populated_dt() || !soc_is_s3c64xx())
212 return 0; 213 return 0;
213 214
214 subsys_system_register(&s3c64xx_subsys, NULL); 215 subsys_system_register(&s3c64xx_subsys, NULL);
@@ -413,7 +414,7 @@ static int __init s3c64xx_init_irq_eint(void)
413 int irq; 414 int irq;
414 415
415 /* On DT-enabled systems EINTs are handled by pinctrl-s3c64xx driver. */ 416 /* On DT-enabled systems EINTs are handled by pinctrl-s3c64xx driver. */
416 if (of_have_populated_dt()) 417 if (of_have_populated_dt() || !soc_is_s3c64xx())
417 return -ENODEV; 418 return -ENODEV;
418 419
419 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { 420 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c
index 93aa8cb70195..5322db51150e 100644
--- a/arch/arm/mach-s3c64xx/cpuidle.c
+++ b/arch/arm/mach-s3c64xx/cpuidle.c
@@ -18,6 +18,7 @@
18 18
19#include <asm/cpuidle.h> 19#include <asm/cpuidle.h>
20 20
21#include <plat/cpu.h>
21#include <mach/map.h> 22#include <mach/map.h>
22 23
23#include "regs-sys.h" 24#include "regs-sys.h"
@@ -57,6 +58,8 @@ static struct cpuidle_driver s3c64xx_cpuidle_driver = {
57 58
58static int __init s3c64xx_init_cpuidle(void) 59static int __init s3c64xx_init_cpuidle(void)
59{ 60{
60 return cpuidle_register(&s3c64xx_cpuidle_driver, NULL); 61 if (soc_is_s3c64xx())
62 return cpuidle_register(&s3c64xx_cpuidle_driver, NULL);
63 return 0;
61} 64}
62device_initcall(s3c64xx_init_cpuidle); 65device_initcall(s3c64xx_init_cpuidle);
diff --git a/arch/arm/mach-s3c64xx/dev-uart.c b/arch/arm/mach-s3c64xx/dev-uart.c
index 46e18d77ea93..a0b4f0329811 100644
--- a/arch/arm/mach-s3c64xx/dev-uart.c
+++ b/arch/arm/mach-s3c64xx/dev-uart.c
@@ -23,6 +23,7 @@
23#include <asm/mach/irq.h> 23#include <asm/mach/irq.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/map.h> 25#include <mach/map.h>
26#include <mach/irqs.h>
26 27
27#include <plat/devs.h> 28#include <plat/devs.h>
28 29
diff --git a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
deleted file mode 100644
index c9b95325b672..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,38 +0,0 @@
1/* arch/arm/mach-s3c6400/include/mach/debug-macro.S
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
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/* pull in the relevant register and map files. */
14
15#include <linux/serial_s3c.h>
16#include <mach/map.h>
17
18 /* note, for the boot process to work we have to keep the UART
19 * virtual address aligned to an 1MiB boundary for the L1
20 * mapping the head code makes. We keep the UART virtual address
21 * aligned and add in the offset when we load the value here.
22 */
23
24 .macro addruart, rp, rv, tmp
25 ldr \rp, = S3C_PA_UART
26 ldr \rv, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
27#if CONFIG_DEBUG_S3C_UART != 0
28 add \rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
29 add \rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
30#endif
31 .endm
32
33/* include the reset of the code which will do the work, we're only
34 * compiling for a single cpu processor type so the default of s3c2440
35 * will be fine with us.
36 */
37
38#include <debug/samsung.S>
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h b/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
index 9c81fac3b2d5..1d3636512e33 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
@@ -14,6 +14,8 @@
14#ifndef GPIO_SAMSUNG_S3C64XX_H 14#ifndef GPIO_SAMSUNG_S3C64XX_H
15#define GPIO_SAMSUNG_S3C64XX_H 15#define GPIO_SAMSUNG_S3C64XX_H
16 16
17#ifdef CONFIG_GPIO_SAMSUNG
18
17/* GPIO bank sizes */ 19/* GPIO bank sizes */
18#define S3C64XX_GPIO_A_NR (8) 20#define S3C64XX_GPIO_A_NR (8)
19#define S3C64XX_GPIO_B_NR (7) 21#define S3C64XX_GPIO_B_NR (7)
@@ -90,5 +92,6 @@ enum s3c_gpio_number {
90/* define the number of gpios we need to the one after the GPQ() range */ 92/* define the number of gpios we need to the one after the GPQ() range */
91#define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) 93#define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
92 94
95#endif /* GPIO_SAMSUNG */
93#endif /* GPIO_SAMSUNG_S3C64XX_H */ 96#endif /* GPIO_SAMSUNG_S3C64XX_H */
94 97
diff --git a/arch/arm/mach-s3c64xx/include/mach/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h
index 67bbd1dd04c2..3ceb00b5de07 100644
--- a/arch/arm/mach-s3c64xx/include/mach/irqs.h
+++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h
@@ -156,25 +156,11 @@
156 156
157#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no)) 157#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no))
158 158
159/* Define a group of interrupts for board-specific use (eg, for MFD 159/* Some boards have their own IRQs behind this */
160 * interrupt controllers). */
161#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) 160#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1)
162 161
163#ifdef CONFIG_MACH_WLF_CRAGG_6410 162/* Set the default nr_irqs, boards can override if necessary */
164#define IRQ_BOARD_NR 160 163#define S3C64XX_NR_IRQS IRQ_BOARD_START
165#elif defined(CONFIG_SMDK6410_WM1190_EV1)
166#define IRQ_BOARD_NR 64
167#elif defined(CONFIG_SMDK6410_WM1192_EV1)
168#define IRQ_BOARD_NR 64
169#else
170#define IRQ_BOARD_NR 16
171#endif
172
173#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR)
174
175/* Set the default NR_IRQS */
176
177#define NR_IRQS (IRQ_BOARD_END + 1)
178 164
179/* Compatibility */ 165/* Compatibility */
180 166
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index a30a1e3ffc6a..32d2ff54f82d 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -18,6 +18,7 @@
18#include <linux/serial_s3c.h> 18#include <linux/serial_s3c.h>
19 19
20#include <mach/regs-gpio.h> 20#include <mach/regs-gpio.h>
21#include <mach/regs-clock.h>
21 22
22static inline void s3c_pm_debug_init_uart(void) 23static inline void s3c_pm_debug_init_uart(void)
23{ 24{
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index ae4ea7601f60..0bbf1faaee42 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -113,7 +113,7 @@ static struct syscore_ops s3c64xx_irq_syscore_ops = {
113static __init int s3c64xx_syscore_init(void) 113static __init int s3c64xx_syscore_init(void)
114{ 114{
115 /* Appropriate drivers (pinctrl, uart) handle this when using DT. */ 115 /* Appropriate drivers (pinctrl, uart) handle this when using DT. */
116 if (of_have_populated_dt()) 116 if (of_have_populated_dt() || !soc_is_s3c64xx())
117 return 0; 117 return 0;
118 118
119 register_syscore_ops(&s3c64xx_irq_syscore_ops); 119 register_syscore_ops(&s3c64xx_irq_syscore_ops);
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 6224c67f5061..347ce6009a8c 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -47,6 +47,7 @@
47 47
48#include <plat/devs.h> 48#include <plat/devs.h>
49#include <plat/cpu.h> 49#include <plat/cpu.h>
50#include <mach/irqs.h>
50#include <mach/regs-gpio.h> 51#include <mach/regs-gpio.h>
51#include <mach/gpio-samsung.h> 52#include <mach/gpio-samsung.h>
52#include <plat/samsung-time.h> 53#include <plat/samsung-time.h>
@@ -229,7 +230,7 @@ static void __init anw6410_machine_init(void)
229MACHINE_START(ANW6410, "A&W6410") 230MACHINE_START(ANW6410, "A&W6410")
230 /* Maintainer: Kwangwoo Lee <kwangwoo.lee@gmail.com> */ 231 /* Maintainer: Kwangwoo Lee <kwangwoo.lee@gmail.com> */
231 .atag_offset = 0x100, 232 .atag_offset = 0x100,
232 233 .nr_irqs = S3C64XX_NR_IRQS,
233 .init_irq = s3c6410_init_irq, 234 .init_irq = s3c6410_init_irq,
234 .map_io = anw6410_map_io, 235 .map_io = anw6410_map_io,
235 .init_machine = anw6410_machine_init, 236 .init_machine = anw6410_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 9c00d83f7151..571f95cc5a53 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -29,6 +29,9 @@
29 29
30#include <linux/platform_data/spi-s3c64xx.h> 30#include <linux/platform_data/spi-s3c64xx.h>
31 31
32#include <plat/cpu.h>
33#include <mach/irqs.h>
34
32#include "crag6410.h" 35#include "crag6410.h"
33 36
34static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = { 37static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = {
@@ -399,6 +402,9 @@ static struct i2c_driver wlf_gf_module_driver = {
399 402
400static int __init wlf_gf_module_register(void) 403static int __init wlf_gf_module_register(void)
401{ 404{
405 if (!soc_is_s3c64xx())
406 return 0;
407
402 return i2c_add_driver(&wlf_gf_module_driver); 408 return i2c_add_driver(&wlf_gf_module_driver);
403} 409}
404device_initcall(wlf_gf_module_register); 410device_initcall(wlf_gf_module_register);
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index f776adcdaee8..a237b9b117b5 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -52,6 +52,7 @@
52#include <mach/map.h> 52#include <mach/map.h>
53#include <mach/regs-gpio.h> 53#include <mach/regs-gpio.h>
54#include <mach/gpio-samsung.h> 54#include <mach/gpio-samsung.h>
55#include <mach/irqs.h>
55 56
56#include <plat/fb.h> 57#include <plat/fb.h>
57#include <plat/sdhci.h> 58#include <plat/sdhci.h>
@@ -860,6 +861,7 @@ static void __init crag6410_machine_init(void)
860MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410") 861MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
861 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */ 862 /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */
862 .atag_offset = 0x100, 863 .atag_offset = 0x100,
864 .nr_irqs = S3C64XX_NR_IRQS,
863 .init_irq = s3c6410_init_irq, 865 .init_irq = s3c6410_init_irq,
864 .map_io = crag6410_map_io, 866 .map_io = crag6410_map_io,
865 .init_machine = crag6410_machine_init, 867 .init_machine = crag6410_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 816b39d1e6d1..bc7dc1fcbf7d 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -31,6 +31,7 @@
31#include <video/samsung_fimd.h> 31#include <video/samsung_fimd.h>
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/map.h> 33#include <mach/map.h>
34#include <mach/irqs.h>
34 35
35#include <asm/irq.h> 36#include <asm/irq.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
@@ -279,6 +280,7 @@ static void __init hmt_machine_init(void)
279MACHINE_START(HMT, "Airgoo-HMT") 280MACHINE_START(HMT, "Airgoo-HMT")
280 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */ 281 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */
281 .atag_offset = 0x100, 282 .atag_offset = 0x100,
283 .nr_irqs = S3C64XX_NR_IRQS,
282 .init_irq = s3c6410_init_irq, 284 .init_irq = s3c6410_init_irq,
283 .map_io = hmt_map_io, 285 .map_io = hmt_map_io,
284 .init_machine = hmt_machine_init, 286 .init_machine = hmt_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index ab61af50bfb9..ae999fb3fe6d 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -41,6 +41,7 @@
41#include <linux/platform_data/mmc-sdhci-s3c.h> 41#include <linux/platform_data/mmc-sdhci-s3c.h>
42#include <plat/sdhci.h> 42#include <plat/sdhci.h>
43#include <linux/platform_data/touchscreen-s3c2410.h> 43#include <linux/platform_data/touchscreen-s3c2410.h>
44#include <mach/irqs.h>
44 45
45#include <video/platform_lcd.h> 46#include <video/platform_lcd.h>
46#include <video/samsung_fimd.h> 47#include <video/samsung_fimd.h>
@@ -233,7 +234,6 @@ static struct platform_device *mini6410_devices[] __initdata = {
233 &s3c_device_fb, 234 &s3c_device_fb,
234 &mini6410_lcd_powerdev, 235 &mini6410_lcd_powerdev,
235 &s3c_device_adc, 236 &s3c_device_adc,
236 &s3c_device_ts,
237}; 237};
238 238
239static void __init mini6410_map_io(void) 239static void __init mini6410_map_io(void)
@@ -332,7 +332,7 @@ static void __init mini6410_machine_init(void)
332 s3c_nand_set_platdata(&mini6410_nand_info); 332 s3c_nand_set_platdata(&mini6410_nand_info);
333 s3c_fb_set_platdata(&mini6410_lcd_pdata[features.lcd_index]); 333 s3c_fb_set_platdata(&mini6410_lcd_pdata[features.lcd_index]);
334 s3c_sdhci1_set_platdata(&mini6410_hsmmc1_pdata); 334 s3c_sdhci1_set_platdata(&mini6410_hsmmc1_pdata);
335 s3c24xx_ts_set_platdata(NULL); 335 s3c64xx_ts_set_platdata(NULL);
336 336
337 /* configure nCS1 width to 16 bits */ 337 /* configure nCS1 width to 16 bits */
338 338
@@ -363,6 +363,7 @@ static void __init mini6410_machine_init(void)
363MACHINE_START(MINI6410, "MINI6410") 363MACHINE_START(MINI6410, "MINI6410")
364 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */ 364 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
365 .atag_offset = 0x100, 365 .atag_offset = 0x100,
366 .nr_irqs = S3C64XX_NR_IRQS,
366 .init_irq = s3c6410_init_irq, 367 .init_irq = s3c6410_init_irq,
367 .map_io = mini6410_map_io, 368 .map_io = mini6410_map_io,
368 .init_machine = mini6410_machine_init, 369 .init_machine = mini6410_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 80cb1446f69f..23baaa04318c 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -31,6 +31,7 @@
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
33 33
34#include <mach/irqs.h>
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35#include <mach/map.h> 36#include <mach/map.h>
36 37
@@ -100,6 +101,7 @@ static void __init ncp_machine_init(void)
100MACHINE_START(NCP, "NCP") 101MACHINE_START(NCP, "NCP")
101 /* Maintainer: Samsung Electronics */ 102 /* Maintainer: Samsung Electronics */
102 .atag_offset = 0x100, 103 .atag_offset = 0x100,
104 .nr_irqs = S3C64XX_NR_IRQS,
103 .init_irq = s3c6410_init_irq, 105 .init_irq = s3c6410_init_irq,
104 .map_io = ncp_map_io, 106 .map_io = ncp_map_io,
105 .init_machine = ncp_machine_init, 107 .init_machine = ncp_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 85fa9598b980..4e240ffa7ac7 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -33,6 +33,7 @@
33#include <mach/map.h> 33#include <mach/map.h>
34#include <mach/regs-gpio.h> 34#include <mach/regs-gpio.h>
35#include <mach/gpio-samsung.h> 35#include <mach/gpio-samsung.h>
36#include <mach/irqs.h>
36 37
37#include <plat/adc.h> 38#include <plat/adc.h>
38#include <plat/cpu.h> 39#include <plat/cpu.h>
@@ -202,7 +203,6 @@ static struct platform_device *real6410_devices[] __initdata = {
202 &s3c_device_fb, 203 &s3c_device_fb,
203 &s3c_device_nand, 204 &s3c_device_nand,
204 &s3c_device_adc, 205 &s3c_device_adc,
205 &s3c_device_ts,
206 &s3c_device_ohci, 206 &s3c_device_ohci,
207}; 207};
208 208
@@ -301,7 +301,7 @@ static void __init real6410_machine_init(void)
301 301
302 s3c_fb_set_platdata(&real6410_lcd_pdata[features.lcd_index]); 302 s3c_fb_set_platdata(&real6410_lcd_pdata[features.lcd_index]);
303 s3c_nand_set_platdata(&real6410_nand_info); 303 s3c_nand_set_platdata(&real6410_nand_info);
304 s3c24xx_ts_set_platdata(NULL); 304 s3c64xx_ts_set_platdata(NULL);
305 305
306 /* configure nCS1 width to 16 bits */ 306 /* configure nCS1 width to 16 bits */
307 307
@@ -331,7 +331,7 @@ static void __init real6410_machine_init(void)
331MACHINE_START(REAL6410, "REAL6410") 331MACHINE_START(REAL6410, "REAL6410")
332 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */ 332 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
333 .atag_offset = 0x100, 333 .atag_offset = 0x100,
334 334 .nr_irqs = S3C64XX_NR_IRQS,
335 .init_irq = s3c6410_init_irq, 335 .init_irq = s3c6410_init_irq,
336 .map_io = real6410_map_io, 336 .map_io = real6410_map_io,
337 .init_machine = real6410_machine_init, 337 .init_machine = real6410_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index acdfb5fac40f..936a63fc68d5 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -12,6 +12,7 @@
12#include <linux/delay.h> 12#include <linux/delay.h>
13#include <linux/fb.h> 13#include <linux/fb.h>
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/gpio/machine.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17#include <linux/pwm.h> 18#include <linux/pwm.h>
@@ -252,7 +253,6 @@ static struct platform_device *smartq_devices[] __initdata = {
252 &s3c_device_ohci, 253 &s3c_device_ohci,
253 &s3c_device_rtc, 254 &s3c_device_rtc,
254 &samsung_device_pwm, 255 &samsung_device_pwm,
255 &s3c_device_ts,
256 &s3c_device_usb_hsotg, 256 &s3c_device_usb_hsotg,
257 &s3c64xx_device_iis0, 257 &s3c64xx_device_iis0,
258 &smartq_backlight_device, 258 &smartq_backlight_device,
@@ -383,6 +383,15 @@ void __init smartq_map_io(void)
383 smartq_lcd_mode_set(); 383 smartq_lcd_mode_set();
384} 384}
385 385
386static struct gpiod_lookup_table smartq_audio_gpios = {
387 .dev_id = "smartq-audio",
388 .table = {
389 GPIO_LOOKUP("GPL", 12, "headphone detect", 0),
390 GPIO_LOOKUP("GPK", 12, "amplifiers shutdown", 0),
391 { },
392 },
393};
394
386void __init smartq_machine_init(void) 395void __init smartq_machine_init(void)
387{ 396{
388 s3c_i2c0_set_platdata(NULL); 397 s3c_i2c0_set_platdata(NULL);
@@ -390,7 +399,7 @@ void __init smartq_machine_init(void)
390 s3c_hwmon_set_platdata(&smartq_hwmon_pdata); 399 s3c_hwmon_set_platdata(&smartq_hwmon_pdata);
391 s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata); 400 s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata);
392 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata); 401 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
393 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata); 402 s3c64xx_ts_set_platdata(&smartq_touchscreen_pdata);
394 403
395 i2c_register_board_info(0, smartq_i2c_devs, 404 i2c_register_board_info(0, smartq_i2c_devs,
396 ARRAY_SIZE(smartq_i2c_devs)); 405 ARRAY_SIZE(smartq_i2c_devs));
@@ -402,4 +411,7 @@ void __init smartq_machine_init(void)
402 411
403 pwm_add_table(smartq_pwm_lookup, ARRAY_SIZE(smartq_pwm_lookup)); 412 pwm_add_table(smartq_pwm_lookup, ARRAY_SIZE(smartq_pwm_lookup));
404 platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices)); 413 platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices));
414
415 gpiod_add_lookup_table(&smartq_audio_gpios);
416 platform_device_register_simple("smartq-audio", -1, NULL, 0);
405} 417}
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 33224ab36fac..0972b6ce0ef6 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -21,6 +21,7 @@
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22 22
23#include <video/samsung_fimd.h> 23#include <video/samsung_fimd.h>
24#include <mach/irqs.h>
24#include <mach/map.h> 25#include <mach/map.h>
25#include <mach/regs-gpio.h> 26#include <mach/regs-gpio.h>
26#include <mach/gpio-samsung.h> 27#include <mach/gpio-samsung.h>
@@ -153,6 +154,7 @@ static void __init smartq5_machine_init(void)
153MACHINE_START(SMARTQ5, "SmartQ 5") 154MACHINE_START(SMARTQ5, "SmartQ 5")
154 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 155 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
155 .atag_offset = 0x100, 156 .atag_offset = 0x100,
157 .nr_irqs = S3C64XX_NR_IRQS,
156 .init_irq = s3c6410_init_irq, 158 .init_irq = s3c6410_init_irq,
157 .map_io = smartq_map_io, 159 .map_io = smartq_map_io,
158 .init_machine = smartq5_machine_init, 160 .init_machine = smartq5_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index fc7fece22fb0..51ac1c6c654a 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -21,6 +21,7 @@
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22 22
23#include <video/samsung_fimd.h> 23#include <video/samsung_fimd.h>
24#include <mach/irqs.h>
24#include <mach/map.h> 25#include <mach/map.h>
25#include <mach/regs-gpio.h> 26#include <mach/regs-gpio.h>
26#include <mach/gpio-samsung.h> 27#include <mach/gpio-samsung.h>
@@ -169,6 +170,7 @@ static void __init smartq7_machine_init(void)
169MACHINE_START(SMARTQ7, "SmartQ 7") 170MACHINE_START(SMARTQ7, "SmartQ 7")
170 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ 171 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
171 .atag_offset = 0x100, 172 .atag_offset = 0x100,
173 .nr_irqs = S3C64XX_NR_IRQS,
172 .init_irq = s3c6410_init_irq, 174 .init_irq = s3c6410_init_irq,
173 .map_io = smartq_map_io, 175 .map_io = smartq_map_io,
174 .init_machine = smartq7_machine_init, 176 .init_machine = smartq7_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index 6f425126a735..7d8a74fd8915 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -27,6 +27,7 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29 29
30#include <mach/irqs.h>
30#include <mach/hardware.h> 31#include <mach/hardware.h>
31#include <mach/map.h> 32#include <mach/map.h>
32 33
@@ -88,7 +89,7 @@ static void __init smdk6400_machine_init(void)
88MACHINE_START(SMDK6400, "SMDK6400") 89MACHINE_START(SMDK6400, "SMDK6400")
89 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ 90 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
90 .atag_offset = 0x100, 91 .atag_offset = 0x100,
91 92 .nr_irqs = S3C64XX_NR_IRQS,
92 .init_irq = s3c6400_init_irq, 93 .init_irq = s3c6400_init_irq,
93 .map_io = smdk6400_map_io, 94 .map_io = smdk6400_map_io,
94 .init_machine = smdk6400_machine_init, 95 .init_machine = smdk6400_machine_init,
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 30fd27853072..8a894ee3ee76 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -52,6 +52,7 @@
52#include <asm/mach/irq.h> 52#include <asm/mach/irq.h>
53 53
54#include <mach/hardware.h> 54#include <mach/hardware.h>
55#include <mach/irqs.h>
55#include <mach/map.h> 56#include <mach/map.h>
56 57
57#include <asm/irq.h> 58#include <asm/irq.h>
@@ -289,7 +290,6 @@ static struct platform_device *smdk6410_devices[] __initdata = {
289 &s3c_device_adc, 290 &s3c_device_adc,
290 &s3c_device_cfcon, 291 &s3c_device_cfcon,
291 &s3c_device_rtc, 292 &s3c_device_rtc,
292 &s3c_device_ts,
293 &s3c_device_wdt, 293 &s3c_device_wdt,
294}; 294};
295 295
@@ -668,7 +668,7 @@ static void __init smdk6410_machine_init(void)
668 668
669 samsung_keypad_set_platdata(&smdk6410_keypad_data); 669 samsung_keypad_set_platdata(&smdk6410_keypad_data);
670 670
671 s3c24xx_ts_set_platdata(NULL); 671 s3c64xx_ts_set_platdata(NULL);
672 672
673 /* configure nCS1 width to 16 bits */ 673 /* configure nCS1 width to 16 bits */
674 674
@@ -707,7 +707,7 @@ static void __init smdk6410_machine_init(void)
707MACHINE_START(SMDK6410, "SMDK6410") 707MACHINE_START(SMDK6410, "SMDK6410")
708 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ 708 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
709 .atag_offset = 0x100, 709 .atag_offset = 0x100,
710 710 .nr_irqs = S3C64XX_NR_IRQS,
711 .init_irq = s3c6410_init_irq, 711 .init_irq = s3c6410_init_irq,
712 .map_io = smdk6410_map_io, 712 .map_io = smdk6410_map_io,
713 .init_machine = smdk6410_machine_init, 713 .init_machine = smdk6410_machine_init,
diff --git a/arch/arm/mach-s3c64xx/pl080.c b/arch/arm/mach-s3c64xx/pl080.c
index 901a984bddc2..89c5a62830a7 100644
--- a/arch/arm/mach-s3c64xx/pl080.c
+++ b/arch/arm/mach-s3c64xx/pl080.c
@@ -14,6 +14,7 @@
14#include <linux/amba/pl08x.h> 14#include <linux/amba/pl08x.h>
15#include <linux/of.h> 15#include <linux/of.h>
16 16
17#include <plat/cpu.h>
17#include <mach/irqs.h> 18#include <mach/irqs.h>
18#include <mach/map.h> 19#include <mach/map.h>
19 20
@@ -230,6 +231,9 @@ static AMBA_AHB_DEVICE(s3c64xx_dma1, "dma-pl080s.1", 0,
230 231
231static int __init s3c64xx_pl080_init(void) 232static int __init s3c64xx_pl080_init(void)
232{ 233{
234 if (!soc_is_s3c64xx())
235 return 0;
236
233 /* Set all DMA configuration to be DMA, not SDMA */ 237 /* Set all DMA configuration to be DMA, not SDMA */
234 writel(0xffffff, S3C64XX_SDMA_SEL); 238 writel(0xffffff, S3C64XX_SDMA_SEL);
235 239
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 75b14e756383..59d91b83b03d 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -22,6 +22,7 @@
22#include <mach/map.h> 22#include <mach/map.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24 24
25#include <plat/cpu.h>
25#include <plat/devs.h> 26#include <plat/devs.h>
26#include <plat/pm.h> 27#include <plat/pm.h>
27#include <plat/wakeup-mask.h> 28#include <plat/wakeup-mask.h>
@@ -332,6 +333,9 @@ int __init s3c64xx_pm_init(void)
332 333
333static __init int s3c64xx_pm_initcall(void) 334static __init int s3c64xx_pm_initcall(void)
334{ 335{
336 if (!soc_is_s3c64xx())
337 return 0;
338
335 pm_cpu_prep = s3c64xx_pm_prepare; 339 pm_cpu_prep = s3c64xx_pm_prepare;
336 pm_cpu_sleep = s3c64xx_cpu_suspend; 340 pm_cpu_sleep = s3c64xx_cpu_suspend;
337 341
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 33273abef669..5ea82accc773 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -81,7 +81,7 @@ static struct device s3c6400_dev = {
81static int __init s3c6400_core_init(void) 81static int __init s3c6400_core_init(void)
82{ 82{
83 /* Not applicable when using DT. */ 83 /* Not applicable when using DT. */
84 if (of_have_populated_dt()) 84 if (of_have_populated_dt() || soc_is_s3c64xx())
85 return 0; 85 return 0;
86 86
87 return subsys_system_register(&s3c6400_subsys, NULL); 87 return subsys_system_register(&s3c6400_subsys, NULL);
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index eadc48dee0e4..92bb927c4478 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -84,7 +84,7 @@ static struct device s3c6410_dev = {
84static int __init s3c6410_core_init(void) 84static int __init s3c6410_core_init(void)
85{ 85{
86 /* Not applicable when using DT. */ 86 /* Not applicable when using DT. */
87 if (of_have_populated_dt()) 87 if (of_have_populated_dt() || !soc_is_s3c64xx())
88 return 0; 88 return 0;
89 89
90 return subsys_system_register(&s3c6410_subsys, NULL); 90 return subsys_system_register(&s3c6410_subsys, NULL);
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 57729b915003..e8229b9fee4a 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -39,7 +39,6 @@ config S3C_LOWLEVEL_UART_PORT
39 39
40config SAMSUNG_ATAGS 40config SAMSUNG_ATAGS
41 def_bool n 41 def_bool n
42 depends on !ARCH_MULTIPLATFORM
43 depends on ATAGS 42 depends on ATAGS
44 help 43 help
45 This option enables ATAGS based boot support code for 44 This option enables ATAGS based boot support code for
@@ -70,6 +69,7 @@ config S3C_GPIO_TRACK
70 69
71config S3C_ADC 70config S3C_ADC
72 bool "ADC common driver support" 71 bool "ADC common driver support"
72 depends on !ARCH_MULTIPLATFORM
73 help 73 help
74 Core support for the ADC block found in the Samsung SoC systems 74 Core support for the ADC block found in the Samsung SoC systems
75 for drivers such as the touchscreen and hwmon to use to share 75 for drivers such as the touchscreen and hwmon to use to share
@@ -225,6 +225,9 @@ config S3C24XX_PWM
225 Support for exporting the PWM timer blocks via the pwm device 225 Support for exporting the PWM timer blocks via the pwm device
226 system 226 system
227 227
228config GPIO_SAMSUNG
229 def_bool y
230
228config SAMSUNG_PM_GPIO 231config SAMSUNG_PM_GPIO
229 bool 232 bool
230 default y if GPIO_SAMSUNG && PM 233 default y if GPIO_SAMSUNG && PM
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 8c911760f55f..be172efec15c 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -4,7 +4,8 @@
4# 4#
5# Licensed under GPLv2 5# Licensed under GPLv2
6 6
7ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include 7ccflags-$(CONFIG_ARCH_S3C64XX) := -I$(srctree)/arch/arm/mach-s3c64xx/include
8ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include
8 9
9# Objects we always build independent of SoC choice 10# Objects we always build independent of SoC choice
10 11
@@ -21,6 +22,8 @@ obj-$(CONFIG_SAMSUNG_ATAGS) += platformdata.o
21obj-$(CONFIG_SAMSUNG_ATAGS) += devs.o 22obj-$(CONFIG_SAMSUNG_ATAGS) += devs.o
22obj-$(CONFIG_SAMSUNG_ATAGS) += dev-uart.o 23obj-$(CONFIG_SAMSUNG_ATAGS) += dev-uart.o
23 24
25obj-$(CONFIG_GPIO_SAMSUNG) += gpio-samsung.o
26
24# PM support 27# PM support
25 28
26obj-$(CONFIG_PM_SLEEP) += pm-common.o 29obj-$(CONFIG_PM_SLEEP) += pm-common.o
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 82074625de5c..771729b3f102 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -111,12 +111,12 @@ struct platform_device s3c_device_adc = {
111#if defined(CONFIG_SAMSUNG_DEV_ADC) 111#if defined(CONFIG_SAMSUNG_DEV_ADC)
112static struct resource s3c_adc_resource[] = { 112static struct resource s3c_adc_resource[] = {
113 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256), 113 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
114 [1] = DEFINE_RES_IRQ(IRQ_TC), 114 [1] = DEFINE_RES_IRQ(IRQ_ADC),
115 [2] = DEFINE_RES_IRQ(IRQ_ADC), 115 [2] = DEFINE_RES_IRQ(IRQ_TC),
116}; 116};
117 117
118struct platform_device s3c_device_adc = { 118struct platform_device s3c_device_adc = {
119 .name = "samsung-adc", 119 .name = "exynos-adc",
120 .id = -1, 120 .id = -1,
121 .num_resources = ARRAY_SIZE(s3c_adc_resource), 121 .num_resources = ARRAY_SIZE(s3c_adc_resource),
122 .resource = s3c_adc_resource, 122 .resource = s3c_adc_resource,
@@ -939,31 +939,19 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
939#endif /* CONFIG_PLAT_S3C24XX */ 939#endif /* CONFIG_PLAT_S3C24XX */
940 940
941#ifdef CONFIG_SAMSUNG_DEV_TS 941#ifdef CONFIG_SAMSUNG_DEV_TS
942static struct resource s3c_ts_resource[] = {
943 [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
944 [1] = DEFINE_RES_IRQ(IRQ_TC),
945};
946
947static struct s3c2410_ts_mach_info default_ts_data __initdata = { 942static struct s3c2410_ts_mach_info default_ts_data __initdata = {
948 .delay = 10000, 943 .delay = 10000,
949 .presc = 49, 944 .presc = 49,
950 .oversampling_shift = 2, 945 .oversampling_shift = 2,
951}; 946};
952 947
953struct platform_device s3c_device_ts = { 948void __init s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
954 .name = "s3c64xx-ts",
955 .id = -1,
956 .num_resources = ARRAY_SIZE(s3c_ts_resource),
957 .resource = s3c_ts_resource,
958};
959
960void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
961{ 949{
962 if (!pd) 950 if (!pd)
963 pd = &default_ts_data; 951 pd = &default_ts_data;
964 952
965 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info), 953 s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
966 &s3c_device_ts); 954 &s3c_device_adc);
967} 955}
968#endif /* CONFIG_SAMSUNG_DEV_TS */ 956#endif /* CONFIG_SAMSUNG_DEV_TS */
969 957
diff --git a/drivers/gpio/gpio-samsung.c b/arch/arm/plat-samsung/gpio-samsung.c
index 7c288ba4dc87..287c3df8b4c6 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/arch/arm/plat-samsung/gpio-samsung.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/irq.h> 31#include <asm/irq.h>
32 32
33#include <mach/irqs.h>
33#include <mach/map.h> 34#include <mach/map.h>
34#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
35#include <mach/gpio-samsung.h> 36#include <mach/gpio-samsung.h>
@@ -1176,14 +1177,16 @@ static __init int samsung_gpiolib_init(void)
1176 * interfaces. For legacy (non-DT) platforms this driver is used. 1177 * interfaces. For legacy (non-DT) platforms this driver is used.
1177 */ 1178 */
1178 if (of_have_populated_dt()) 1179 if (of_have_populated_dt())
1179 return -ENODEV; 1180 return 0;
1180
1181 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs));
1182 1181
1183 if (soc_is_s3c24xx()) { 1182 if (soc_is_s3c24xx()) {
1183 samsung_gpiolib_set_cfg(samsung_gpio_cfgs,
1184 ARRAY_SIZE(samsung_gpio_cfgs));
1184 s3c24xx_gpiolib_add_chips(s3c24xx_gpios, 1185 s3c24xx_gpiolib_add_chips(s3c24xx_gpios,
1185 ARRAY_SIZE(s3c24xx_gpios), S3C24XX_VA_GPIO); 1186 ARRAY_SIZE(s3c24xx_gpios), S3C24XX_VA_GPIO);
1186 } else if (soc_is_s3c64xx()) { 1187 } else if (soc_is_s3c64xx()) {
1188 samsung_gpiolib_set_cfg(samsung_gpio_cfgs,
1189 ARRAY_SIZE(samsung_gpio_cfgs));
1187 samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit, 1190 samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit,
1188 ARRAY_SIZE(s3c64xx_gpios_2bit), 1191 ARRAY_SIZE(s3c64xx_gpios_2bit),
1189 S3C64XX_VA_GPIO + 0xE0, 0x20); 1192 S3C64XX_VA_GPIO + 0xE0, 0x20);
@@ -1192,9 +1195,6 @@ static __init int samsung_gpiolib_init(void)
1192 S3C64XX_VA_GPIO); 1195 S3C64XX_VA_GPIO);
1193 samsung_gpiolib_add_4bit2_chips(s3c64xx_gpios_4bit2, 1196 samsung_gpiolib_add_4bit2_chips(s3c64xx_gpios_4bit2,
1194 ARRAY_SIZE(s3c64xx_gpios_4bit2)); 1197 ARRAY_SIZE(s3c64xx_gpios_4bit2));
1195 } else {
1196 WARN(1, "Unknown SoC in gpio-samsung, no GPIOs added\n");
1197 return -ENODEV;
1198 } 1198 }
1199 1199
1200 return 0; 1200 return 0;
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 11fbbc26e49f..3776f7e752f0 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -152,6 +152,11 @@ static int __init s3c_arch_init(void)
152{ 152{
153 int ret; 153 int ret;
154 154
155 /* init is only needed for ATAGS based platforms */
156 if (!IS_ENABLED(CONFIG_ATAGS) ||
157 (!soc_is_s3c24xx() && !soc_is_s3c64xx()))
158 return 0;
159
155 // do the correct init for cpu 160 // do the correct init for cpu
156 161
157 if (cpu == NULL) { 162 if (cpu == NULL) {
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 82777c649774..d7803b434732 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -23,14 +23,10 @@
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/suspend.h> 24#include <asm/suspend.h>
25 25
26#ifdef CONFIG_SAMSUNG_ATAGS
27#include <mach/map.h> 26#include <mach/map.h>
28#ifndef CONFIG_ARCH_EXYNOS
29#include <mach/regs-clock.h> 27#include <mach/regs-clock.h>
30#include <mach/regs-irq.h> 28#include <mach/regs-irq.h>
31#endif
32#include <mach/irqs.h> 29#include <mach/irqs.h>
33#endif
34 30
35#include <asm/irq.h> 31#include <asm/irq.h>
36 32
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index b18bea08ff25..5e4e9f5c8a64 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -344,13 +344,6 @@ config GPIO_RCAR
344 help 344 help
345 Say yes here to support GPIO on Renesas R-Car SoCs. 345 Say yes here to support GPIO on Renesas R-Car SoCs.
346 346
347config GPIO_SAMSUNG
348 bool
349 depends on PLAT_SAMSUNG
350 help
351 Legacy GPIO support. Use only for platforms without support for
352 pinctrl.
353
354config GPIO_SPEAR_SPICS 347config GPIO_SPEAR_SPICS
355 bool "ST SPEAr13xx SPI Chip Select as GPIO support" 348 bool "ST SPEAr13xx SPI Chip Select as GPIO support"
356 depends on PLAT_SPEAR 349 depends on PLAT_SPEAR
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 986dbd838cea..8555e947372e 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -79,7 +79,6 @@ obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o
79obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o 79obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o
80obj-$(CONFIG_GPIO_RDC321X) += gpio-rdc321x.o 80obj-$(CONFIG_GPIO_RDC321X) += gpio-rdc321x.o
81obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o 81obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o
82obj-$(CONFIG_GPIO_SAMSUNG) += gpio-samsung.o
83obj-$(CONFIG_ARCH_SA1100) += gpio-sa1100.o 82obj-$(CONFIG_ARCH_SA1100) += gpio-sa1100.o
84obj-$(CONFIG_GPIO_SCH) += gpio-sch.o 83obj-$(CONFIG_GPIO_SCH) += gpio-sch.o
85obj-$(CONFIG_GPIO_SCH311X) += gpio-sch311x.o 84obj-$(CONFIG_GPIO_SCH311X) += gpio-sch311x.o
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 3a2dbb3b4926..d11cd604562c 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -35,6 +35,7 @@
35#include <linux/regulator/consumer.h> 35#include <linux/regulator/consumer.h>
36#include <linux/of_platform.h> 36#include <linux/of_platform.h>
37#include <linux/err.h> 37#include <linux/err.h>
38#include <linux/input.h>
38 39
39#include <linux/iio/iio.h> 40#include <linux/iio/iio.h>
40#include <linux/iio/machine.h> 41#include <linux/iio/machine.h>
@@ -42,12 +43,18 @@
42#include <linux/mfd/syscon.h> 43#include <linux/mfd/syscon.h>
43#include <linux/regmap.h> 44#include <linux/regmap.h>
44 45
46#include <linux/platform_data/touchscreen-s3c2410.h>
47
45/* S3C/EXYNOS4412/5250 ADC_V1 registers definitions */ 48/* S3C/EXYNOS4412/5250 ADC_V1 registers definitions */
46#define ADC_V1_CON(x) ((x) + 0x00) 49#define ADC_V1_CON(x) ((x) + 0x00)
50#define ADC_V1_TSC(x) ((x) + 0x04)
47#define ADC_V1_DLY(x) ((x) + 0x08) 51#define ADC_V1_DLY(x) ((x) + 0x08)
48#define ADC_V1_DATX(x) ((x) + 0x0C) 52#define ADC_V1_DATX(x) ((x) + 0x0C)
53#define ADC_V1_DATY(x) ((x) + 0x10)
54#define ADC_V1_UPDN(x) ((x) + 0x14)
49#define ADC_V1_INTCLR(x) ((x) + 0x18) 55#define ADC_V1_INTCLR(x) ((x) + 0x18)
50#define ADC_V1_MUX(x) ((x) + 0x1c) 56#define ADC_V1_MUX(x) ((x) + 0x1c)
57#define ADC_V1_CLRINTPNDNUP(x) ((x) + 0x20)
51 58
52/* S3C2410 ADC registers definitions */ 59/* S3C2410 ADC registers definitions */
53#define ADC_S3C2410_MUX(x) ((x) + 0x18) 60#define ADC_S3C2410_MUX(x) ((x) + 0x18)
@@ -71,6 +78,30 @@
71#define ADC_S3C2410_DATX_MASK 0x3FF 78#define ADC_S3C2410_DATX_MASK 0x3FF
72#define ADC_S3C2416_CON_RES_SEL (1u << 3) 79#define ADC_S3C2416_CON_RES_SEL (1u << 3)
73 80
81/* touch screen always uses channel 0 */
82#define ADC_S3C2410_MUX_TS 0
83
84/* ADCTSC Register Bits */
85#define ADC_S3C2443_TSC_UD_SEN (1u << 8)
86#define ADC_S3C2410_TSC_YM_SEN (1u << 7)
87#define ADC_S3C2410_TSC_YP_SEN (1u << 6)
88#define ADC_S3C2410_TSC_XM_SEN (1u << 5)
89#define ADC_S3C2410_TSC_XP_SEN (1u << 4)
90#define ADC_S3C2410_TSC_PULL_UP_DISABLE (1u << 3)
91#define ADC_S3C2410_TSC_AUTO_PST (1u << 2)
92#define ADC_S3C2410_TSC_XY_PST(x) (((x) & 0x3) << 0)
93
94#define ADC_TSC_WAIT4INT (ADC_S3C2410_TSC_YM_SEN | \
95 ADC_S3C2410_TSC_YP_SEN | \
96 ADC_S3C2410_TSC_XP_SEN | \
97 ADC_S3C2410_TSC_XY_PST(3))
98
99#define ADC_TSC_AUTOPST (ADC_S3C2410_TSC_YM_SEN | \
100 ADC_S3C2410_TSC_YP_SEN | \
101 ADC_S3C2410_TSC_XP_SEN | \
102 ADC_S3C2410_TSC_AUTO_PST | \
103 ADC_S3C2410_TSC_XY_PST(0))
104
74/* Bit definitions for ADC_V2 */ 105/* Bit definitions for ADC_V2 */
75#define ADC_V2_CON1_SOFT_RESET (1u << 2) 106#define ADC_V2_CON1_SOFT_RESET (1u << 2)
76 107
@@ -88,7 +119,9 @@
88/* Bit definitions common for ADC_V1 and ADC_V2 */ 119/* Bit definitions common for ADC_V1 and ADC_V2 */
89#define ADC_CON_EN_START (1u << 0) 120#define ADC_CON_EN_START (1u << 0)
90#define ADC_CON_EN_START_MASK (0x3 << 0) 121#define ADC_CON_EN_START_MASK (0x3 << 0)
122#define ADC_DATX_PRESSED (1u << 15)
91#define ADC_DATX_MASK 0xFFF 123#define ADC_DATX_MASK 0xFFF
124#define ADC_DATY_MASK 0xFFF
92 125
93#define EXYNOS_ADC_TIMEOUT (msecs_to_jiffies(100)) 126#define EXYNOS_ADC_TIMEOUT (msecs_to_jiffies(100))
94 127
@@ -98,17 +131,24 @@
98struct exynos_adc { 131struct exynos_adc {
99 struct exynos_adc_data *data; 132 struct exynos_adc_data *data;
100 struct device *dev; 133 struct device *dev;
134 struct input_dev *input;
101 void __iomem *regs; 135 void __iomem *regs;
102 struct regmap *pmu_map; 136 struct regmap *pmu_map;
103 struct clk *clk; 137 struct clk *clk;
104 struct clk *sclk; 138 struct clk *sclk;
105 unsigned int irq; 139 unsigned int irq;
140 unsigned int tsirq;
141 unsigned int delay;
106 struct regulator *vdd; 142 struct regulator *vdd;
107 143
108 struct completion completion; 144 struct completion completion;
109 145
110 u32 value; 146 u32 value;
111 unsigned int version; 147 unsigned int version;
148
149 bool read_ts;
150 u32 ts_x;
151 u32 ts_y;
112}; 152};
113 153
114struct exynos_adc_data { 154struct exynos_adc_data {
@@ -197,6 +237,9 @@ static void exynos_adc_v1_init_hw(struct exynos_adc *info)
197 /* Enable 12-bit ADC resolution */ 237 /* Enable 12-bit ADC resolution */
198 con1 |= ADC_V1_CON_RES; 238 con1 |= ADC_V1_CON_RES;
199 writel(con1, ADC_V1_CON(info->regs)); 239 writel(con1, ADC_V1_CON(info->regs));
240
241 /* set touchscreen delay */
242 writel(info->delay, ADC_V1_DLY(info->regs));
200} 243}
201 244
202static void exynos_adc_v1_exit_hw(struct exynos_adc *info) 245static void exynos_adc_v1_exit_hw(struct exynos_adc *info)
@@ -480,8 +523,8 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
480 if (info->data->start_conv) 523 if (info->data->start_conv)
481 info->data->start_conv(info, chan->address); 524 info->data->start_conv(info, chan->address);
482 525
483 timeout = wait_for_completion_timeout 526 timeout = wait_for_completion_timeout(&info->completion,
484 (&info->completion, EXYNOS_ADC_TIMEOUT); 527 EXYNOS_ADC_TIMEOUT);
485 if (timeout == 0) { 528 if (timeout == 0) {
486 dev_warn(&indio_dev->dev, "Conversion timed out! Resetting\n"); 529 dev_warn(&indio_dev->dev, "Conversion timed out! Resetting\n");
487 if (info->data->init_hw) 530 if (info->data->init_hw)
@@ -498,13 +541,55 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
498 return ret; 541 return ret;
499} 542}
500 543
544static int exynos_read_s3c64xx_ts(struct iio_dev *indio_dev, int *x, int *y)
545{
546 struct exynos_adc *info = iio_priv(indio_dev);
547 unsigned long timeout;
548 int ret;
549
550 mutex_lock(&indio_dev->mlock);
551 info->read_ts = true;
552
553 reinit_completion(&info->completion);
554
555 writel(ADC_S3C2410_TSC_PULL_UP_DISABLE | ADC_TSC_AUTOPST,
556 ADC_V1_TSC(info->regs));
557
558 /* Select the ts channel to be used and Trigger conversion */
559 info->data->start_conv(info, ADC_S3C2410_MUX_TS);
560
561 timeout = wait_for_completion_timeout(&info->completion,
562 EXYNOS_ADC_TIMEOUT);
563 if (timeout == 0) {
564 dev_warn(&indio_dev->dev, "Conversion timed out! Resetting\n");
565 if (info->data->init_hw)
566 info->data->init_hw(info);
567 ret = -ETIMEDOUT;
568 } else {
569 *x = info->ts_x;
570 *y = info->ts_y;
571 ret = 0;
572 }
573
574 info->read_ts = false;
575 mutex_unlock(&indio_dev->mlock);
576
577 return ret;
578}
579
501static irqreturn_t exynos_adc_isr(int irq, void *dev_id) 580static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
502{ 581{
503 struct exynos_adc *info = (struct exynos_adc *)dev_id; 582 struct exynos_adc *info = (struct exynos_adc *)dev_id;
504 u32 mask = info->data->mask; 583 u32 mask = info->data->mask;
505 584
506 /* Read value */ 585 /* Read value */
507 info->value = readl(ADC_V1_DATX(info->regs)) & mask; 586 if (info->read_ts) {
587 info->ts_x = readl(ADC_V1_DATX(info->regs));
588 info->ts_y = readl(ADC_V1_DATY(info->regs));
589 writel(ADC_TSC_WAIT4INT | ADC_S3C2443_TSC_UD_SEN, ADC_V1_TSC(info->regs));
590 } else {
591 info->value = readl(ADC_V1_DATX(info->regs)) & mask;
592 }
508 593
509 /* clear irq */ 594 /* clear irq */
510 if (info->data->clear_irq) 595 if (info->data->clear_irq)
@@ -515,6 +600,46 @@ static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
515 return IRQ_HANDLED; 600 return IRQ_HANDLED;
516} 601}
517 602
603/*
604 * Here we (ab)use a threaded interrupt handler to stay running
605 * for as long as the touchscreen remains pressed, we report
606 * a new event with the latest data and then sleep until the
607 * next timer tick. This mirrors the behavior of the old
608 * driver, with much less code.
609 */
610static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
611{
612 struct exynos_adc *info = dev_id;
613 struct iio_dev *dev = dev_get_drvdata(info->dev);
614 u32 x, y;
615 bool pressed;
616 int ret;
617
618 while (info->input->users) {
619 ret = exynos_read_s3c64xx_ts(dev, &x, &y);
620 if (ret == -ETIMEDOUT)
621 break;
622
623 pressed = x & y & ADC_DATX_PRESSED;
624 if (!pressed) {
625 input_report_key(info->input, BTN_TOUCH, 0);
626 input_sync(info->input);
627 break;
628 }
629
630 input_report_abs(info->input, ABS_X, x & ADC_DATX_MASK);
631 input_report_abs(info->input, ABS_Y, y & ADC_DATY_MASK);
632 input_report_key(info->input, BTN_TOUCH, 1);
633 input_sync(info->input);
634
635 msleep(1);
636 };
637
638 writel(0, ADC_V1_CLRINTPNDNUP(info->regs));
639
640 return IRQ_HANDLED;
641}
642
518static int exynos_adc_reg_access(struct iio_dev *indio_dev, 643static int exynos_adc_reg_access(struct iio_dev *indio_dev,
519 unsigned reg, unsigned writeval, 644 unsigned reg, unsigned writeval,
520 unsigned *readval) 645 unsigned *readval)
@@ -566,18 +691,72 @@ static int exynos_adc_remove_devices(struct device *dev, void *c)
566 return 0; 691 return 0;
567} 692}
568 693
694static int exynos_adc_ts_open(struct input_dev *dev)
695{
696 struct exynos_adc *info = input_get_drvdata(dev);
697
698 enable_irq(info->tsirq);
699
700 return 0;
701}
702
703static void exynos_adc_ts_close(struct input_dev *dev)
704{
705 struct exynos_adc *info = input_get_drvdata(dev);
706
707 disable_irq(info->tsirq);
708}
709
710static int exynos_adc_ts_init(struct exynos_adc *info)
711{
712 int ret;
713
714 if (info->tsirq <= 0)
715 return -ENODEV;
716
717 info->input = input_allocate_device();
718 if (!info->input)
719 return -ENOMEM;
720
721 info->input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
722 info->input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
723
724 input_set_abs_params(info->input, ABS_X, 0, 0x3FF, 0, 0);
725 input_set_abs_params(info->input, ABS_Y, 0, 0x3FF, 0, 0);
726
727 info->input->name = "S3C24xx TouchScreen";
728 info->input->id.bustype = BUS_HOST;
729 info->input->open = exynos_adc_ts_open;
730 info->input->close = exynos_adc_ts_close;
731
732 input_set_drvdata(info->input, info);
733
734 ret = input_register_device(info->input);
735 if (ret) {
736 input_free_device(info->input);
737 return ret;
738 }
739
740 disable_irq(info->tsirq);
741 ret = request_threaded_irq(info->tsirq, NULL, exynos_ts_isr,
742 0, "touchscreen", info);
743 if (ret)
744 input_unregister_device(info->input);
745
746 return ret;
747}
748
569static int exynos_adc_probe(struct platform_device *pdev) 749static int exynos_adc_probe(struct platform_device *pdev)
570{ 750{
571 struct exynos_adc *info = NULL; 751 struct exynos_adc *info = NULL;
572 struct device_node *np = pdev->dev.of_node; 752 struct device_node *np = pdev->dev.of_node;
753 struct s3c2410_ts_mach_info *pdata = dev_get_platdata(&pdev->dev);
573 struct iio_dev *indio_dev = NULL; 754 struct iio_dev *indio_dev = NULL;
574 struct resource *mem; 755 struct resource *mem;
756 bool has_ts = false;
575 int ret = -ENODEV; 757 int ret = -ENODEV;
576 int irq; 758 int irq;
577 759
578 if (!np)
579 return ret;
580
581 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct exynos_adc)); 760 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct exynos_adc));
582 if (!indio_dev) { 761 if (!indio_dev) {
583 dev_err(&pdev->dev, "failed allocating iio device\n"); 762 dev_err(&pdev->dev, "failed allocating iio device\n");
@@ -613,8 +792,14 @@ static int exynos_adc_probe(struct platform_device *pdev)
613 dev_err(&pdev->dev, "no irq resource?\n"); 792 dev_err(&pdev->dev, "no irq resource?\n");
614 return irq; 793 return irq;
615 } 794 }
616
617 info->irq = irq; 795 info->irq = irq;
796
797 irq = platform_get_irq(pdev, 1);
798 if (irq == -EPROBE_DEFER)
799 return irq;
800
801 info->tsirq = irq;
802
618 info->dev = &pdev->dev; 803 info->dev = &pdev->dev;
619 804
620 init_completion(&info->completion); 805 init_completion(&info->completion);
@@ -680,6 +865,22 @@ static int exynos_adc_probe(struct platform_device *pdev)
680 if (info->data->init_hw) 865 if (info->data->init_hw)
681 info->data->init_hw(info); 866 info->data->init_hw(info);
682 867
868 /* leave out any TS related code if unreachable */
869 if (IS_REACHABLE(CONFIG_INPUT)) {
870 has_ts = of_property_read_bool(pdev->dev.of_node,
871 "has-touchscreen") || pdata;
872 }
873
874 if (pdata)
875 info->delay = pdata->delay;
876 else
877 info->delay = 10000;
878
879 if (has_ts)
880 ret = exynos_adc_ts_init(info);
881 if (ret)
882 goto err_iio;
883
683 ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev); 884 ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev);
684 if (ret < 0) { 885 if (ret < 0) {
685 dev_err(&pdev->dev, "failed adding child nodes\n"); 886 dev_err(&pdev->dev, "failed adding child nodes\n");
@@ -691,6 +892,11 @@ static int exynos_adc_probe(struct platform_device *pdev)
691err_of_populate: 892err_of_populate:
692 device_for_each_child(&indio_dev->dev, NULL, 893 device_for_each_child(&indio_dev->dev, NULL,
693 exynos_adc_remove_devices); 894 exynos_adc_remove_devices);
895 if (has_ts) {
896 input_unregister_device(info->input);
897 free_irq(info->tsirq, info);
898 }
899err_iio:
694 iio_device_unregister(indio_dev); 900 iio_device_unregister(indio_dev);
695err_irq: 901err_irq:
696 free_irq(info->irq, info); 902 free_irq(info->irq, info);
@@ -710,6 +916,10 @@ static int exynos_adc_remove(struct platform_device *pdev)
710 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 916 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
711 struct exynos_adc *info = iio_priv(indio_dev); 917 struct exynos_adc *info = iio_priv(indio_dev);
712 918
919 if (IS_REACHABLE(CONFIG_INPUT)) {
920 free_irq(info->tsirq, info);
921 input_unregister_device(info->input);
922 }
713 device_for_each_child(&indio_dev->dev, NULL, 923 device_for_each_child(&indio_dev->dev, NULL,
714 exynos_adc_remove_devices); 924 exynos_adc_remove_devices);
715 iio_device_unregister(indio_dev); 925 iio_device_unregister(indio_dev);
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index ae33da7ab51f..ae35edcd6a34 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -365,7 +365,7 @@ config TOUCHSCREEN_IPROC
365config TOUCHSCREEN_S3C2410 365config TOUCHSCREEN_S3C2410
366 tristate "Samsung S3C2410/generic touchscreen input driver" 366 tristate "Samsung S3C2410/generic touchscreen input driver"
367 depends on ARCH_S3C24XX || SAMSUNG_DEV_TS 367 depends on ARCH_S3C24XX || SAMSUNG_DEV_TS
368 select S3C_ADC 368 depends on S3C_ADC
369 help 369 help
370 Say Y here if you have the s3c2410 touchscreen. 370 Say Y here if you have the s3c2410 touchscreen.
371 371
diff --git a/include/linux/platform_data/touchscreen-s3c2410.h b/include/linux/platform_data/touchscreen-s3c2410.h
index 58dc7c5ae63b..71eccaa9835d 100644
--- a/include/linux/platform_data/touchscreen-s3c2410.h
+++ b/include/linux/platform_data/touchscreen-s3c2410.h
@@ -17,6 +17,7 @@ struct s3c2410_ts_mach_info {
17}; 17};
18 18
19extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *); 19extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
20extern void s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
20 21
21/* defined by architecture to configure gpio */ 22/* defined by architecture to configure gpio */
22extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev); 23extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev);
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index a0fe37fbed9f..425ee2ba37f0 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -13,15 +13,12 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/gpio.h> 16#include <linux/gpio/consumer.h>
17#include <linux/module.h> 17#include <linux/module.h>
18 18
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/jack.h> 20#include <sound/jack.h>
21 21
22#include <mach/gpio-samsung.h>
23#include <asm/mach-types.h>
24
25#include "i2s.h" 22#include "i2s.h"
26#include "../codecs/wm8750.h" 23#include "../codecs/wm8750.h"
27 24
@@ -96,7 +93,7 @@ static struct snd_soc_jack_pin smartq_jack_pins[] = {
96 93
97static struct snd_soc_jack_gpio smartq_jack_gpios[] = { 94static struct snd_soc_jack_gpio smartq_jack_gpios[] = {
98 { 95 {
99 .gpio = S3C64XX_GPL(12), 96 .gpio = -1,
100 .name = "headphone detect", 97 .name = "headphone detect",
101 .report = SND_JACK_HEADPHONE, 98 .report = SND_JACK_HEADPHONE,
102 .debounce_time = 200, 99 .debounce_time = 200,
@@ -113,7 +110,9 @@ static int smartq_speaker_event(struct snd_soc_dapm_widget *w,
113 struct snd_kcontrol *k, 110 struct snd_kcontrol *k,
114 int event) 111 int event)
115{ 112{
116 gpio_set_value(S3C64XX_GPK(12), SND_SOC_DAPM_EVENT_OFF(event)); 113 struct gpio_desc *gpio = snd_soc_card_get_drvdata(&snd_soc_smartq);
114
115 gpiod_set_value(gpio, SND_SOC_DAPM_EVENT_OFF(event));
117 116
118 return 0; 117 return 0;
119} 118}
@@ -199,62 +198,39 @@ static struct snd_soc_card snd_soc_smartq = {
199 .num_controls = ARRAY_SIZE(wm8987_smartq_controls), 198 .num_controls = ARRAY_SIZE(wm8987_smartq_controls),
200}; 199};
201 200
202static struct platform_device *smartq_snd_device; 201static int smartq_probe(struct platform_device *pdev)
203
204static int __init smartq_init(void)
205{ 202{
203 struct gpio_desc *gpio;
206 int ret; 204 int ret;
207 205
208 if (!machine_is_smartq7() && !machine_is_smartq5()) { 206 platform_set_drvdata(pdev, &snd_soc_smartq);
209 pr_info("Only SmartQ is supported by this ASoC driver\n");
210 return -ENODEV;
211 }
212
213 smartq_snd_device = platform_device_alloc("soc-audio", -1);
214 if (!smartq_snd_device)
215 return -ENOMEM;
216
217 platform_set_drvdata(smartq_snd_device, &snd_soc_smartq);
218
219 ret = platform_device_add(smartq_snd_device);
220 if (ret) {
221 platform_device_put(smartq_snd_device);
222 return ret;
223 }
224 207
225 /* Initialise GPIOs used by amplifiers */ 208 /* Initialise GPIOs used by amplifiers */
226 ret = gpio_request(S3C64XX_GPK(12), "amplifiers shutdown"); 209 gpio = devm_gpiod_get(&pdev->dev, "amplifiers shutdown",
227 if (ret) { 210 GPIOD_OUT_HIGH);
228 dev_err(&smartq_snd_device->dev, "Failed to register GPK12\n"); 211 if (IS_ERR(gpio)) {
229 goto err_unregister_device; 212 dev_err(&pdev->dev, "Failed to register GPK12\n");
213 ret = PTR_ERR(gpio);
214 goto out;
230 } 215 }
216 snd_soc_card_set_drvdata(&snd_soc_smartq, gpio);
231 217
232 /* Disable amplifiers */ 218 ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_smartq);
233 ret = gpio_direction_output(S3C64XX_GPK(12), 1); 219 if (ret)
234 if (ret) { 220 dev_err(&pdev->dev, "Failed to register card\n");
235 dev_err(&smartq_snd_device->dev, "Failed to configure GPK12\n");
236 goto err_free_gpio_amp_shut;
237 }
238
239 return 0;
240
241err_free_gpio_amp_shut:
242 gpio_free(S3C64XX_GPK(12));
243err_unregister_device:
244 platform_device_unregister(smartq_snd_device);
245 221
222out:
246 return ret; 223 return ret;
247} 224}
248 225
249static void __exit smartq_exit(void) 226static struct platform_driver smartq_driver = {
250{ 227 .driver = {
251 gpio_free(S3C64XX_GPK(12)); 228 .name = "smartq-audio",
252 229 },
253 platform_device_unregister(smartq_snd_device); 230 .probe = smartq_probe,
254} 231};
255 232
256module_init(smartq_init); 233module_platform_driver(smartq_driver);
257module_exit(smartq_exit);
258 234
259/* Module information */ 235/* Module information */
260MODULE_AUTHOR("Maurus Cuelenaere <mcuelenaere@gmail.com>"); 236MODULE_AUTHOR("Maurus Cuelenaere <mcuelenaere@gmail.com>");