Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 May 2013 19:31:18 +0000 (12:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 May 2013 19:31:18 +0000 (12:31 -0700)
Pull ARM SoC driver changes from Olof Johansson:
 "This is a rather large set of patches for device drivers that for one
  reason or another the subsystem maintainer preferred to get merged
  through the arm-soc tree.  There are both new drivers as well as
  existing drivers that are getting converted from platform-specific
  code into standalone drivers using the appropriate subsystem specific
  interfaces.

  In particular, we can now have pinctrl, clk, clksource and irqchip
  drivers in one file per driver, without the need to call into platform
  specific interface, or to get called from platform specific code, as
  long as all information about the hardware is provided through a
  device tree.

  Most of the drivers we touch this time are for clocksource.  Since now
  most of them are part of drivers/clocksource, I expect that we won't
  have to touch these again from arm-soc and can let the clocksource
  maintainers take care of these in the future.

  Another larger part of this series is specific to the exynos platform,
  which is seeing some significant effort in upstreaming and
  modernization of its device drivers this time around, which
  unfortunately is also the cause for the churn and a lot of the merge
  conflicts.

  There is one new subsystem that gets merged as part of this series:
  the reset controller interface, which is a very simple interface for
  taking devices on the SoC out of reset or back into reset.  Patches to
  use this interface on i.MX follow later in this merge window, and we
  are going to have other platforms (at least tegra and sirf) get
  converted in 3.11.  This will let us get rid of platform specific
  callbacks in a number of platform independent device drivers."

* tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (256 commits)
  irqchip: s3c24xx: add missing __init annotations
  ARM: dts: Disable the RTC by default on exynos5
  clk: exynos5250: Fix parent clock for sclk_mmc{0,1,2,3}
  ARM: exynos: restore mach/regs-clock.h for exynos5
  clocksource: exynos_mct: fix build error on non-DT
  pinctrl: vt8500: wmt: Fix checking return value of pinctrl_register()
  irqchip: vt8500: Convert arch-vt8500 to new irqchip infrastructure
  reset: NULL deref on allocation failure
  reset: Add reset controller API
  dt: describe base reset signal binding
  ARM: EXYNOS: Add arm-pmu DT binding for exynos421x
  ARM: EXYNOS: Add arm-pmu DT binding for exynos5250
  ARM: EXYNOS: Enable PMUs for exynos4
  irqchip: exynos-combiner: Correct combined IRQs for exynos4
  irqchip: exynos-combiner: Add set_irq_affinity function for combiner_irq
  ARM: EXYNOS: fix compilation error introduced due to common clock migration
  clk: exynos5250: Fix divider values for sclk_mmc{0,1,2,3}
  clk: exynos4: export clocks required for fimc-is
  clk: samsung: Fix compilation error
  clk: tegra: fix enum tegra114_clk to match binding
  ...

57 files changed:
1  2 
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/vt8500.dtsi
arch/arm/boot/dts/wm8505.dtsi
arch/arm/boot/dts/wm8650.dtsi
arch/arm/boot/dts/wm8850.dtsi
arch/arm/boot/dts/zynq-7000.dtsi
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-origen.c
arch/arm/mach-exynos/mach-smdkv310.c
arch/arm/mach-exynos/mach-universal_c210.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/common.h
arch/arm/mach-s3c24xx/Kconfig
arch/arm/mach-s3c24xx/include/mach/irqs.h
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-tegra/tegra.c
arch/arm/mach-ux500/board-mop500-pins.c
arch/arm/mach-zynq/Kconfig
arch/arm/plat-samsung/Kconfig
arch/arm/plat-samsung/devs.c
drivers/Kconfig
drivers/Makefile
drivers/clk/Makefile
drivers/clk/tegra/clk-tegra20.c
drivers/clk/tegra/clk-tegra30.c
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/irqchip/Makefile
drivers/irqchip/exynos-combiner.c
drivers/irqchip/irq-s3c24xx.c
drivers/of/base.c
drivers/pinctrl/Kconfig
drivers/pinctrl/Makefile
drivers/pinctrl/pinctrl-bcm2835.c
drivers/pinctrl/pinctrl-exynos.c
drivers/pinctrl/pinctrl-samsung.c
drivers/pinctrl/pinctrl-samsung.h
drivers/video/atmel_lcdfb.c
include/linux/of.h

diff --combined arch/arm/Kconfig
index 62079d434581a465aaff44e02fd2d6ce74c16c71,ccb6c0c715213d3fc8cb9166cfcecc7b338d3f7a..1e31dac36a5fecc9a9ca0ebfd002a0b65d1cda4c
@@@ -15,7 -15,6 +15,7 @@@ config AR
        select GENERIC_IRQ_SHOW
        select GENERIC_PCI_IOMAP
        select GENERIC_SMP_IDLE_THREAD
 +      select GENERIC_IDLE_POLL_SETUP
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select HARDIRQS_SW_RESEND
@@@ -59,7 -58,6 +59,7 @@@
        select CLONE_BACKWARDS
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
 +      select HAVE_CONTEXT_TRACKING
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -363,6 -361,37 +363,6 @@@ config ARCH_AT9
          This enables support for systems based on Atmel
          AT91RM9200 and AT91SAM9* processors.
  
 -config ARCH_BCM2835
 -      bool "Broadcom BCM2835 family"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_ERRATA_411920
 -      select ARM_TIMER_SP804
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_OF
 -      select COMMON_CLK
 -      select CPU_V6
 -      select GENERIC_CLOCKEVENTS
 -      select MULTI_IRQ_HANDLER
 -      select PINCTRL
 -      select PINCTRL_BCM2835
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        This enables support for the Broadcom BCM2835 SoC. This SoC is
 -        use in the Raspberry Pi, and Roku 2 devices.
 -
 -config ARCH_CNS3XXX
 -      bool "Cavium Networks CNS3XXX family"
 -      select ARM_GIC
 -      select CPU_V6K
 -      select GENERIC_CLOCKEVENTS
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select MIGHT_HAVE_PCI
 -      select PCI_DOMAINS if PCI
 -      help
 -        Support for Cavium Networks CNS3XXX platform.
 -
  config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
        select ARCH_REQUIRE_GPIOLIB
@@@ -381,11 -410,25 +381,11 @@@ config ARCH_GEMIN
        bool "Cortina Systems Gemini"
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_GPIO_H
        select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
  
 -config ARCH_SIRF
 -      bool "CSR SiRF"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select AUTO_ZRELADDR
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select GENERIC_IRQ_CHIP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select NO_IOPORT
 -      select PINCTRL
 -      select PINCTRL_SIRF
 -      select USE_OF
 -      help
 -        Support for CSR SiRFprimaII/Marco/Polo platforms
 -
  config ARCH_EBSA110
        bool "EBSA-110"
        select ARCH_USES_GETTIMEOFFSET
@@@ -425,6 -468,21 +425,6 @@@ config ARCH_FOOTBRIDG
          Support for systems based on the DC21285 companion chip
          ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
  
 -config ARCH_MXS
 -      bool "Freescale MXS-based"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK_PREPARE
 -      select MULTI_IRQ_HANDLER
 -      select PINCTRL
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        Support for Freescale MXS-based family of processors
 -
  config ARCH_NETX
        bool "Hilscher NetX based"
        select ARM_VIC
        help
          This enables support for systems based on the Hilscher NetX Soc
  
 -config ARCH_H720X
 -      bool "Hynix HMS720x-based"
 -      select ARCH_USES_GETTIMEOFFSET
 -      select CPU_ARM720T
 -      select ISA_DMA_API
 -      help
 -        This enables support for systems based on the Hynix HMS720x
 -
  config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
@@@ -483,8 -549,6 +483,8 @@@ config ARCH_IXP4X
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
 +      select USB_EHCI_BIG_ENDIAN_MMIO
 +      select USB_EHCI_BIG_ENDIAN_DESC
        help
          Support for Intel's IXP4XX (XScale) family of processors.
  
@@@ -597,6 -661,25 +597,6 @@@ config ARCH_LPC32X
        help
          Support for the NXP LPC32XX family of processors
  
 -config ARCH_TEGRA
 -      bool "NVIDIA Tegra"
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select CLKSRC_OF
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      select HAVE_SMP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select SOC_BUS
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        This enables support for NVIDIA Tegra based systems (Tegra APX,
 -        Tegra 6xx and Tegra 2 series).
 -
  config ARCH_PXA
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
@@@ -634,8 -717,6 +634,8 @@@ config ARCH_SHMOBIL
        bool "Renesas SH-Mobile / R-Mobile"
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
 +      select HAVE_ARM_SCU if SMP
 +      select HAVE_ARM_TWD if LOCAL_TIMERS
        select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
@@@ -689,12 -770,15 +689,15 @@@ config ARCH_SA110
  config ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs"
        select ARCH_HAS_CPUFREQ
-       select ARCH_USES_GETTIMEOFFSET
+       select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
+       select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
+       select MULTI_IRQ_HANDLER
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H
        help
@@@ -707,10 -791,11 +710,11 @@@ config ARCH_S3C64X
        bool "Samsung S3C64XX"
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
-       select ARCH_USES_GETTIMEOFFSET
        select ARM_VIC
        select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
        select CPU_V6
+       select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -744,9 -829,11 +748,11 @@@ config ARCH_S5P64X
  
  config ARCH_S5PC100
        bool "Samsung S5PC100"
-       select ARCH_USES_GETTIMEOFFSET
+       select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
        select CPU_V7
+       select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -779,6 -866,7 +785,7 @@@ config ARCH_EXYNO
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
+       select COMMON_CLK
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
@@@ -821,6 -909,51 +828,6 @@@ config ARCH_U30
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
 -config ARCH_U8500
 -      bool "ST-Ericsson U8500 Series"
 -      depends on MMU
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select CLKDEV_LOOKUP
 -      select CPU_V7
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_SMP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select SPARSE_IRQ
 -      help
 -        Support for ST-Ericsson's Ux500 architecture
 -
 -config ARCH_NOMADIK
 -      bool "STMicroelectronics Nomadik"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_VIC
 -      select CLKSRC_NOMADIK_MTU
 -      select COMMON_CLK
 -      select CPU_ARM926T
 -      select GENERIC_CLOCKEVENTS
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select USE_OF
 -      select PINCTRL
 -      select PINCTRL_STN8815
 -      select SPARSE_IRQ
 -      help
 -        Support for the Nomadik platform by ST-Ericsson
 -
 -config PLAT_SPEAR
 -      bool "ST SPEAr"
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      help
 -        Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
 -
  config ARCH_DAVINCI
        bool "TI DaVinci"
        select ARCH_HAS_HOLES_MEMORYMODEL
@@@ -912,8 -1045,6 +919,8 @@@ source "arch/arm/mach-at91/Kconfig
  
  source "arch/arm/mach-bcm/Kconfig"
  
 +source "arch/arm/mach-bcm2835/Kconfig"
 +
  source "arch/arm/mach-clps711x/Kconfig"
  
  source "arch/arm/mach-cns3xxx/Kconfig"
@@@ -928,6 -1059,8 +935,6 @@@ source "arch/arm/mach-footbridge/Kconfi
  
  source "arch/arm/mach-gemini/Kconfig"
  
 -source "arch/arm/mach-h720x/Kconfig"
 -
  source "arch/arm/mach-highbank/Kconfig"
  
  source "arch/arm/mach-integrator/Kconfig"
@@@ -979,7 -1112,7 +986,7 @@@ source "arch/arm/plat-samsung/Kconfig
  
  source "arch/arm/mach-socfpga/Kconfig"
  
 -source "arch/arm/plat-spear/Kconfig"
 +source "arch/arm/mach-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
  
@@@ -1048,6 -1181,7 +1055,6 @@@ config PLAT_VERSATIL
  config ARM_TIMER_SP804
        bool
        select CLKSRC_MMIO
 -      select HAVE_SCHED_CLOCK
  
  source arch/arm/mm/Kconfig
  
@@@ -1057,9 -1191,9 +1064,9 @@@ config ARM_NR_BANK
        default 8
  
  config IWMMXT
 -      bool "Enable iWMMXt support"
 +      bool "Enable iWMMXt support" if !CPU_PJ4
        depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4
 -      default y if PXA27x || PXA3xx || ARCH_MMP
 +      default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4
        help
          Enable support for iWMMXt context switching at run time if
          running on a CPU that supports it.
@@@ -1313,16 -1447,6 +1320,16 @@@ config ARM_ERRATA_77542
         to deadlock. This workaround puts DSB before executing ISB if
         an abort may occur on cache maintenance.
  
 +config ARM_ERRATA_798181
 +      bool "ARM errata: TLBI/DSB failure on Cortex-A15"
 +      depends on CPU_V7 && SMP
 +      help
 +        On Cortex-A15 (r0p0..r3p2) the TLBI*IS/DSB operations are not
 +        adequately shooting down all use of the old entries. This
 +        option enables the Linux kernel workaround for this erratum
 +        which sends an IPI to the CPUs that are running the same ASID
 +        as the one being invalidated.
 +
  endmenu
  
  source "arch/arm/common/Kconfig"
@@@ -1406,6 -1530,7 +1413,6 @@@ config SM
        depends on GENERIC_CLOCKEVENTS
        depends on HAVE_SMP
        depends on MMU
 -      select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
        select USE_GENERIC_SMP_HELPERS
        help
          This enables support for systems with more than one CPU. If you have
@@@ -1480,14 -1605,6 +1487,14 @@@ config HAVE_ARM_TW
        help
          This options enables support for the ARM timer and watchdog unit
  
 +config MCPM
 +      bool "Multi-Cluster Power Management"
 +      depends on CPU_V7 && SMP
 +      help
 +        This option provides the common power management infrastructure
 +        for (multi-)cluster based systems, such as big.LITTLE based
 +        systems.
 +
  choice
        prompt "Memory split"
        default VMSPLIT_3G
@@@ -1538,6 -1655,7 +1545,6 @@@ config LOCAL_TIMER
        bool "Use local timer interrupts"
        depends on SMP
        default y
 -      select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !CLKSRC_EXYNOS_MCT)
        help
          Enable support for local timers on SMP platforms, rather then the
          legacy IPI broadcast method.  Local timers allows the system
@@@ -1551,8 -1669,9 +1558,9 @@@ config ARCH_NR_GPI
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
        default 512 if SOC_OMAP5
 -      default 355 if ARCH_U8500
 +      default 392 if ARCH_U8500
-       default 288 if ARCH_VT8500 || ARCH_SUNXI
+       default 352 if ARCH_VT8500
+       default 288 if ARCH_SUNXI
        default 264 if MACH_H4700
        default 0
        help
@@@ -1574,9 -1693,8 +1582,9 @@@ config SCHED_HRTIC
        def_bool HIGH_RES_TIMERS
  
  config THUMB2_KERNEL
 -      bool "Compile the kernel in Thumb-2 mode"
 +      bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
 +      default y if CPU_THUMBONLY
        select AEABI
        select ARM_ASM_UNIFIED
        select ARM_UNWIND
@@@ -2042,8 -2160,40 +2050,8 @@@ endmen
  menu "CPU Power Management"
  
  if ARCH_HAS_CPUFREQ
 -
  source "drivers/cpufreq/Kconfig"
  
 -config CPU_FREQ_IMX
 -      tristate "CPUfreq driver for i.MX CPUs"
 -      depends on ARCH_MXC && CPU_FREQ
 -      select CPU_FREQ_TABLE
 -      help
 -        This enables the CPUfreq driver for i.MX CPUs.
 -
 -config CPU_FREQ_SA1100
 -      bool
 -
 -config CPU_FREQ_SA1110
 -      bool
 -
 -config CPU_FREQ_INTEGRATOR
 -      tristate "CPUfreq driver for ARM Integrator CPUs"
 -      depends on ARCH_INTEGRATOR && CPU_FREQ
 -      default y
 -      help
 -        This enables the CPUfreq driver for ARM Integrator CPUs.
 -
 -        For details, take a look at <file:Documentation/cpu-freq>.
 -
 -        If in doubt, say Y.
 -
 -config CPU_FREQ_PXA
 -      bool
 -      depends on CPU_FREQ && ARCH_PXA && PXA25x
 -      default y
 -      select CPU_FREQ_DEFAULT_GOV_USERSPACE
 -      select CPU_FREQ_TABLE
 -
  config CPU_FREQ_S3C
        bool
        help
index 20358fb43450e7c4fbb6c1b126a350a49d91fb1b,d3cd880d70b31e90703490a90d9866e5a7875858..55196639211dd40a4be320672f3d146ba30ea97e
@@@ -3,7 -3,6 +3,7 @@@ ifeq ($(CONFIG_OF),y
  # Keep at91 dtb files sorted alphabetically for each SoC
  # rm9200
  dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
 +dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
  # sam9260
  dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
  dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
@@@ -27,17 -26,11 +27,17 @@@ dtb-$(CONFIG_ARCH_AT91) += pm9g45.dt
  # sam9n12
  dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb
  # sam9x5
 +dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g15ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g25ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9x25ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9x35ek.dtb
 +# sama5d3
 +dtb-$(CONFIG_ARCH_AT91)       += sama5d31ek.dtb
 +dtb-$(CONFIG_ARCH_AT91)       += sama5d33ek.dtb
 +dtb-$(CONFIG_ARCH_AT91)       += sama5d34ek.dtb
 +dtb-$(CONFIG_ARCH_AT91)       += sama5d35ek.dtb
  
  dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
  dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb
@@@ -49,7 -42,10 +49,10 @@@ dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510
  dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
        exynos4210-smdkv310.dtb \
        exynos4210-trats.dtb \
+       exynos4412-odroidx.dtb \
        exynos4412-smdk4412.dtb \
+       exynos4412-origen.dtb \
+       exynos5250-arndale.dtb \
        exynos5250-smdk5250.dtb \
        exynos5250-snow.dtb \
        exynos5440-ssdk5440.dtb
@@@ -94,26 -90,19 +97,26 @@@ dtb-$(CONFIG_ARCH_MXC) += 
        imx25-karo-tx25.dtb \
        imx25-pdk.dtb \
        imx27-apf27.dtb \
 +      imx27-apf27dev.dtb \
        imx27-pdk.dtb \
 +      imx27-phytec-phycore.dtb \
        imx31-bug.dtb \
        imx51-apf51.dtb \
 +      imx51-apf51dev.dtb \
        imx51-babbage.dtb \
        imx53-ard.dtb \
        imx53-evk.dtb \
        imx53-mba53.dtb \
        imx53-qsb.dtb \
        imx53-smd.dtb \
 +      imx6dl-sabreauto.dtb \
 +      imx6dl-sabresd.dtb \
 +      imx6dl-wandboard.dtb \
        imx6q-arm2.dtb \
        imx6q-sabreauto.dtb \
        imx6q-sabrelite.dtb \
 -      imx6q-sabresd.dtb
 +      imx6q-sabresd.dtb \
 +      imx6q-sbc6x.dtb
  dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
        imx23-olinuxino.dtb \
        imx23-stmp378x_devb.dtb \
index 68c8dc644383a248a502bb5da7a359010a6b4342,e1c3926aca52bec4dfa70be136831c5889b63552..4a4b96f6827ed59f7f468b09eae2704fba5e92ad
                        #interrupt-cells = <1>;
                };
  
-               gpio: gpio-controller@d8110000 {
-                       compatible = "via,vt8500-gpio";
-                       gpio-controller;
+               pinctrl: pinctrl@d8110000 {
+                       compatible = "via,vt8500-pinctrl";
                        reg = <0xd8110000 0x10000>;
-                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
  
                pmc@d8130000 {
                        interrupts = <43>;
                };
  
 -              fb@d800e400 {
 +              fb: fb@d8050800 {
                        compatible = "via,vt8500-fb";
                        reg = <0xd800e400 0x400>;
                        interrupts = <12>;
 -                      display = <&display>;
 -                      default-mode = <&mode0>;
                };
  
                ge_rops@d8050400 {
index 398b8bca791ec01da60abf70c9336e48da887fd1,bb92ef8ce66517c51689b2ed61d45198ca60bd73..b2bf359e852f9f6505d9f3946ce1d66515b91920
                        interrupts = <56 57 58 59 60 61 62 63>;
                };
  
-               gpio: gpio-controller@d8110000 {
-                       compatible = "wm,wm8505-gpio";
-                       gpio-controller;
+               pinctrl: pinctrl@d8110000 {
+                       compatible = "wm,wm8505-pinctrl";
                        reg = <0xd8110000 0x10000>;
-                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
  
                pmc@d8130000 {
                                        clock-frequency = <24000000>;
                                };
  
 +                              ref25: ref25M {
 +                                      #clock-cells = <0>;
 +                                      compatible = "fixed-clock";
 +                                      clock-frequency = <25000000>;
 +                              };
 +
 +                              pllb: pllb {
 +                                      #clock-cells = <0>;
 +                                      compatible = "via,vt8500-pll-clock";
 +                                      clocks = <&ref25>;
 +                                      reg = <0x204>;
 +                              };
 +
                                clkuart0: uart0 {
                                        #clock-cells = <0>;
                                        compatible = "via,vt8500-device-clock";
                                        enable-reg = <0x250>;
                                        enable-bit = <23>;
                                };
 +
 +                              clksdhc: sdhc {
 +                                      #clock-cells = <0>;
 +                                      compatible = "via,vt8500-device-clock";
 +                                      clocks = <&pllb>;
 +                                      divisor-reg = <0x328>;
 +                                      divisor-mask = <0x3f>;
 +                                      enable-reg = <0x254>;
 +                                      enable-bit = <18>;
 +                              };
                        };
                };
  
                        interrupts = <0>;
                };
  
 -              fb@d8050800 {
 +              fb: fb@d8050800 {
                        compatible = "wm,wm8505-fb";
                        reg = <0xd8050800 0x200>;
 -                      display = <&display>;
 -                      default-mode = <&mode0>;
                };
  
                ge_rops@d8050400 {
                        reg = <0xd8100000 0x10000>;
                        interrupts = <48>;
                };
 +
 +              sdhc@d800a000 {
 +                      compatible = "wm,wm8505-sdhc";
 +                      reg = <0xd800a000 0x1000>;
 +                      interrupts = <20 21>;
 +                      clocks = <&clksdhc>;
 +                      bus-width = <4>;
 +              };
        };
  };
index 9313407bbc3044a8c3db5030a24eee24308dec83,bb4af580f40bccf64aad0e787581e8fac73d312b..dd8464eeb40d69bddd1924bd445b9d11d0600d37
                        interrupts = <56 57 58 59 60 61 62 63>;
                };
  
-               gpio: gpio-controller@d8110000 {
-                       compatible = "wm,wm8650-gpio";
-                       gpio-controller;
+               pinctrl: pinctrl@d8110000 {
+                       compatible = "wm,wm8650-pinctrl";
                        reg = <0xd8110000 0x10000>;
-                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
  
                pmc@d8130000 {
                        interrupts = <43>;
                };
  
 -              fb@d8050800 {
 +              fb: fb@d8050800 {
                        compatible = "wm,wm8505-fb";
                        reg = <0xd8050800 0x200>;
 -                      display = <&display>;
 -                      default-mode = <&mode0>;
                };
  
                ge_rops@d8050400 {
index 7149cd13e3b97b1de6a01daddae27131f6f391f4,11cd180c58d3ae67979d0ab325246591903f969b..fc790d0aee66e6399865802adc49bfe58fd9af71
                        interrupts = <56 57 58 59 60 61 62 63>;
                };
  
-               gpio: gpio-controller@d8110000 {
-                       compatible = "wm,wm8650-gpio";
-                       gpio-controller;
+               pinctrl: pinctrl@d8110000 {
+                       compatible = "wm,wm8850-pinctrl";
                        reg = <0xd8110000 0x10000>;
-                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
  
                pmc@d8130000 {
                        };
                };
  
 -              fb@d8051700 {
 +              fb: fb@d8051700 {
                        compatible = "wm,wm8505-fb";
                        reg = <0xd8051700 0x200>;
 -                      display = <&display>;
 -                      default-mode = <&mode0>;
                };
  
                ge_rops@d8050400 {
index 9e1c339c44916739bec245b482b37444ec348969,51243db2e9e4cd812ce435b8f534e7c26028cd4a..748fc347ed186088c17dfa230d7239ee656a4e61
  / {
        compatible = "xlnx,zynq-7000";
  
 +      pmu {
 +              compatible = "arm,cortex-a9-pmu";
 +              interrupts = <0 5 4>, <0 6 4>;
 +              interrupt-parent = <&intc>;
 +              reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >;
 +      };
 +
        amba {
                compatible = "simple-bus";
                #address-cells = <1>;
                };
  
                ttc0: ttc0@f8001000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "xlnx,ttc";
+                       interrupt-parent = <&intc>;
+                       interrupts = < 0 10 4 0 11 4 0 12 4 >;
+                       compatible = "cdns,ttc";
                        reg = <0xF8001000 0x1000>;
                        clocks = <&cpu_clk 3>;
                        clock-names = "cpu_1x";
                        clock-ranges;
-                       ttc0_0: ttc0.0 {
-                               status = "disabled";
-                               reg = <0>;
-                               interrupts = <0 10 4>;
-                       };
-                       ttc0_1: ttc0.1 {
-                               status = "disabled";
-                               reg = <1>;
-                               interrupts = <0 11 4>;
-                       };
-                       ttc0_2: ttc0.2 {
-                               status = "disabled";
-                               reg = <2>;
-                               interrupts = <0 12 4>;
-                       };
                };
  
                ttc1: ttc1@f8002000 {
-                       #interrupt-parent = <&intc>;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "xlnx,ttc";
+                       interrupt-parent = <&intc>;
+                       interrupts = < 0 37 4 0 38 4 0 39 4 >;
+                       compatible = "cdns,ttc";
                        reg = <0xF8002000 0x1000>;
                        clocks = <&cpu_clk 3>;
                        clock-names = "cpu_1x";
                        clock-ranges;
-                       ttc1_0: ttc1.0 {
-                               status = "disabled";
-                               reg = <0>;
-                               interrupts = <0 37 4>;
-                       };
-                       ttc1_1: ttc1.1 {
-                               status = "disabled";
-                               reg = <1>;
-                               interrupts = <0 38 4>;
-                       };
-                       ttc1_2: ttc1.2 {
-                               status = "disabled";
-                               reg = <2>;
-                               interrupts = <0 39 4>;
-                       };
                };
        };
  };
index ac7a341bd0ffd1a545766bbc01598aebc4a0df80,0204f4cc9ebf714321f731d3d26f97c9131517a3..25efb5ac30f14b6f76326f236f961c18055145c0
@@@ -169,6 -169,8 +169,8 @@@ static struct clk *periph_clocks[] __in
  };
  
  static struct clk_lookup periph_clocks_lookups[] = {
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9261-lcdfb.0", &hck1),
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9g10-lcdfb.0", &hck1),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
@@@ -337,7 -339,7 +339,7 @@@ static unsigned int at91sam9261_default
        0,      /* Advanced Interrupt Controller */
  };
  
 -AT91_SOC_START(sam9261)
 +AT91_SOC_START(at91sam9261)
        .map_io = at91sam9261_map_io,
        .default_irq_priority = at91sam9261_default_irq_priority,
        .ioremap_registers = at91sam9261_ioremap_registers,
index 8e2d9f4a9a450273debedcaa8c79c97fe1c57c17,2282fd7ad3e3c1d8218bbe2958452774cea7676a..f44ffd2105a728895f3f8c0907acb0eaab5caa17
@@@ -190,6 -190,7 +190,7 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
        CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9263-lcdfb.0", &lcdc_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
@@@ -374,7 -375,7 +375,7 @@@ static unsigned int at91sam9263_default
        0,      /* Advanced Interrupt Controller (IRQ1) */
  };
  
 -AT91_SOC_START(sam9263)
 +AT91_SOC_START(at91sam9263)
        .map_io = at91sam9263_map_io,
        .default_irq_priority = at91sam9263_default_irq_priority,
        .ioremap_registers = at91sam9263_ioremap_registers,
index a6c224fc9542a26c4a7a50508bf0331682ddbd91,c68960d82247f3cdb6918632565f5ac8acf90d45..8b7fce06765232b38e914571624fbe8da2bbb332
@@@ -228,6 -228,8 +228,8 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_ID("hclk", &macb_clk),
        /* One additional fake clock for ohci */
        CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9g45-lcdfb.0", &lcdc_clk),
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9g45es-lcdfb.0", &lcdc_clk),
        CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
        CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
        CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "fffd0000.mmc", &mmc1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff84000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi1_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff200.gpio", &pioA_clk),
@@@ -420,7 -420,7 +422,7 @@@ static unsigned int at91sam9g45_default
        0,      /* Advanced Interrupt Controller (IRQ0) */
  };
  
 -AT91_SOC_START(sam9g45)
 +AT91_SOC_START(at91sam9g45)
        .map_io = at91sam9g45_map_io,
        .default_irq_priority = at91sam9g45_default_irq_priority,
        .ioremap_registers = at91sam9g45_ioremap_registers,
index f0bf68268ca2940b3cbbbe8b4c983920865708fd,fe626d431b692477be5225e0081baeab80d25584..acb703e13331e2a9931bb321d7c1f9f71d550f11
@@@ -18,7 -18,7 +18,7 @@@
  #include <linux/platform_device.h>
  #include <linux/i2c-gpio.h>
  #include <linux/atmel-mci.h>
 -#include <linux/platform_data/atmel-aes.h>
 +#include <linux/platform_data/crypto-atmel.h>
  
  #include <linux/platform_data/at91_adc.h>
  
@@@ -981,7 -981,6 +981,6 @@@ static struct resource lcdc_resources[
  };
  
  static struct platform_device at91_lcdc_device = {
-       .name           = "atmel_lcdfb",
        .id             = 0,
        .dev            = {
                                .dma_mask               = &lcdc_dmamask,
@@@ -997,6 -996,11 +996,11 @@@ void __init at91_add_device_lcdc(struc
        if (!data)
                return;
  
+       if (cpu_is_at91sam9g45es())
+               at91_lcdc_device.name = "at91sam9g45es-lcdfb";
+       else
+               at91_lcdc_device.name = "at91sam9g45-lcdfb";
        at91_set_A_periph(AT91_PIN_PE0, 0);     /* LCDDPWR */
  
        at91_set_A_periph(AT91_PIN_PE2, 0);     /* LCDCC */
@@@ -1900,8 -1904,7 +1904,8 @@@ static void __init at91_add_device_tdes
   * -------------------------------------------------------------------- */
  
  #if defined(CONFIG_CRYPTO_DEV_ATMEL_AES) || defined(CONFIG_CRYPTO_DEV_ATMEL_AES_MODULE)
 -static struct aes_platform_data aes_data;
 +static struct crypto_platform_data aes_data;
 +static struct crypto_dma_data alt_atslave;
  static u64 aes_dmamask = DMA_BIT_MASK(32);
  
  static struct resource aes_resources[] = {
@@@ -1932,20 -1935,23 +1936,20 @@@ static struct platform_device at91sam9g
  static void __init at91_add_device_aes(void)
  {
        struct at_dma_slave     *atslave;
 -      struct aes_dma_data     *alt_atslave;
 -
 -      alt_atslave = kzalloc(sizeof(struct aes_dma_data), GFP_KERNEL);
  
        /* DMA TX slave channel configuration */
 -      atslave = &alt_atslave->txdata;
 +      atslave = &alt_atslave.txdata;
        atslave->dma_dev = &at_hdmac_device.dev;
        atslave->cfg = ATC_FIFOCFG_ENOUGHSPACE  | ATC_SRC_H2SEL_HW |
                                                ATC_SRC_PER(AT_DMA_ID_AES_RX);
  
        /* DMA RX slave channel configuration */
 -      atslave = &alt_atslave->rxdata;
 +      atslave = &alt_atslave.rxdata;
        atslave->dma_dev = &at_hdmac_device.dev;
        atslave->cfg = ATC_FIFOCFG_ENOUGHSPACE  | ATC_DST_H2SEL_HW |
                                                ATC_DST_PER(AT_DMA_ID_AES_TX);
  
 -      aes_data.dma_slave = alt_atslave;
 +      aes_data.dma_slave = &alt_atslave;
        platform_device_register(&at91sam9g45_aes_device);
  }
  #else
index c39600764236c9e858eeb78e5f1a30fda6940fd5,3de3e04d0f81905db6e499f46562a1e2f11e7210..f77fae5591bc449600a9d5a8c0d66510454ca5e1
@@@ -179,6 -179,7 +179,7 @@@ static struct clk *periph_clocks[] __in
  };
  
  static struct clk_lookup periph_clocks_lookups[] = {
+       CLKDEV_CON_DEV_ID("hclk", "at91sam9rl-lcdfb.0", &lcdc_clk),
        CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
        CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
@@@ -340,7 -341,7 +341,7 @@@ static unsigned int at91sam9rl_default_
        0,      /* Advanced Interrupt Controller */
  };
  
 -AT91_SOC_START(sam9rl)
 +AT91_SOC_START(at91sam9rl)
        .map_io = at91sam9rl_map_io,
        .default_irq_priority = at91sam9rl_default_irq_priority,
        .ioremap_registers = at91sam9rl_ioremap_registers,
index f22f69e2d081c4ab620068633b68e95029d7f97c,b1cdff6f537e18cae2477f94f075d985d5944f69..d19edff0ea6e07bbddefd7dd1d7a94d0cc171ff1
@@@ -14,7 -14,6 +14,7 @@@ menu "SAMSUNG EXYNOS SoCs Support
  config ARCH_EXYNOS4
        bool "SAMSUNG EXYNOS4"
        default y
 +      select HAVE_ARM_SCU if SMP
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
@@@ -22,7 -21,6 +22,7 @@@
  
  config ARCH_EXYNOS5
        bool "SAMSUNG EXYNOS5"
 +      select HAVE_ARM_SCU if SMP
        select HAVE_SMP
        help
          Samsung EXYNOS5 (Cortex-A15) SoC based systems
@@@ -63,6 -61,7 +63,7 @@@ config SOC_EXYNOS525
        bool "SAMSUNG EXYNOS5250"
        default y
        depends on ARCH_EXYNOS5
+       select PM_GENERIC_DOMAINS if PM
        select S5P_PM if PM
        select S5P_SLEEP if PM
        select S5P_DEV_MFC
@@@ -74,21 -73,13 +75,15 @@@ config SOC_EXYNOS544
        bool "SAMSUNG EXYNOS5440"
        default y
        depends on ARCH_EXYNOS5
 +      select ARCH_HAS_OPP
        select ARM_ARCH_TIMER
        select AUTO_ZRELADDR
        select PINCTRL
        select PINCTRL_EXYNOS5440
 +      select PM_OPP
        help
          Enable EXYNOS5440 SoC support
  
- config EXYNOS4_MCT
-       bool
-       default y
-       help
-         Use MCT (Multi Core Timer) as kernel timers
  config EXYNOS_ATAGS
        bool "ATAGS based boot for EXYNOS (deprecated)"
        depends on !ARCH_MULTIPLATFORM
@@@ -112,6 -103,11 +107,6 @@@ config EXYNOS4_DEV_AHC
        help
          Compile in platform device definitions for AHCI
  
 -config EXYNOS_DEV_DRM
 -      bool
 -      help
 -        Compile in platform device definitions for core DRM device
 -
  config EXYNOS4_SETUP_FIMD0
        bool
        help
@@@ -211,6 -207,7 +206,6 @@@ config MACH_SMDKV31
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select EXYNOS_DEV_DMA
 -      select EXYNOS_DEV_DRM
        select EXYNOS_DEV_SYSMMU
        select S3C24XX_PWM
        select S3C_DEV_HSMMC
@@@ -264,7 -261,9 +259,7 @@@ config MACH_UNIVERSAL_C21
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select EXYNOS_DEV_DMA
 -      select EXYNOS_DEV_DRM
        select EXYNOS_DEV_SYSMMU
 -      select HAVE_SCHED_CLOCK
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select S5P_DEV_ONENAND
        select S5P_DEV_TV
        select S5P_GPIO_INT
-       select S5P_HRT
        select S5P_SETUP_MIPIPHY
+       select SAMSUNG_HRT
        help
          Machine support for Samsung Mobile Universal S5PC210 Reference
          Board.
@@@ -303,6 -302,7 +298,6 @@@ config MACH_NUR
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select EXYNOS_DEV_DMA
 -      select EXYNOS_DEV_DRM
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
@@@ -338,6 -338,7 +333,6 @@@ config MACH_ORIGE
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select EXYNOS_DEV_DMA
 -      select EXYNOS_DEV_DRM
        select EXYNOS_DEV_SYSMMU
        select S3C24XX_PWM
        select S3C_DEV_HSMMC
@@@ -373,6 -374,7 +368,6 @@@ config MACH_SMDK421
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select EXYNOS_DEV_DMA
 -      select EXYNOS_DEV_DRM
        select EXYNOS_DEV_SYSMMU
        select S3C24XX_PWM
        select S3C_DEV_HSMMC2
@@@ -414,10 -416,12 +409,12 @@@ config MACH_EXYNOS4_D
        bool "Samsung Exynos4 Machine using device tree"
        depends on ARCH_EXYNOS4
        select ARM_AMBA
+       select CLKSRC_OF
        select CPU_EXYNOS4210
 -      select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
 +      select KEYBOARD_SAMSUNG if INPUT_KEYBOARD
        select PINCTRL
        select PINCTRL_EXYNOS
+       select S5P_DEV_MFC
        select USE_OF
        help
          Machine support for Samsung Exynos4 machine with device tree enabled.
@@@ -430,6 -434,7 +427,7 @@@ config MACH_EXYNOS5_D
        default y
        depends on ARCH_EXYNOS5
        select ARM_AMBA
+       select CLKSRC_OF
        select USE_OF
        help
          Machine support for Samsung EXYNOS5 machine with device tree enabled.
index 15718da30c4570f59d7be48dd9dca54be46cf2a2,939bda77defa0b06e25acabed748f676329f4096..b35c60059bb8092669eb5e30782aad63f99047e5
  #include <linux/of_irq.h>
  #include <linux/export.h>
  #include <linux/irqdomain.h>
 -#include <linux/irqchip.h>
  #include <linux/of_address.h>
+ #include <linux/clocksource.h>
+ #include <linux/clk-provider.h>
  #include <linux/irqchip/arm-gic.h>
 +#include <linux/irqchip/chained_irq.h>
  
  #include <asm/proc-fns.h>
  #include <asm/exception.h>
@@@ -37,9 -39,9 +39,9 @@@
  #include <mach/regs-irq.h>
  #include <mach/regs-pmu.h>
  #include <mach/regs-gpio.h>
+ #include <mach/irqs.h>
  
  #include <plat/cpu.h>
- #include <plat/clock.h>
  #include <plat/devs.h>
  #include <plat/pm.h>
  #include <plat/sdhci.h>
@@@ -65,17 -67,16 +67,16 @@@ static const char name_exynos5440[] = "
  static void exynos4_map_io(void);
  static void exynos5_map_io(void);
  static void exynos5440_map_io(void);
- static void exynos4_init_clocks(int xtal);
- static void exynos5_init_clocks(int xtal);
  static void exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no);
  static int exynos_init(void);
  
+ unsigned long xxti_f = 0, xusbxti_f = 0;
  static struct cpu_table cpu_ids[] __initdata = {
        {
                .idcode         = EXYNOS4210_CPU_ID,
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
-               .init_clocks    = exynos4_init_clocks,
                .init_uarts     = exynos4_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4210,
@@@ -83,7 -84,6 +84,6 @@@
                .idcode         = EXYNOS4212_CPU_ID,
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
-               .init_clocks    = exynos4_init_clocks,
                .init_uarts     = exynos4_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4212,
@@@ -91,7 -91,6 +91,6 @@@
                .idcode         = EXYNOS4412_CPU_ID,
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
-               .init_clocks    = exynos4_init_clocks,
                .init_uarts     = exynos4_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4412,
@@@ -99,7 -98,6 +98,6 @@@
                .idcode         = EXYNOS5250_SOC_ID,
                .idmask         = EXYNOS5_SOC_MASK,
                .map_io         = exynos5_map_io,
-               .init_clocks    = exynos5_init_clocks,
                .init           = exynos_init,
                .name           = name_exynos5250,
        }, {
@@@ -256,11 -254,6 +254,6 @@@ static struct map_desc exynos5_iodesc[
                .pfn            = __phys_to_pfn(EXYNOS5_PA_SROMC),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
-       }, {
-               .virtual        = (unsigned long)S5P_VA_SYSTIMER,
-               .pfn            = __phys_to_pfn(EXYNOS5_PA_SYSTIMER),
-               .length         = SZ_4K,
-               .type           = MT_DEVICE,
        }, {
                .virtual        = (unsigned long)S5P_VA_SYSRAM,
                .pfn            = __phys_to_pfn(EXYNOS5_PA_SYSRAM),
@@@ -402,43 -395,26 +395,26 @@@ static void __init exynos5_map_io(void
        iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
  }
  
- static void __init exynos4_init_clocks(int xtal)
- {
-       printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
-       s3c24xx_register_baseclocks(xtal);
-       s5p_register_clocks(xtal);
-       if (soc_is_exynos4210())
-               exynos4210_register_clocks();
-       else if (soc_is_exynos4212() || soc_is_exynos4412())
-               exynos4212_register_clocks();
-       exynos4_register_clocks();
-       exynos4_setup_clocks();
- }
  static void __init exynos5440_map_io(void)
  {
        iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
  }
  
static void __init exynos5_init_clocks(int xtal)
void __init exynos_init_time(void)
  {
-       printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
-       /* EXYNOS5440 can support only common clock framework */
-       if (soc_is_exynos5440())
-               return;
- #ifdef CONFIG_SOC_EXYNOS5250
-       s3c24xx_register_baseclocks(xtal);
-       s5p_register_clocks(xtal);
-       exynos5_register_clocks();
-       exynos5_setup_clocks();
+       if (of_have_populated_dt()) {
+ #ifdef CONFIG_OF
+               of_clk_init(NULL);
+               clocksource_of_init();
+ #endif
+       } else {
+               /* todo: remove after migrating legacy E4 platforms to dt */
+ #ifdef CONFIG_ARCH_EXYNOS4
+               exynos4_clk_init(NULL);
+               exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f);
  #endif
+               mct_init();
+       }
  }
  
  void __init exynos4_init_irq(void)
         * uses GIC instead of VIC.
         */
        s5p_init_irq(NULL, 0);
 +
 +      gic_arch_extn.irq_set_wake = s3c_irq_wake;
  }
  
  void __init exynos5_init_irq(void)
@@@ -824,6 -798,7 +800,7 @@@ static int __init exynos_init_irq_eint(
        static const struct of_device_id exynos_pinctrl_ids[] = {
                { .compatible = "samsung,exynos4210-pinctrl", },
                { .compatible = "samsung,exynos4x12-pinctrl", },
+               { .compatible = "samsung,exynos5250-pinctrl", },
        };
        struct device_node *pctrl_np, *wkup_np;
        const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
        return 0;
  }
  arch_initcall(exynos_init_irq_eint);
+ static struct resource exynos4_pmu_resource[] = {
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU),
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU1),
+ #if defined(CONFIG_SOC_EXYNOS4412)
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU2),
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU3),
+ #endif
+ };
+ static struct platform_device exynos4_device_pmu = {
+       .name           = "arm-pmu",
+       .num_resources  = ARRAY_SIZE(exynos4_pmu_resource),
+       .resource       = exynos4_pmu_resource,
+ };
+ static int __init exynos_armpmu_init(void)
+ {
+       if (!of_have_populated_dt()) {
+               if (soc_is_exynos4210() || soc_is_exynos4212())
+                       exynos4_device_pmu.num_resources = 2;
+               platform_device_register(&exynos4_device_pmu);
+       }
+       return 0;
+ }
+ arch_initcall(exynos_armpmu_init);
index 2517406e7f566f73339566e83734abeeb863b00d,081a5baadd8b437d1935f1c90673da267d84edad..5c8b2878dbbd0287f048467dff954e0e04a6c0d6
@@@ -1252,7 -1252,7 +1252,7 @@@ static void __init nuri_camera_init(voi
        }
  
        m5mols_board_info.irq = s5p_register_gpio_interrupt(GPIO_CAM_8M_ISP_INT);
 -      if (!IS_ERR_VALUE(m5mols_board_info.irq))
 +      if (m5mols_board_info.irq >= 0)
                s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xF));
        else
                pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__);
@@@ -1331,8 -1331,9 +1331,9 @@@ static struct platform_device *nuri_dev
  static void __init nuri_map_io(void)
  {
        exynos_init_io(NULL, 0);
-       s3c24xx_init_clocks(clk_xusbxti.rate);
        s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
+       xxti_f = 0;
+       xusbxti_f = 24000000;
  }
  
  static void __init nuri_reserve(void)
@@@ -1381,7 -1382,7 +1382,7 @@@ MACHINE_START(NURI, "NURI"
        .map_io         = nuri_map_io,
        .init_machine   = nuri_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = exynos_init_time,
        .reserve        = &nuri_reserve,
        .restart        = exynos4_restart,
  MACHINE_END
index ec42024dd13f2ca02970c2ded6a8dee11d52684c,27ebe44785f0bdcd550620e4a006feb0d70ba520..27f03ed5d067c5d53c4018145071e814b531325e
@@@ -26,7 -26,7 +26,7 @@@
  #include <linux/platform_data/i2c-s3c2410.h>
  #include <linux/platform_data/s3c-hsotg.h>
  #include <linux/platform_data/usb-ehci-s5p.h>
 -#include <linux/platform_data/usb-exynos.h>
 +#include <linux/platform_data/usb-ohci-exynos.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
@@@ -755,8 -755,9 +755,9 @@@ static void s5p_tv_setup(void
  static void __init origen_map_io(void)
  {
        exynos_init_io(NULL, 0);
-       s3c24xx_init_clocks(clk_xusbxti.rate);
        s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
+       xxti_f = 0;
+       xusbxti_f = 24000000;
  }
  
  static void __init origen_power_init(void)
@@@ -816,7 -817,7 +817,7 @@@ MACHINE_START(ORIGEN, "ORIGEN"
        .map_io         = origen_map_io,
        .init_machine   = origen_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = exynos_init_time,
        .reserve        = &origen_reserve,
        .restart        = exynos4_restart,
  MACHINE_END
index 9680e1291065f442b73e27b6cdf590d012dd4a91,ee312b676772e2fe47b168337a31911760879b27..d95b8cf8525380ab4134250a938250e022ba6885
@@@ -23,7 -23,7 +23,7 @@@
  #include <linux/platform_data/i2c-s3c2410.h>
  #include <linux/platform_data/s3c-hsotg.h>
  #include <linux/platform_data/usb-ehci-s5p.h>
 -#include <linux/platform_data/usb-exynos.h>
 +#include <linux/platform_data/usb-ohci-exynos.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
@@@ -372,8 -372,9 +372,9 @@@ static void s5p_tv_setup(void
  static void __init smdkv310_map_io(void)
  {
        exynos_init_io(NULL, 0);
-       s3c24xx_init_clocks(clk_xusbxti.rate);
        s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
+       xxti_f = 12000000;
+       xusbxti_f = 24000000;
  }
  
  static void __init smdkv310_reserve(void)
@@@ -424,7 -425,7 +425,7 @@@ MACHINE_START(SMDKV310, "SMDKV310"
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
-       .init_time      = exynos4_timer_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
  MACHINE_END
@@@ -437,7 -438,7 +438,7 @@@ MACHINE_START(SMDKC210, "SMDKC210"
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
  MACHINE_END
index d28c7fbaba2d15f8e995efbcaf6f0744a6b6cacb,72f08fd7cfa94f657b020c246036eaa6b4b722d5..327d50d4681d7e97dc7efa720ce39bccc11ead7d
@@@ -41,7 -41,7 +41,7 @@@
  #include <plat/mfc.h>
  #include <plat/sdhci.h>
  #include <plat/fimc-core.h>
- #include <plat/s5p-time.h>
+ #include <plat/samsung-time.h>
  #include <plat/camport.h>
  
  #include <mach/map.h>
@@@ -97,19 -97,6 +97,19 @@@ static struct s3c2410_uartcfg universal
  static struct regulator_consumer_supply max8952_consumer =
        REGULATOR_SUPPLY("vdd_arm", NULL);
  
 +static struct regulator_init_data universal_max8952_reg_data = {
 +      .constraints    = {
 +              .name           = "VARM_1.2V",
 +              .min_uV         = 770000,
 +              .max_uV         = 1400000,
 +              .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
 +              .always_on      = 1,
 +              .boot_on        = 1,
 +      },
 +      .num_consumer_supplies  = 1,
 +      .consumer_supplies      = &max8952_consumer,
 +};
 +
  static struct max8952_platform_data universal_max8952_pdata __initdata = {
        .gpio_vid0      = EXYNOS4_GPX0(3),
        .gpio_vid1      = EXYNOS4_GPX0(4),
        .dvs_mode       = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
        .sync_freq      = 0, /* default: fastest */
        .ramp_speed     = 0, /* default: fastest */
 -
 -      .reg_data       = {
 -              .constraints    = {
 -                      .name           = "VARM_1.2V",
 -                      .min_uV         = 770000,
 -                      .max_uV         = 1400000,
 -                      .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
 -                      .always_on      = 1,
 -                      .boot_on        = 1,
 -              },
 -              .num_consumer_supplies  = 1,
 -              .consumer_supplies      = &max8952_consumer,
 -      },
 +      .reg_data       = &universal_max8952_reg_data,
  };
  
  static struct regulator_consumer_supply lp3974_buck1_consumer =
@@@ -1093,9 -1092,10 +1093,10 @@@ static struct platform_device *universa
  static void __init universal_map_io(void)
  {
        exynos_init_io(NULL, 0);
-       s3c24xx_init_clocks(clk_xusbxti.rate);
        s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
-       s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
+       samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
+       xxti_f = 0;
+       xusbxti_f = 24000000;
  }
  
  static void s5p_tv_setup(void)
@@@ -1153,7 -1153,7 +1154,7 @@@ MACHINE_START(UNIVERSAL_C210, "UNIVERSA
        .map_io         = universal_map_io,
        .init_machine   = universal_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = s5p_timer_init,
+       .init_time      = samsung_timer_init,
        .reserve        = &universal_reserve,
        .restart        = exynos4_restart,
  MACHINE_END
index 2612eeaa58896961336436eac379e43e3ccdffe0,7eb9651dd0f7e02d7e19c52c3d81d0bfa5cfc8dc..a4d4664894e129059a3c1445733e65018f262f8a
@@@ -35,7 -35,7 +35,7 @@@
  #include "common.h"
  #include <linux/omap-dma.h>
  #include <video/omapdss.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include "gpmc.h"
  #include "gpmc-smc91x.h"
@@@ -445,16 -445,23 +445,23 @@@ static void enable_board_wakeup_source(
                OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
  }
  
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 1,
+               .reset_gpio = 57,
+               .vcc_gpio = -EINVAL,
+       },
+       {
+               .port = 2,
+               .reset_gpio = 61,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
  
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = 57,
-       .reset_gpio_port[1]  = 61,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -606,6 -613,8 +613,8 @@@ static void __init omap_3430sdp_init(vo
        board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
        sdp3430_display_init();
        enable_board_wakeup_source();
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
  }
  
index 1d6c28872505607e705beeb434a3fca466b23a8c,191f9762ba63c4eb4368b95a862b17228ac5049c..c29d2e74368825a71f1b983f5da56a619b252330
@@@ -35,7 -35,8 +35,7 @@@
  
  #include "common.h"
  #include <video/omapdss.h>
 -#include <video/omap-panel-generic-dpi.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include "am35xx-emac.h"
  #include "mux.h"
@@@ -273,6 -274,14 +273,14 @@@ static __init void am3517_evm_mcbsp1_in
        omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
  }
  
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 1,
+               .reset_gpio = 57,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
  #else
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  #endif
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = 57,
-       .reset_gpio_port[1]  = -EINVAL,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -348,7 -351,6 +350,6 @@@ static struct omap2_hsmmc_info mmc[] = 
        {}      /* Terminator */
  };
  
  static void __init am3517_evm_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  
        /* Configure GPIO for EHCI port */
        omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
        am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
        /* DSS */
index bccd3e51fecb6a328a690b623cfabbb8754ee3a6,7fda3f5f8a7fdf8ce0de057241342333729a8fc8..e0ed8c07fc54f40eb5825b15cfffcd44b5ff4921
@@@ -41,7 -41,8 +41,7 @@@
  
  #include <linux/platform_data/mtd-nand-omap2.h>
  #include <video/omapdss.h>
 -#include <video/omap-panel-generic-dpi.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
  
  #include "common.h"
@@@ -418,15 -419,22 +418,22 @@@ static struct omap2_hsmmc_info mmc[] = 
        {}      /* Terminator */
  };
  
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 1,
+               .reset_gpio = OMAP_MAX_GPIO_LINES + 6,
+               .vcc_gpio = -EINVAL,
+       },
+       {
+               .port = 2,
+               .reset_gpio = OMAP_MAX_GPIO_LINES + 7,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = OMAP_MAX_GPIO_LINES + 6,
-       .reset_gpio_port[1]  = OMAP_MAX_GPIO_LINES + 7,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  static void  __init cm_t35_init_usbh(void)
                msleep(1);
        }
  
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
  }
  
index 12d2126a2382d432fd02ce73dbc3d69b42e75b93,42fbf1ef12a949778107b7a5e8aa76b18638e986..e44b804f75aea5dd465c3a7d1ba0fa15452c6253
@@@ -43,7 -43,8 +43,7 @@@
  #include "gpmc.h"
  #include <linux/platform_data/mtd-nand-omap2.h>
  #include <video/omapdss.h>
 -#include <video/omap-panel-generic-dpi.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include <linux/platform_data/spi-omap2-mcspi.h>
  #include <linux/input/matrix_keypad.h>
@@@ -436,15 -437,7 +436,7 @@@ static struct platform_device *devkit80
  };
  
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = -EINVAL,
-       .reset_gpio_port[1]  = -EINVAL,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
index e979d48270c91136d7809d43251e0d0df98d8170,95ccec0eeab919f33101e657147955056c818ca2..b54562d1235e5bd0a5f89659e724e50387ae8dfb
@@@ -31,7 -31,7 +31,7 @@@
  #include <asm/mach/arch.h>
  
  #include <video/omapdss.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  #include <linux/platform_data/mtd-onenand-omap2.h>
  
  #include "common.h"
@@@ -527,26 -527,28 +527,28 @@@ static void __init igep_i2c_init(void
        omap3_pmic_init("twl4030", &igep_twldata);
  }
  
+ static struct usbhs_phy_data igep2_phy_data[] __initdata = {
+       {
+               .port = 1,
+               .reset_gpio = IGEP2_GPIO_USBH_NRESET,
+               .vcc_gpio = -EINVAL,
+       },
+ };
+ static struct usbhs_phy_data igep3_phy_data[] __initdata = {
+       {
+               .port = 2,
+               .reset_gpio = IGEP3_GPIO_USBH_NRESET,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset = true,
-       .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
-       .reset_gpio_port[1] = -EINVAL,
-       .reset_gpio_port[2] = -EINVAL,
  };
  
  static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = {
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset = true,
-       .reset_gpio_port[0] = -EINVAL,
-       .reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
-       .reset_gpio_port[2] = -EINVAL,
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -642,8 -644,10 +644,10 @@@ static void __init igep_init(void
        if (machine_is_igep0020()) {
                omap_display_init(&igep2_dss_data);
                igep2_init_smsc911x();
+               usbhs_init_phys(igep2_phy_data, ARRAY_SIZE(igep2_phy_data));
                usbhs_init(&igep2_usbhs_bdata);
        } else {
+               usbhs_init_phys(igep3_phy_data, ARRAY_SIZE(igep3_phy_data));
                usbhs_init(&igep3_usbhs_bdata);
        }
  }
index fff141330a63a2966b947137c9306147ec0010fe,6955a428f534321e94c8ca4301e1bbcc3363a900..6de78605c0afa75b87b5ca52abcd83e04d0ec1ce
@@@ -33,6 -33,7 +33,7 @@@
  #include <linux/mtd/nand.h>
  #include <linux/mmc/host.h>
  #include <linux/usb/phy.h>
+ #include <linux/usb/nop-usb-xceiv.h>
  
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
@@@ -43,7 -44,7 +44,7 @@@
  #include <asm/mach/flash.h>
  
  #include <video/omapdss.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  #include <linux/platform_data/mtd-nand-omap2.h>
  
  #include "common.h"
@@@ -277,6 -278,21 +278,21 @@@ static struct regulator_consumer_suppl
  
  static struct gpio_led gpio_leds[];
  
+ /* PHY's VCC regulator might be added later, so flag that we need it */
+ static struct nop_usb_xceiv_platform_data hsusb2_phy_data = {
+       .needs_vcc = true,
+ };
+ static struct usbhs_phy_data phy_data[] = {
+       {
+               .port = 2,
+               .reset_gpio = 147,
+               .vcc_gpio = -1,         /* updated in beagle_twl_gpio_setup */
+               .vcc_polarity = 1,      /* updated in beagle_twl_gpio_setup */
+               .platform_data = &hsusb2_phy_data,
+       },
+ };
  static int beagle_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
  {
        }
        dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio;
  
-       gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
-                       "nEN_USB_PWR");
+       /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */
+       phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX;
+       phy_data[0].vcc_polarity = beagle_config.usb_pwr_level;
  
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        return 0;
  }
  
@@@ -453,15 -471,7 +471,7 @@@ static struct platform_device *omap3_be
  };
  
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = -EINVAL,
-       .reset_gpio_port[1]  = 147,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -543,7 -553,9 +553,9 @@@ static void __init omap3_beagle_init(vo
  
        usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3beagle_nand_partitions,
                        ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
                        NAND_BUSWIDTH_16, NULL);
index 233a0d528fcf7c5ed93c000a1cad35748ce6fb21,2de92facc8a38234bacec820218fe4143b8b137f..4f1bbc3cc29b154203821aea2de0ee31e2466190
@@@ -51,7 -51,7 +51,7 @@@
  #include "common.h"
  #include <linux/platform_data/spi-omap2-mcspi.h>
  #include <video/omapdss.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include "soc.h"
  #include "mux.h"
@@@ -496,7 -496,7 +496,7 @@@ struct wl12xx_platform_data omap3evm_wl
  static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
        REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"),    /* OMAP ISP */
        REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"),    /* OMAP ISP */
-       REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"),
+       REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"),     /* hsusb port 2 */
        REGULATOR_SUPPLY("vaux2", NULL),
  };
  
@@@ -539,17 -539,16 +539,16 @@@ static int __init omap3_evm_i2c_init(vo
        return 0;
  }
  
- static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 2,
+               .reset_gpio = -1,       /* set at runtime */
+               .vcc_gpio = -EINVAL,
+       },
+ };
  
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
+ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       /* PHY reset GPIO will be runtime programmed based on EVM version */
-       .reset_gpio_port[0]  = -EINVAL,
-       .reset_gpio_port[1]  = -EINVAL,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -725,7 -724,7 +724,7 @@@ static void __init omap3_evm_init(void
  
                /* setup EHCI phy reset config */
                omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
-               usbhs_bdata.reset_gpio_port[1] = 21;
+               phy_data[0].reset_gpio = 21;
  
                /* EVM REV >= E can supply 500mA with EXTVBUS programming */
                musb_board_data.power = 500;
        } else {
                /* setup EHCI phy reset on MDC */
                omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
-               usbhs_bdata.reset_gpio_port[1] = 135;
+               phy_data[0].reset_gpio = 135;
        }
        usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(&musb_board_data);
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3evm_nand_partitions,
                        ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
index 495b989f9040bc9fca749e6842205cb21c447e5e,bf095648989933ca0c0171ff661fc998a704a96b..8afbba0923d6ce0edd5d2dd5f9dee1555d01963d
@@@ -44,7 -44,8 +44,7 @@@
  #include "gpmc.h"
  #include <linux/platform_data/mtd-nand-omap2.h>
  #include <video/omapdss.h>
 -#include <video/omap-panel-generic-dpi.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include <linux/platform_data/spi-omap2-mcspi.h>
  
@@@ -357,19 -358,20 +357,20 @@@ static int __init omap3_stalker_i2c_ini
  
  #define OMAP3_STALKER_TS_GPIO 175
  
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 2,
+               .reset_gpio = 21,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct platform_device *omap3_stalker_devices[] __initdata = {
        &keys_gpio,
  };
  
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset = true,
-       .reset_gpio_port[0] = -EINVAL,
-       .reset_gpio_port[1] = 21,
-       .reset_gpio_port[2] = -EINVAL,
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -406,6 -408,8 +407,8 @@@ static void __init omap3_stalker_init(v
        omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
        usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
        omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
  
index 630833235cbc45eb4e192ccb498f378c729ef8a8,ab79a4422bcc6301e63a2d10b5b835cb85ad306f..f9101407cd560f2c984cc0d498e5eb73a7f1bf1f
@@@ -47,7 -47,8 +47,7 @@@
  #include <asm/mach/map.h>
  
  #include <video/omapdss.h>
 -#include <video/omap-panel-generic-dpi.h>
 -#include <video/omap-panel-tfp410.h>
 +#include <video/omap-panel-data.h>
  
  #include "common.h"
  #include "mux.h"
@@@ -457,14 -458,16 +457,16 @@@ static int __init overo_spi_init(void
        return 0;
  }
  
+ static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 2,
+               .reset_gpio = OVERO_GPIO_USBH_NRESET,
+               .vcc_gpio = -EINVAL,
+       },
+ };
  static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = -EINVAL,
-       .reset_gpio_port[1]  = OVERO_GPIO_USBH_NRESET,
-       .reset_gpio_port[2]  = -EINVAL
  };
  
  #ifdef CONFIG_OMAP_MUX
@@@ -501,6 -504,8 +503,8 @@@ static void __init overo_init(void
                        ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
        usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
        overo_init_smsc911x();
index df00e7580aa777738c0ef619ad4d6e80d7b8c0ee,bf70e2b57ff8004b3052ddbaefe046389d97b454..d555cf2459e14184f98d2e07590e476970e4df16
@@@ -82,8 -82,7 +82,7 @@@ extern void omap2_init_common_infrastru
  extern void omap2_sync32k_timer_init(void);
  extern void omap3_sync32k_timer_init(void);
  extern void omap3_secure_sync32k_timer_init(void);
- extern void omap3_gp_gptimer_timer_init(void);
- extern void omap3_am33xx_gptimer_timer_init(void);
+ extern void omap3_gptimer_timer_init(void);
  extern void omap4_local_timer_init(void);
  extern void omap5_realtime_timer_init(void);
  
@@@ -110,14 -109,6 +109,14 @@@ void am35xx_init_late(void)
  void ti81xx_init_late(void);
  int omap2_common_pm_late_init(void);
  
 +#ifdef CONFIG_SOC_BUS
 +void omap_soc_device_init(void);
 +#else
 +static inline void omap_soc_device_init(void)
 +{
 +}
 +#endif
 +
  #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
  void omap2xxx_restart(char mode, const char *cmd);
  #else
@@@ -257,6 -248,7 +256,6 @@@ extern int omap4_enter_lowpower(unsigne
  extern int omap4_finish_suspend(unsigned long cpu_state);
  extern void omap4_cpu_resume(void);
  extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
 -extern u32 omap4_mpuss_read_prev_context_state(void);
  #else
  static inline int omap4_enter_lowpower(unsigned int cpu,
                                        unsigned int power_state)
@@@ -284,6 -276,10 +283,6 @@@ static inline int omap4_finish_suspend(
  static inline void omap4_cpu_resume(void)
  {}
  
 -static inline u32 omap4_mpuss_read_prev_context_state(void)
 -{
 -      return 0;
 -}
  #endif
  
  struct omap_sdrc_params;
@@@ -296,8 -292,5 +295,8 @@@ extern void omap_reserve(void)
  struct omap_hwmod;
  extern int omap_dss_reset(struct omap_hwmod *);
  
 +/* SoC specific clock initializer */
 +extern int (*omap_clk_init)(void);
 +
  #endif /* __ASSEMBLER__ */
  #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
index 8d5fa6ece014e63e66ae4c3e56f86440a8de6cfe,0a8663c5f2ba4e064db16b02a5bfc6f6ed6be29c..f2f7088bfd221c9bb50df7180f1dbbc51a9e2e2d
@@@ -30,27 -30,32 +30,30 @@@ config CPU_S3C241
        select S3C2410_CLOCK
        select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
        select S3C2410_PM if PM
+       select SAMSUNG_HRT
        help
          Support for S3C2410 and S3C2410A family from the S3C24XX line
          of Samsung Mobile CPUs.
  
  config CPU_S3C2412
        bool "SAMSUNG S3C2412"
 -      depends on ARCH_S3C24XX
        select CPU_ARM926T
        select CPU_LLSERIAL_S3C2440
        select S3C2412_DMA if S3C24XX_DMA
        select S3C2412_PM if PM
+       select SAMSUNG_HRT
        help
          Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
  
  config CPU_S3C2416
        bool "SAMSUNG S3C2416/S3C2450"
 -      depends on ARCH_S3C24XX
        select CPU_ARM926T
        select CPU_LLSERIAL_S3C2440
        select S3C2416_PM if PM
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
        select SAMSUNG_CLKSRC
+       select SAMSUNG_HRT
        help
          Support for the S3C2416 SoC from the S3C24XX line
  
@@@ -61,6 -66,7 +64,7 @@@ config CPU_S3C244
        select S3C2410_CLOCK
        select S3C2410_PM if PM
        select S3C2440_DMA if S3C24XX_DMA
+       select SAMSUNG_HRT
        help
          Support for S3C2440 Samsung Mobile CPU based systems.
  
@@@ -70,6 -76,7 +74,7 @@@ config CPU_S3C244
        select CPU_LLSERIAL_S3C2440
        select S3C2410_CLOCK
        select S3C2410_PM if PM
+       select SAMSUNG_HRT
        help
          Support for S3C2442 Samsung Mobile CPU based systems.
  
@@@ -79,11 -86,13 +84,12 @@@ config CPU_S3C244
  
  config CPU_S3C2443
        bool "SAMSUNG S3C2443"
 -      depends on ARCH_S3C24XX
        select CPU_ARM920T
        select CPU_LLSERIAL_S3C2440
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
        select SAMSUNG_CLKSRC
+       select SAMSUNG_HRT
        help
          Support for the S3C2443 SoC from the S3C24XX line
  
@@@ -130,6 -139,7 +136,6 @@@ config S3C24XX_SETUP_T
  
  config S3C24XX_DMA
        bool "S3C2410 DMA support"
 -      depends on ARCH_S3C24XX
        select S3C_DMA
        help
          S3C2410 DMA support. This is needed for drivers like sound which
  
  config S3C2410_DMA_DEBUG
        bool "S3C2410 DMA support debug"
 -      depends on ARCH_S3C24XX && S3C2410_DMA
 +      depends on S3C2410_DMA
        help
          Enable debugging output for the DMA code. This option sends info
          to the kernel log, at priority KERN_DEBUG.
@@@ -229,7 -239,7 +235,7 @@@ if CPU_S3C241
  
  config S3C2410_CPUFREQ
        bool
 -      depends on CPU_FREQ_S3C24XX && CPU_S3C2410
 +      depends on CPU_FREQ_S3C24XX
        select S3C2410_CPUFREQ_UTILS
        help
          CPU Frequency scaling support for S3C2410
@@@ -316,6 -326,7 +322,6 @@@ config PM_H194
  
  config MACH_N30
        bool "Acer N30 family"
 -      select MACH_N35
        select S3C_DEV_NAND
        select S3C_DEV_USB_HOST
        help
@@@ -375,13 -386,14 +381,13 @@@ if CPU_S3C241
  
  config CPU_S3C2412_ONLY
        bool
 -      depends on ARCH_S3C24XX && !CPU_S3C2410 && \
 -                 !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
 -                 !CPU_S3C2443 && CPU_S3C2412
 +      depends on !CPU_S3C2410 && !CPU_S3C2416 && !CPU_S3C2440 && \
 +                 !CPU_S3C2442 && !CPU_S3C2443
        default y
  
  config S3C2412_CPUFREQ
        bool
 -      depends on CPU_FREQ_S3C24XX && CPU_S3C2412
 +      depends on CPU_FREQ_S3C24XX
        default y
        select S3C2412_IOTIMING
        help
@@@ -395,6 -407,7 +401,7 @@@ config S3C2412_DM
  config S3C2412_PM
        bool
        select S3C2412_PM_SLEEP
+       select SAMSUNG_WAKEMASK
        help
          Internal config node to apply S3C2412 power management
  
@@@ -636,6 -649,7 +643,6 @@@ comment "S3C2442 Boards
  config MACH_NEO1973_GTA02
        bool "Openmoko GTA02 / Freerunner phone"
        select I2C
 -      select MACH_NEO1973
        select MFD_PCF50633
        select PCF50633_GPIO
        select POWER_SUPPLY
@@@ -656,7 -670,10 +663,7 @@@ config MACH_RX195
        help
           Say Y here if you're using HP iPAQ rx1950
  
 -config SMDK2440_CPU2442
 -      bool "SMDM2440 with S3C2442 CPU module"
 -
 -endif # CPU_S3C2440
 +endif # CPU_S3C2442
  
  if CPU_S3C2443 || CPU_S3C2416
  
index 1e73f5fa865983cd0a79fae37623af0f4a0ebbaf,43cada8019b449e46b98d7aca57d89f5bfcf9520..b6dd4cb5a2eceea29a2eb2e7194e741b133d4f95
  #define IRQ_ADCPARENT  S3C2410_IRQ(31)
  
  /* interrupts generated from the external interrupts sources */
- #define IRQ_EINT4      S3C2410_IRQ(32)           /* 48 */
- #define IRQ_EINT5      S3C2410_IRQ(33)
- #define IRQ_EINT6      S3C2410_IRQ(34)
- #define IRQ_EINT7      S3C2410_IRQ(35)
- #define IRQ_EINT8      S3C2410_IRQ(36)
- #define IRQ_EINT9      S3C2410_IRQ(37)
- #define IRQ_EINT10     S3C2410_IRQ(38)
- #define IRQ_EINT11     S3C2410_IRQ(39)
- #define IRQ_EINT12     S3C2410_IRQ(40)
- #define IRQ_EINT13     S3C2410_IRQ(41)
- #define IRQ_EINT14     S3C2410_IRQ(42)
- #define IRQ_EINT15     S3C2410_IRQ(43)
- #define IRQ_EINT16     S3C2410_IRQ(44)
- #define IRQ_EINT17     S3C2410_IRQ(45)
- #define IRQ_EINT18     S3C2410_IRQ(46)
- #define IRQ_EINT19     S3C2410_IRQ(47)
- #define IRQ_EINT20     S3C2410_IRQ(48)           /* 64 */
- #define IRQ_EINT21     S3C2410_IRQ(49)
- #define IRQ_EINT22     S3C2410_IRQ(50)
- #define IRQ_EINT23     S3C2410_IRQ(51)
+ #define IRQ_EINT0_2412 S3C2410_IRQ(32)
+ #define IRQ_EINT1_2412 S3C2410_IRQ(33)
+ #define IRQ_EINT2_2412 S3C2410_IRQ(34)
+ #define IRQ_EINT3_2412 S3C2410_IRQ(35)
+ #define IRQ_EINT4      S3C2410_IRQ(36)           /* 52 */
+ #define IRQ_EINT5      S3C2410_IRQ(37)
+ #define IRQ_EINT6      S3C2410_IRQ(38)
+ #define IRQ_EINT7      S3C2410_IRQ(39)
+ #define IRQ_EINT8      S3C2410_IRQ(40)
+ #define IRQ_EINT9      S3C2410_IRQ(41)
+ #define IRQ_EINT10     S3C2410_IRQ(42)
+ #define IRQ_EINT11     S3C2410_IRQ(43)
+ #define IRQ_EINT12     S3C2410_IRQ(44)
+ #define IRQ_EINT13     S3C2410_IRQ(45)
+ #define IRQ_EINT14     S3C2410_IRQ(46)
+ #define IRQ_EINT15     S3C2410_IRQ(47)
+ #define IRQ_EINT16     S3C2410_IRQ(48)
+ #define IRQ_EINT17     S3C2410_IRQ(49)
+ #define IRQ_EINT18     S3C2410_IRQ(50)
+ #define IRQ_EINT19     S3C2410_IRQ(51)
+ #define IRQ_EINT20     S3C2410_IRQ(52)           /* 68 */
+ #define IRQ_EINT21     S3C2410_IRQ(53)
+ #define IRQ_EINT22     S3C2410_IRQ(54)
+ #define IRQ_EINT23     S3C2410_IRQ(55)
  
  #define IRQ_EINT_BIT(x)       ((x) - IRQ_EINT4 + 4)
  #define IRQ_EINT(x)    (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x)))
  
- #define IRQ_LCD_FIFO   S3C2410_IRQ(52)
- #define IRQ_LCD_FRAME  S3C2410_IRQ(53)
+ #define IRQ_LCD_FIFO   S3C2410_IRQ(56)
+ #define IRQ_LCD_FRAME  S3C2410_IRQ(57)
  
  /* IRQs for the interal UARTs, and ADC
   * these need to be ordered in number of appearance in the
   * SUBSRC mask register
  */
  
- #define S3C2410_IRQSUB(x)     S3C2410_IRQ((x)+54)
+ #define S3C2410_IRQSUB(x)     S3C2410_IRQ((x)+58)
  
- #define IRQ_S3CUART_RX0               S3C2410_IRQSUB(0)       /* 70 */
+ #define IRQ_S3CUART_RX0               S3C2410_IRQSUB(0)       /* 74 */
  #define IRQ_S3CUART_TX0               S3C2410_IRQSUB(1)
  #define IRQ_S3CUART_ERR0      S3C2410_IRQSUB(2)
  
- #define IRQ_S3CUART_RX1               S3C2410_IRQSUB(3)       /* 73 */
+ #define IRQ_S3CUART_RX1               S3C2410_IRQSUB(3)       /* 77 */
  #define IRQ_S3CUART_TX1               S3C2410_IRQSUB(4)
  #define IRQ_S3CUART_ERR1      S3C2410_IRQSUB(5)
  
- #define IRQ_S3CUART_RX2               S3C2410_IRQSUB(6)       /* 76 */
+ #define IRQ_S3CUART_RX2               S3C2410_IRQSUB(6)       /* 80 */
  #define IRQ_S3CUART_TX2               S3C2410_IRQSUB(7)
  #define IRQ_S3CUART_ERR2      S3C2410_IRQSUB(8)
  
  
  /* second interrupt-register of s3c2416/s3c2450 */
  
- #define S3C2416_IRQ(x)                S3C2410_IRQ((x) + 54 + 29)
+ #define S3C2416_IRQ(x)                S3C2410_IRQ((x) + 58 + 29)
  #define IRQ_S3C2416_2D                S3C2416_IRQ(0)
  #define IRQ_S3C2416_IIC1      S3C2416_IRQ(1)
  #define IRQ_S3C2416_RESERVED2 S3C2416_IRQ(2)
  
  #if defined(CONFIG_CPU_S3C2416)
  #define NR_IRQS (IRQ_S3C2416_I2S1 + 1)
 -#elif defined(CONFIG_CPU_S3C2443)
 -#define NR_IRQS (IRQ_S3C2443_AC97+1)
  #else
 -#define NR_IRQS (IRQ_S3C2440_AC97+1)
 +#define NR_IRQS (IRQ_S3C2443_AC97 + 1)
  #endif
  
  /* compatibility define. */
index 43f3ac5a1c7af7a86b39cb0a7032454aa4f0f3a6,e4d67a33ebee77d9d2dc5bb2de28d680a216c1c6..44ca018e1f9654ff07e90973ad572d8a3601ecbb
@@@ -56,7 -56,9 +56,8 @@@
  #include <plat/cpu.h>
  #include <plat/devs.h>
  #include <plat/pm.h>
 -#include <plat/regs-iic.h>
  #include <plat/regs-serial.h>
+ #include <plat/samsung-time.h>
  
  #include "common.h"
  #include "h1940.h"
@@@ -740,6 -742,7 +741,7 @@@ static void __init rx1950_map_io(void
        s3c24xx_init_io(rx1950_iodesc, ARRAY_SIZE(rx1950_iodesc));
        s3c24xx_init_clocks(16934000);
        s3c24xx_init_uarts(rx1950_uartcfgs, ARRAY_SIZE(rx1950_uartcfgs));
+       samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  
        /* setup PM */
  
@@@ -810,8 -813,8 +812,8 @@@ MACHINE_START(RX1950, "HP iPAQ RX1950"
        .atag_offset = 0x100,
        .map_io = rx1950_map_io,
        .reserve        = rx1950_reserve,
-       .init_irq = s3c24xx_init_irq,
+       .init_irq       = s3c2442_init_irq,
        .init_machine = rx1950_init_machine,
-       .init_time      = s3c24xx_timer_init,
+       .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
  MACHINE_END
index a385f570bbfc81b14184f0b79e58a1328361b125,d34d12ae496b34144c1a2398071f06df31b41313..95fe396f96041626d408cdd9252091b27ed166fd
@@@ -81,7 -81,7 +81,7 @@@ static struct resource smsc9221_resourc
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = intcs_evt2irq(0x260), /* IRQ3 */
+               .start  = irq_pin(3), /* IRQ3 */
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -115,7 -115,7 +115,7 @@@ static struct resource usb_resources[] 
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = intcs_evt2irq(0x220), /* IRQ1 */
+               .start  = irq_pin(1), /* IRQ1 */
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -138,7 -138,7 +138,7 @@@ struct usbhs_private 
        struct renesas_usbhs_platform_info info;
  };
  
- #define IRQ15                 intcs_evt2irq(0x03e0)
+ #define IRQ15                 irq_pin(15)
  #define USB_PHY_MODE          (1 << 4)
  #define USB_PHY_INT_EN                ((1 << 3) | (1 << 2))
  #define USB_PHY_ON            (1 << 1)
@@@ -155,14 -155,12 +155,14 @@@ static int usbhs_get_vbus(struct platfo
        return !((1 << 7) & __raw_readw(priv->cr2));
  }
  
 -static void usbhs_phy_reset(struct platform_device *pdev)
 +static int usbhs_phy_reset(struct platform_device *pdev)
  {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
  
        /* init phy */
        __raw_writew(0x8a0a, priv->cr2);
 +
 +      return 0;
  }
  
  static int usbhs_get_id(struct platform_device *pdev)
@@@ -204,7 -202,7 +204,7 @@@ static int usbhs_hardware_init(struct p
        return 0;
  }
  
 -static void usbhs_hardware_exit(struct platform_device *pdev)
 +static int usbhs_hardware_exit(struct platform_device *pdev)
  {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
  
        __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy);
  
        free_irq(IRQ15, pdev);
 +
 +      return 0;
  }
  
  static u32 usbhs_pipe_cfg[] = {
@@@ -567,25 -563,25 +567,25 @@@ static struct i2c_board_info i2c0_devic
        },
        {
                I2C_BOARD_INFO("ak8975", 0x0c),
-               .irq = intcs_evt2irq(0x3380), /* IRQ28 */
+               .irq = irq_pin(28), /* IRQ28 */
        },
        {
                I2C_BOARD_INFO("adxl34x", 0x1d),
-               .irq = intcs_evt2irq(0x3340), /* IRQ26 */
+               .irq = irq_pin(26), /* IRQ26 */
        },
  };
  
  static struct i2c_board_info i2c1_devices[] = {
        {
                I2C_BOARD_INFO("st1232-ts", 0x55),
-               .irq = intcs_evt2irq(0x300), /* IRQ8 */
+               .irq = irq_pin(8), /* IRQ8 */
        },
  };
  
  static struct i2c_board_info i2c3_devices[] = {
        {
                I2C_BOARD_INFO("pcf8575", 0x20),
-               .irq            = intcs_evt2irq(0x3260), /* IRQ19 */
+               .irq = irq_pin(19), /* IRQ19 */
                .platform_data = &pcf8575_pdata,
        },
  };
index 62c04c252418635b950b9c88609a89a7e4e83e76,03f73def2fc6046a9a820d4267314252fbe5379c..1fef737a4c1a55af6c0c8c17a70211cc218faacf
@@@ -14,6 -14,9 +14,6 @@@ extern int shmobile_clk_init(void)
  extern void shmobile_handle_irq_intc(struct pt_regs *);
  extern struct platform_suspend_ops shmobile_suspend_ops;
  struct cpuidle_driver;
 -struct cpuidle_device;
 -extern int shmobile_enter_wfi(struct cpuidle_device *dev,
 -                            struct cpuidle_driver *drv, int index);
  extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
  
  extern void sh7372_init_irq(void);
@@@ -58,6 -61,7 +58,7 @@@ extern void r8a7740_pm_init(void)
  
  extern void r8a7779_init_delay(void);
  extern void r8a7779_init_irq(void);
+ extern void r8a7779_init_irq_extpin(int irlm);
  extern void r8a7779_init_irq_dt(void);
  extern void r8a7779_map_io(void);
  extern void r8a7779_earlytimer_init(void);
index 9cf1ab17afeb9ddd7069ab0b7a1c56b3cc930e4d,61749e2d811112d67642db8d9eeecb151e0b127b..0d1e4128d460effbe40eecb1c299d782df3c8231
  #include <linux/pda_power.h>
  #include <linux/platform_data/tegra_usb.h>
  #include <linux/io.h>
 -#include <linux/i2c.h>
 -#include <linux/i2c-tegra.h>
  #include <linux/slab.h>
  #include <linux/sys_soc.h>
  #include <linux/usb/tegra_usb_phy.h>
+ #include <linux/clk/tegra.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -85,6 -88,8 +86,8 @@@ static void __init tegra_dt_init(void
        struct soc_device *soc_dev;
        struct device *parent = NULL;
  
+       tegra_clocks_apply_init_table();
        soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
        if (!soc_dev_attr)
                goto out;
index f3976f9c404a1bb04da0850badc3e17e421e8790,152ae38cd18c24dbce5c3442f3b9f14d72ed11ec..947bd9eca079c0d738c5d7e9a0f53841e322a571
@@@ -13,6 -13,8 +13,6 @@@
  
  #include <asm/mach-types.h>
  
 -#include <mach/hardware.h>
 -
  #include "pins-db8500.h"
  #include "board-mop500.h"
  
@@@ -46,8 -48,12 +46,12 @@@ BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE
        PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE);
  BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED|
        PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
+ BIAS(slpm_in_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|
+       PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
  BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED|
        PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
+ BIAS(slpm_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|
+       PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
  BIAS(slpm_out_lo_pdis, PIN_SLEEPMODE_ENABLED|
        PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE|PIN_SLPM_PDIS_DISABLED);
  BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED|
@@@ -76,9 -82,6 +80,6 @@@ BIAS(out_wkup_pdis, PIN_SLPM_DIR_OUTPUT
        PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func)
  #define DB8500_PIN_HOG(pin,conf) \
        PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf)
- #define DB8500_PIN_SLEEP(pin, conf, dev) \
-       PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
-                           pin, conf)
  
  /* These are default states associated with device and changed runtime */
  #define DB8500_MUX(group,func,dev) \
@@@ -307,8 -310,23 +308,23 @@@ static struct pinctrl_map __initdata mo
        DB8500_PIN_SLEEP("GPIO207_AJ23", slpm_in_wkup_pdis, "sdi4"), /* DAT4 */
  
        /* Mux in USB pins, drive STP high */
-       DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"),
-       DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */
+       /* USB default state */
+       DB8500_MUX("usb_a_1", "usb", "ab8500-usb.0"),
+       DB8500_PIN("GPIO257_AE29", out_hi, "ab8500-usb.0"), /* STP */
+       /* USB sleep state */
+       DB8500_PIN_SLEEP("GPIO256_AF28", slpm_wkup_pdis_en, "ab8500-usb.0"), /* NXT */
+       DB8500_PIN_SLEEP("GPIO257_AE29", slpm_out_hi_wkup_pdis, "ab8500-usb.0"), /* STP */
+       DB8500_PIN_SLEEP("GPIO258_AD29", slpm_wkup_pdis_en, "ab8500-usb.0"), /* XCLK */
+       DB8500_PIN_SLEEP("GPIO259_AC29", slpm_wkup_pdis_en, "ab8500-usb.0"), /* DIR */
+       DB8500_PIN_SLEEP("GPIO260_AD28", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT7 */
+       DB8500_PIN_SLEEP("GPIO261_AD26", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT6 */
+       DB8500_PIN_SLEEP("GPIO262_AE26", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT5 */
+       DB8500_PIN_SLEEP("GPIO263_AG29", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT4 */
+       DB8500_PIN_SLEEP("GPIO264_AE27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT3 */
+       DB8500_PIN_SLEEP("GPIO265_AD27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT2 */
+       DB8500_PIN_SLEEP("GPIO266_AC28", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT1 */
+       DB8500_PIN_SLEEP("GPIO267_AC27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT0 */
        /* Mux in SPI2 pins on the "other C1" altfunction */
        DB8500_MUX("spi2_oc1_2", "spi2", "spi2"),
        DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */
        DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */
        DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */
        /* SPI2 idle state */
-       DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
-       DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */
-       DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */
+       DB8500_PIN_IDLE("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
+       DB8500_PIN_IDLE("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */
+       DB8500_PIN_IDLE("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */
        /* SPI2 sleep state */
        DB8500_PIN_SLEEP("GPIO216_AG12", slpm_in_wkup_pdis, "spi2"), /* FRM */
        DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
@@@ -745,6 -763,8 +761,8 @@@ static struct pinctrl_map __initdata sn
        DB8500_PIN_HOG("GPIO21_AB3", out_hi),
        /* Mux in "SM" which is used for the SMSC911x Ethernet adapter */
        DB8500_MUX_HOG("sm_b_1", "sm"),
+       /* User LED */
+       DB8500_PIN_HOG("GPIO142_C11", gpio_out_hi),
        /* Drive RSTn_LAN high */
        DB8500_PIN_HOG("GPIO141_C12", gpio_out_hi),
        /*  Accelerometer/Magnetometer */
index 138b5891f4ef817c37d91008119c4323d4c4f482,d70651e8b7057f0585d195c926c2aac2636cf6c2..cf3226b041f51a7f8b53daa60e3aa1a0bce9c2bc
@@@ -5,11 -5,10 +5,12 @@@ config ARCH_ZYN
        select COMMON_CLK
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 +      select HAVE_ARM_SCU if SMP
 +      select HAVE_ARM_TWD if LOCAL_TIMERS
        select ICST
        select MIGHT_HAVE_CACHE_L2X0
        select USE_OF
        select SPARSE_IRQ
+       select CADENCE_TTC_TIMER
        help
          Support for Xilinx Zynq ARM Cortex A9 Platform
index 91c2d72e689b5c7670d151e12dcd550775a845c0,6cb19c6aa9d68d5b4a3ee89c2d46fb163fbd810e..54d186106f9f2c9727ee1f662adf44ac1cad83d5
@@@ -25,7 -25,7 +25,7 @@@ config PLAT_S5
        select PLAT_SAMSUNG
        select S3C_GPIO_TRACK
        select S5P_GPIO_DRVSTR
-       select SAMSUNG_CLKSRC
+       select SAMSUNG_CLKSRC if !COMMON_CLK
        select SAMSUNG_GPIOLIB_4BIT
        select SAMSUNG_IRQ_VIC_TIMER
        help
@@@ -37,6 -37,14 +37,6 @@@ if PLAT_SAMSUN
  
  comment "Boot options"
  
 -config S3C_BOOT_WATCHDOG
 -      bool "S3C Initialisation watchdog"
 -      depends on S3C2410_WATCHDOG
 -      help
 -        Say y to enable the watchdog during the kernel decompression
 -        stage. If the kernel fails to uncompress, then the watchdog
 -        will trigger a reset and the system should restart.
 -
  config S3C_BOOT_ERROR_RESET
        bool "S3C Reboot on decompression error"
        help
@@@ -62,7 -70,7 +62,7 @@@ config S3C_LOWLEVEL_UART_POR
  
  # timer options
  
- config S5P_HRT
+ config SAMSUNG_HRT
        bool
        select SAMSUNG_DEV_PWM
        help
@@@ -81,7 -89,7 +81,7 @@@ config SAMSUNG_CLKSR
          used by newer systems such as the S3C64XX.
  
  config S5P_CLOCK
-       def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
+       def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210)
        help
          Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs
  
@@@ -117,6 -125,12 +117,6 @@@ config SAMSUNG_GPIOLIB_4BI
          configuration. GPIOlib shall be compiled only for S3C64XX and S5P
          series of processors.
  
 -config S3C_GPIO_CFG_S3C64XX
 -      bool
 -      help
 -        Internal configuration to enable S3C64XX style GPIO configuration
 -        functions.
 -
  config S5P_GPIO_DRVSTR
        bool
        help
index 33ad3f32c2b91ffa7e7bae60ecb4e17baa59d2e2,4cf660e381826a4dd49e9605762533da667b370b..30c2fe243f7658c0002c93ce4c9aaf154e1ca1db
@@@ -10,7 -10,6 +10,7 @@@
   * published by the Free Software Foundation.
  */
  
 +#include <linux/amba/pl330.h>
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
@@@ -63,6 -62,7 +63,6 @@@
  #include <linux/platform_data/usb-s3c2410_udc.h>
  #include <linux/platform_data/usb-ohci-s3c2410.h>
  #include <plat/usb-phy.h>
 -#include <plat/regs-iic.h>
  #include <plat/regs-serial.h>
  #include <plat/regs-spi.h>
  #include <linux/platform_data/spi-s3c64xx.h>
@@@ -146,20 -146,14 +146,20 @@@ struct platform_device s3c_device_cami
  
  /* ASOC DMA */
  
 +#ifdef CONFIG_PLAT_S5P 
 +static struct resource samsung_asoc_idma_resource = DEFINE_RES_IRQ(IRQ_I2S0);
 +
  struct platform_device samsung_asoc_idma = {
        .name           = "samsung-idma",
        .id             = -1,
 +      .num_resources  = 1,
 +      .resource       = &samsung_asoc_idma_resource,
        .dev            = {
                .dma_mask               = &samsung_device_dma_mask,
                .coherent_dma_mask      = DMA_BIT_MASK(32),
        }
  };
 +#endif
  
  /* FB */
  
@@@ -1074,7 -1068,7 +1074,7 @@@ struct platform_device s5p_device_onena
  
  /* PMU */
  
- #ifdef CONFIG_PLAT_S5P
+ #if defined(CONFIG_PLAT_S5P) && !defined(CONFIG_ARCH_EXYNOS)
  static struct resource s5p_pmu_resource[] = {
        DEFINE_RES_IRQ(IRQ_PMU)
  };
@@@ -1513,9 -1507,6 +1513,9 @@@ void __init s3c64xx_spi0_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
  }
@@@ -1554,9 -1545,6 +1554,9 @@@ void __init s3c64xx_spi1_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi1);
  }
@@@ -1595,9 -1583,6 +1595,9 @@@ void __init s3c64xx_spi2_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi2_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi2);
  }
diff --combined drivers/Kconfig
index 8d96238549faa3cb8c2a99a9fb944a1fe86428b8,847f8e31f3dd8e5c475d8f8b8ef26ca181ceb596..9953a42809ec85f3782cb980bfea739bbeed448f
@@@ -52,8 -52,6 +52,8 @@@ source "drivers/i2c/Kconfig
  
  source "drivers/spi/Kconfig"
  
 +source "drivers/ssbi/Kconfig"
 +
  source "drivers/hsi/Kconfig"
  
  source "drivers/pps/Kconfig"
@@@ -120,8 -118,6 +120,8 @@@ source "drivers/vfio/Kconfig
  
  source "drivers/vlynq/Kconfig"
  
 +source "drivers/virt/Kconfig"
 +
  source "drivers/virtio/Kconfig"
  
  source "drivers/hv/Kconfig"
@@@ -146,6 -142,8 +146,6 @@@ source "drivers/remoteproc/Kconfig
  
  source "drivers/rpmsg/Kconfig"
  
 -source "drivers/virt/Kconfig"
 -
  source "drivers/devfreq/Kconfig"
  
  source "drivers/extcon/Kconfig"
@@@ -164,4 -162,6 +164,6 @@@ source "drivers/irqchip/Kconfig
  
  source "drivers/ipack/Kconfig"
  
+ source "drivers/reset/Kconfig"
  endmenu
diff --combined drivers/Makefile
index 8e57688ebd950be25694f349d4f79a0a984a17fd,1a64c4cd9094b8f1df1c79dd5793ca723a54cce8..130abc1dfd65419688ec4195e2925c302a5d673f
@@@ -37,6 -37,9 +37,9 @@@ obj-$(CONFIG_XEN)             += xen
  # regulators early, since some subsystems rely on them to initialize
  obj-$(CONFIG_REGULATOR)               += regulator/
  
+ # reset controllers early, since gpu drivers might rely on them to initialize
+ obj-$(CONFIG_RESET_CONTROLLER)        += reset/
  # tty/ comes before char/ so that the VT console is the boot-time
  # default.
  obj-y                         += tty/
@@@ -79,7 -82,7 +82,7 @@@ obj-$(CONFIG_ATA_OVER_ETH)    += block/aoe
  obj-$(CONFIG_PARIDE)          += block/paride/
  obj-$(CONFIG_TC)              += tc/
  obj-$(CONFIG_UWB)             += uwb/
 -obj-$(CONFIG_USB_OTG_UTILS)   += usb/
 +obj-$(CONFIG_USB_PHY)         += usb/
  obj-$(CONFIG_USB)             += usb/
  obj-$(CONFIG_PCI)             += usb/
  obj-$(CONFIG_USB_GADGET)      += usb/
@@@ -114,7 -117,6 +117,7 @@@ obj-y                              += firmware
  obj-$(CONFIG_CRYPTO)          += crypto/
  obj-$(CONFIG_SUPERH)          += sh/
  obj-$(CONFIG_ARCH_SHMOBILE)   += sh/
 +obj-$(CONFIG_SSBI)            += ssbi/
  ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
  obj-y                         += clocksource/
  endif
@@@ -124,7 -126,7 +127,7 @@@ obj-$(CONFIG_PPC_PS3)              += ps3
  obj-$(CONFIG_OF)              += of/
  obj-$(CONFIG_SSB)             += ssb/
  obj-$(CONFIG_BCMA)            += bcma/
 -obj-$(CONFIG_VHOST_NET)               += vhost/
 +obj-$(CONFIG_VHOST_RING)      += vhost/
  obj-$(CONFIG_VLYNQ)           += vlynq/
  obj-$(CONFIG_STAGING)         += staging/
  obj-y                         += platform/
diff --combined drivers/clk/Makefile
index e7f7fe9b2f0997f1f371b43fe5e25672cb4d41c6,17e8dc4e417cfdfa397a83649a1628f02fa382c3..137d3e730f866a2f10f75701801179c53d6340a5
@@@ -29,6 -29,7 +29,7 @@@ obj-$(CONFIG_ARCH_U8500)      += ux500
  obj-$(CONFIG_ARCH_VT8500)     += clk-vt8500.o
  obj-$(CONFIG_ARCH_ZYNQ)               += clk-zynq.o
  obj-$(CONFIG_ARCH_TEGRA)      += tegra/
+ obj-$(CONFIG_PLAT_SAMSUNG)    += samsung/
  
  obj-$(CONFIG_X86)             += x86/
  
@@@ -36,5 -37,4 +37,5 @@@
  obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o
  obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
  obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
 +obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
  obj-$(CONFIG_CLK_TWL6040)     += clk-twl6040.o
index bf194009e20fc029d063b70ae5e741724d4dbb64,b0405b67f49c710843e9d16d46930f015f25bf59..8292a00c3de9f1dbae8b19e23b6ac45b3d275866
@@@ -86,8 -86,8 +86,8 @@@
  #define PLLE_BASE 0xe8
  #define PLLE_MISC 0xec
  
- #define PLL_BASE_LOCK 27
- #define PLLE_MISC_LOCK 11
+ #define PLL_BASE_LOCK BIT(27)
+ #define PLLE_MISC_LOCK BIT(11)
  
  #define PLL_MISC_LOCK_ENABLE 18
  #define PLLDU_MISC_LOCK_ENABLE 22
@@@ -236,7 -236,7 +236,7 @@@ enum tegra20_clk 
        dvc, dsi, mipi = 50, hdmi, csi, tvdac, i2c2, uartc, emc = 57, usb2,
        usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3,
        pex, owr, afi, csite, pcie_xclk, avpucq = 75, la, irama = 84, iramb,
-       iramc, iramd, cram2, audio_2x, clk_d, csus = 92, cdev1, cdev2,
+       iramc, iramd, cram2, audio_2x, clk_d, csus = 92, cdev2, cdev1,
        uartb = 96, vfir, spdif_in, spdif_out, vi, vi_sensor, tvo, cve,
        osc, clk_32k, clk_m, sclk, cclk, hclk, pclk, blink, pll_a, pll_a_out0,
        pll_c, pll_c_out1, pll_d, pll_d_out0, pll_e, pll_m, pll_m_out1,
@@@ -248,125 -248,125 +248,125 @@@ static struct clk *clks[clk_max]
  static struct clk_onecell_data clk_data;
  
  static struct tegra_clk_pll_freq_table pll_c_freq_table[] = {
-       { 12000000, 600000000, 600, 12, 1, 8 },
-       { 13000000, 600000000, 600, 13, 1, 8 },
-       { 19200000, 600000000, 500, 16, 1, 6 },
-       { 26000000, 600000000, 600, 26, 1, 8 },
+       { 12000000, 600000000, 600, 12, 0, 8 },
+       { 13000000, 600000000, 600, 13, 0, 8 },
+       { 19200000, 600000000, 500, 16, 0, 6 },
+       { 26000000, 600000000, 600, 26, 0, 8 },
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
-       { 12000000, 666000000, 666, 12, 1, 8},
-       { 13000000, 666000000, 666, 13, 1, 8},
-       { 19200000, 666000000, 555, 16, 1, 8},
-       { 26000000, 666000000, 666, 26, 1, 8},
-       { 12000000, 600000000, 600, 12, 1, 8},
-       { 13000000, 600000000, 600, 13, 1, 8},
-       { 19200000, 600000000, 375, 12, 1, 6},
-       { 26000000, 600000000, 600, 26, 1, 8},
+       { 12000000, 666000000, 666, 12, 0, 8},
+       { 13000000, 666000000, 666, 13, 0, 8},
+       { 19200000, 666000000, 555, 16, 0, 8},
+       { 26000000, 666000000, 666, 26, 0, 8},
+       { 12000000, 600000000, 600, 12, 0, 8},
+       { 13000000, 600000000, 600, 13, 0, 8},
+       { 19200000, 600000000, 375, 12, 0, 6},
+       { 26000000, 600000000, 600, 26, 0, 8},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
-       { 12000000, 216000000, 432, 12, 2, 8},
-       { 13000000, 216000000, 432, 13, 2, 8},
-       { 19200000, 216000000, 90,   4, 2, 1},
-       { 26000000, 216000000, 432, 26, 2, 8},
-       { 12000000, 432000000, 432, 12, 1, 8},
-       { 13000000, 432000000, 432, 13, 1, 8},
-       { 19200000, 432000000, 90,   4, 1, 1},
-       { 26000000, 432000000, 432, 26, 1, 8},
+       { 12000000, 216000000, 432, 12, 1, 8},
+       { 13000000, 216000000, 432, 13, 1, 8},
+       { 19200000, 216000000, 90,   4, 1, 1},
+       { 26000000, 216000000, 432, 26, 1, 8},
+       { 12000000, 432000000, 432, 12, 0, 8},
+       { 13000000, 432000000, 432, 13, 0, 8},
+       { 19200000, 432000000, 90,   4, 0, 1},
+       { 26000000, 432000000, 432, 26, 0, 8},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
-       { 28800000, 56448000, 49, 25, 1, 1},
-       { 28800000, 73728000, 64, 25, 1, 1},
-       { 28800000, 24000000,  5,  6, 1, 1},
+       { 28800000, 56448000, 49, 25, 0, 1},
+       { 28800000, 73728000, 64, 25, 0, 1},
+       { 28800000, 24000000,  5,  6, 0, 1},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
-       { 12000000, 216000000, 216, 12, 1, 4},
-       { 13000000, 216000000, 216, 13, 1, 4},
-       { 19200000, 216000000, 135, 12, 1, 3},
-       { 26000000, 216000000, 216, 26, 1, 4},
+       { 12000000, 216000000, 216, 12, 0, 4},
+       { 13000000, 216000000, 216, 13, 0, 4},
+       { 19200000, 216000000, 135, 12, 0, 3},
+       { 26000000, 216000000, 216, 26, 0, 4},
  
-       { 12000000, 594000000, 594, 12, 1, 8},
-       { 13000000, 594000000, 594, 13, 1, 8},
-       { 19200000, 594000000, 495, 16, 1, 8},
-       { 26000000, 594000000, 594, 26, 1, 8},
+       { 12000000, 594000000, 594, 12, 0, 8},
+       { 13000000, 594000000, 594, 13, 0, 8},
+       { 19200000, 594000000, 495, 16, 0, 8},
+       { 26000000, 594000000, 594, 26, 0, 8},
  
-       { 12000000, 1000000000, 1000, 12, 1, 12},
-       { 13000000, 1000000000, 1000, 13, 1, 12},
-       { 19200000, 1000000000, 625,  12, 1, 8},
-       { 26000000, 1000000000, 1000, 26, 1, 12},
+       { 12000000, 1000000000, 1000, 12, 0, 12},
+       { 13000000, 1000000000, 1000, 13, 0, 12},
+       { 19200000, 1000000000, 625,  12, 0, 8},
+       { 26000000, 1000000000, 1000, 26, 0, 12},
  
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
-       { 12000000, 480000000, 960, 12, 2, 0},
-       { 13000000, 480000000, 960, 13, 2, 0},
-       { 19200000, 480000000, 200, 4,  2, 0},
-       { 26000000, 480000000, 960, 26, 2, 0},
+       { 12000000, 480000000, 960, 12, 0, 0},
+       { 13000000, 480000000, 960, 13, 0, 0},
+       { 19200000, 480000000, 200, 4,  0, 0},
+       { 26000000, 480000000, 960, 26, 0, 0},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
        /* 1 GHz */
-       { 12000000, 1000000000, 1000, 12, 1, 12},
-       { 13000000, 1000000000, 1000, 13, 1, 12},
-       { 19200000, 1000000000, 625,  12, 1, 8},
-       { 26000000, 1000000000, 1000, 26, 1, 12},
+       { 12000000, 1000000000, 1000, 12, 0, 12},
+       { 13000000, 1000000000, 1000, 13, 0, 12},
+       { 19200000, 1000000000, 625,  12, 0, 8},
+       { 26000000, 1000000000, 1000, 26, 0, 12},
  
        /* 912 MHz */
-       { 12000000, 912000000,  912,  12, 1, 12},
-       { 13000000, 912000000,  912,  13, 1, 12},
-       { 19200000, 912000000,  760,  16, 1, 8},
-       { 26000000, 912000000,  912,  26, 1, 12},
+       { 12000000, 912000000,  912,  12, 0, 12},
+       { 13000000, 912000000,  912,  13, 0, 12},
+       { 19200000, 912000000,  760,  16, 0, 8},
+       { 26000000, 912000000,  912,  26, 0, 12},
  
        /* 816 MHz */
-       { 12000000, 816000000,  816,  12, 1, 12},
-       { 13000000, 816000000,  816,  13, 1, 12},
-       { 19200000, 816000000,  680,  16, 1, 8},
-       { 26000000, 816000000,  816,  26, 1, 12},
+       { 12000000, 816000000,  816,  12, 0, 12},
+       { 13000000, 816000000,  816,  13, 0, 12},
+       { 19200000, 816000000,  680,  16, 0, 8},
+       { 26000000, 816000000,  816,  26, 0, 12},
  
        /* 760 MHz */
-       { 12000000, 760000000,  760,  12, 1, 12},
-       { 13000000, 760000000,  760,  13, 1, 12},
-       { 19200000, 760000000,  950,  24, 1, 8},
-       { 26000000, 760000000,  760,  26, 1, 12},
+       { 12000000, 760000000,  760,  12, 0, 12},
+       { 13000000, 760000000,  760,  13, 0, 12},
+       { 19200000, 760000000,  950,  24, 0, 8},
+       { 26000000, 760000000,  760,  26, 0, 12},
  
        /* 750 MHz */
-       { 12000000, 750000000,  750,  12, 1, 12},
-       { 13000000, 750000000,  750,  13, 1, 12},
-       { 19200000, 750000000,  625,  16, 1, 8},
-       { 26000000, 750000000,  750,  26, 1, 12},
+       { 12000000, 750000000,  750,  12, 0, 12},
+       { 13000000, 750000000,  750,  13, 0, 12},
+       { 19200000, 750000000,  625,  16, 0, 8},
+       { 26000000, 750000000,  750,  26, 0, 12},
  
        /* 608 MHz */
-       { 12000000, 608000000,  608,  12, 1, 12},
-       { 13000000, 608000000,  608,  13, 1, 12},
-       { 19200000, 608000000,  380,  12, 1, 8},
-       { 26000000, 608000000,  608,  26, 1, 12},
+       { 12000000, 608000000,  608,  12, 0, 12},
+       { 13000000, 608000000,  608,  13, 0, 12},
+       { 19200000, 608000000,  380,  12, 0, 8},
+       { 26000000, 608000000,  608,  26, 0, 12},
  
        /* 456 MHz */
-       { 12000000, 456000000,  456,  12, 1, 12},
-       { 13000000, 456000000,  456,  13, 1, 12},
-       { 19200000, 456000000,  380,  16, 1, 8},
-       { 26000000, 456000000,  456,  26, 1, 12},
+       { 12000000, 456000000,  456,  12, 0, 12},
+       { 13000000, 456000000,  456,  13, 0, 12},
+       { 19200000, 456000000,  380,  16, 0, 8},
+       { 26000000, 456000000,  456,  26, 0, 12},
  
        /* 312 MHz */
-       { 12000000, 312000000,  312,  12, 1, 12},
-       { 13000000, 312000000,  312,  13, 1, 12},
-       { 19200000, 312000000,  260,  16, 1, 8},
-       { 26000000, 312000000,  312,  26, 1, 12},
+       { 12000000, 312000000,  312,  12, 0, 12},
+       { 13000000, 312000000,  312,  13, 0, 12},
+       { 19200000, 312000000,  260,  16, 0, 8},
+       { 26000000, 312000000,  312,  26, 0, 12},
  
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
-       { 12000000, 100000000,  200,  24, 1, 0 },
+       { 12000000, 100000000,  200,  24, 0, 0 },
        { 0, 0, 0, 0, 0, 0 },
  };
  
@@@ -380,7 -380,7 +380,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLC_BASE,
        .misc_reg = PLLC_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -394,7 -394,7 +394,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1200000000,
        .base_reg = PLLM_BASE,
        .misc_reg = PLLM_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -408,7 -408,7 +408,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLP_BASE,
        .misc_reg = PLLP_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -422,7 -422,7 +422,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLA_BASE,
        .misc_reg = PLLA_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -436,11 -436,17 +436,17 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1000000000,
        .base_reg = PLLD_BASE,
        .misc_reg = PLLD_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
        .lock_delay = 1000,
  };
  
+ static struct pdiv_map pllu_p[] = {
+       { .pdiv = 1, .hw_val = 1 },
+       { .pdiv = 2, .hw_val = 0 },
+       { .pdiv = 0, .hw_val = 0 },
+ };
  static struct tegra_clk_pll_params pll_u_params = {
        .input_min = 2000000,
        .input_max = 40000000,
        .vco_max = 960000000,
        .base_reg = PLLU_BASE,
        .misc_reg = PLLU_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
        .lock_delay = 1000,
+       .pdiv_tohw = pllu_p,
  };
  
  static struct tegra_clk_pll_params pll_x_params = {
        .vco_max = 1200000000,
        .base_reg = PLLX_BASE,
        .misc_reg = PLLX_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -478,7 -485,7 +485,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 0,
        .base_reg = PLLE_BASE,
        .misc_reg = PLLE_MISC,
-       .lock_bit_idx = PLLE_MISC_LOCK,
+       .lock_mask = PLLE_MISC_LOCK,
        .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
        .lock_delay = 0,
  };
@@@ -703,7 -710,7 +710,7 @@@ static void tegra20_pll_init(void
        clks[pll_a_out0] = clk;
  
        /* PLLE */
 -      clk = tegra_clk_register_plle("pll_e", "pll_ref", clk_base, NULL,
 +      clk = tegra_clk_register_plle("pll_e", "pll_ref", clk_base, pmc_base,
                             0, 100000000, &pll_e_params,
                             0, pll_e_freq_table, NULL);
        clk_register_clkdev(clk, "pll_e", NULL);
@@@ -1012,7 -1019,7 +1019,7 @@@ static void __init tegra20_periph_clk_i
                data = &tegra_periph_clk_list[i];
                clk = tegra_clk_register_periph(data->name, data->parent_names,
                                data->num_parents, &data->periph,
-                               clk_base, data->offset);
+                               clk_base, data->offset, data->flags);
                clk_register_clkdev(clk, data->con_id, data->dev_id);
                clks[data->clk_id] = clk;
        }
@@@ -1247,9 -1254,16 +1254,16 @@@ static __initdata struct tegra_clk_init
        {host1x, pll_c, 150000000, 0},
        {disp1, pll_p, 600000000, 0},
        {disp2, pll_p, 600000000, 0},
+       {gr2d, pll_c, 300000000, 0},
+       {gr3d, pll_c, 300000000, 0},
        {clk_max, clk_max, 0, 0}, /* This MUST be the last entry */
  };
  
+ static void __init tegra20_clock_apply_init_table(void)
+ {
+       tegra_init_from_table(init_table, clks, clk_max);
+ }
  /*
   * Some clocks may be used by different drivers depending on the board
   * configuration.  List those here to register them twice in the clock lookup
@@@ -1316,7 -1330,7 +1330,7 @@@ void __init tegra20_clock_init(struct d
        clk_data.clk_num = ARRAY_SIZE(clks);
        of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
  
-       tegra_init_from_table(init_table, clks, clk_max);
+       tegra_clk_apply_init_table = tegra20_clock_apply_init_table;
  
        tegra_cpu_car_ops = &tegra20_cpu_car_ops;
  }
index f15f147d473cab2b7657a9fd8ba610e443a8f82c,2dc0c5602613eae83cb40704cc0516dd5d64a42b..c6921f538e28dd370cb156588ab0d5e77645ec07
@@@ -22,7 -22,8 +22,7 @@@
  #include <linux/of.h>
  #include <linux/of_address.h>
  #include <linux/clk/tegra.h>
 -
 -#include <mach/powergate.h>
 +#include <linux/tegra-powergate.h>
  
  #include "clk.h"
  
  #define PLLDU_MISC_LOCK_ENABLE 22
  #define PLLE_MISC_LOCK_ENABLE 9
  
- #define PLL_BASE_LOCK 27
- #define PLLE_MISC_LOCK 11
+ #define PLL_BASE_LOCK BIT(27)
+ #define PLLE_MISC_LOCK BIT(11)
  
  #define PLLE_AUX 0x48c
  #define PLLC_OUT 0x84
@@@ -329,7 -330,7 +329,7 @@@ enum tegra30_clk 
        usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3,
        pcie, owr, afi, csite, pciex, avpucq, la, dtv = 79, ndspeed, i2cslow,
        dsib, irama = 84, iramb, iramc, iramd, cram2, audio_2x = 90, csus = 92,
-       cdev1, cdev2, cpu_g = 96, cpu_lp, gr3d2, mselect, tsensor, i2s3, i2s4,
+       cdev2, cdev1, cpu_g = 96, cpu_lp, gr3d2, mselect, tsensor, i2s3, i2s4,
        i2c4, sbc5, sbc6, d_audio, apbif, dam0, dam1, dam2, hda2codec_2x,
        atomics, audio0_2x, audio1_2x, audio2_2x, audio3_2x, audio4_2x,
        spdif_2x, actmon, extern1, extern2, extern3, sata_oob, sata, hda,
@@@ -373,164 -374,170 +373,170 @@@ static const struct utmi_clk_param utmi
  };
  
  static struct tegra_clk_pll_freq_table pll_c_freq_table[] = {
-       { 12000000, 1040000000, 520,  6, 1, 8},
-       { 13000000, 1040000000, 480,  6, 1, 8},
-       { 16800000, 1040000000, 495,  8, 1, 8}, /* actual: 1039.5 MHz */
-       { 19200000, 1040000000, 325,  6, 1, 6},
-       { 26000000, 1040000000, 520, 13, 1, 8},
-       { 12000000, 832000000, 416,  6, 1, 8},
-       { 13000000, 832000000, 832, 13, 1, 8},
-       { 16800000, 832000000, 396,  8, 1, 8},  /* actual: 831.6 MHz */
-       { 19200000, 832000000, 260,  6, 1, 8},
-       { 26000000, 832000000, 416, 13, 1, 8},
-       { 12000000, 624000000, 624, 12, 1, 8},
-       { 13000000, 624000000, 624, 13, 1, 8},
-       { 16800000, 600000000, 520, 14, 1, 8},
-       { 19200000, 624000000, 520, 16, 1, 8},
-       { 26000000, 624000000, 624, 26, 1, 8},
-       { 12000000, 600000000, 600, 12, 1, 8},
-       { 13000000, 600000000, 600, 13, 1, 8},
-       { 16800000, 600000000, 500, 14, 1, 8},
-       { 19200000, 600000000, 375, 12, 1, 6},
-       { 26000000, 600000000, 600, 26, 1, 8},
-       { 12000000, 520000000, 520, 12, 1, 8},
-       { 13000000, 520000000, 520, 13, 1, 8},
-       { 16800000, 520000000, 495, 16, 1, 8},  /* actual: 519.75 MHz */
-       { 19200000, 520000000, 325, 12, 1, 6},
-       { 26000000, 520000000, 520, 26, 1, 8},
-       { 12000000, 416000000, 416, 12, 1, 8},
-       { 13000000, 416000000, 416, 13, 1, 8},
-       { 16800000, 416000000, 396, 16, 1, 8},  /* actual: 415.8 MHz */
-       { 19200000, 416000000, 260, 12, 1, 6},
-       { 26000000, 416000000, 416, 26, 1, 8},
+       { 12000000, 1040000000, 520,  6, 0, 8},
+       { 13000000, 1040000000, 480,  6, 0, 8},
+       { 16800000, 1040000000, 495,  8, 0, 8}, /* actual: 1039.5 MHz */
+       { 19200000, 1040000000, 325,  6, 0, 6},
+       { 26000000, 1040000000, 520, 13, 0, 8},
+       { 12000000, 832000000, 416,  6, 0, 8},
+       { 13000000, 832000000, 832, 13, 0, 8},
+       { 16800000, 832000000, 396,  8, 0, 8},  /* actual: 831.6 MHz */
+       { 19200000, 832000000, 260,  6, 0, 8},
+       { 26000000, 832000000, 416, 13, 0, 8},
+       { 12000000, 624000000, 624, 12, 0, 8},
+       { 13000000, 624000000, 624, 13, 0, 8},
+       { 16800000, 600000000, 520, 14, 0, 8},
+       { 19200000, 624000000, 520, 16, 0, 8},
+       { 26000000, 624000000, 624, 26, 0, 8},
+       { 12000000, 600000000, 600, 12, 0, 8},
+       { 13000000, 600000000, 600, 13, 0, 8},
+       { 16800000, 600000000, 500, 14, 0, 8},
+       { 19200000, 600000000, 375, 12, 0, 6},
+       { 26000000, 600000000, 600, 26, 0, 8},
+       { 12000000, 520000000, 520, 12, 0, 8},
+       { 13000000, 520000000, 520, 13, 0, 8},
+       { 16800000, 520000000, 495, 16, 0, 8},  /* actual: 519.75 MHz */
+       { 19200000, 520000000, 325, 12, 0, 6},
+       { 26000000, 520000000, 520, 26, 0, 8},
+       { 12000000, 416000000, 416, 12, 0, 8},
+       { 13000000, 416000000, 416, 13, 0, 8},
+       { 16800000, 416000000, 396, 16, 0, 8},  /* actual: 415.8 MHz */
+       { 19200000, 416000000, 260, 12, 0, 6},
+       { 26000000, 416000000, 416, 26, 0, 8},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
-       { 12000000, 666000000, 666, 12, 1, 8},
-       { 13000000, 666000000, 666, 13, 1, 8},
-       { 16800000, 666000000, 555, 14, 1, 8},
-       { 19200000, 666000000, 555, 16, 1, 8},
-       { 26000000, 666000000, 666, 26, 1, 8},
-       { 12000000, 600000000, 600, 12, 1, 8},
-       { 13000000, 600000000, 600, 13, 1, 8},
-       { 16800000, 600000000, 500, 14, 1, 8},
-       { 19200000, 600000000, 375, 12, 1, 6},
-       { 26000000, 600000000, 600, 26, 1, 8},
+       { 12000000, 666000000, 666, 12, 0, 8},
+       { 13000000, 666000000, 666, 13, 0, 8},
+       { 16800000, 666000000, 555, 14, 0, 8},
+       { 19200000, 666000000, 555, 16, 0, 8},
+       { 26000000, 666000000, 666, 26, 0, 8},
+       { 12000000, 600000000, 600, 12, 0, 8},
+       { 13000000, 600000000, 600, 13, 0, 8},
+       { 16800000, 600000000, 500, 14, 0, 8},
+       { 19200000, 600000000, 375, 12, 0, 6},
+       { 26000000, 600000000, 600, 26, 0, 8},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
-       { 12000000, 216000000, 432, 12, 2, 8},
-       { 13000000, 216000000, 432, 13, 2, 8},
-       { 16800000, 216000000, 360, 14, 2, 8},
-       { 19200000, 216000000, 360, 16, 2, 8},
-       { 26000000, 216000000, 432, 26, 2, 8},
+       { 12000000, 216000000, 432, 12, 1, 8},
+       { 13000000, 216000000, 432, 13, 1, 8},
+       { 16800000, 216000000, 360, 14, 1, 8},
+       { 19200000, 216000000, 360, 16, 1, 8},
+       { 26000000, 216000000, 432, 26, 1, 8},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
-       { 9600000, 564480000, 294, 5, 1, 4},
-       { 9600000, 552960000, 288, 5, 1, 4},
-       { 9600000, 24000000,  5,   2, 1, 1},
+       { 9600000, 564480000, 294, 5, 0, 4},
+       { 9600000, 552960000, 288, 5, 0, 4},
+       { 9600000, 24000000,  5,   2, 0, 1},
  
-       { 28800000, 56448000, 49, 25, 1, 1},
-       { 28800000, 73728000, 64, 25, 1, 1},
-       { 28800000, 24000000,  5,  6, 1, 1},
+       { 28800000, 56448000, 49, 25, 0, 1},
+       { 28800000, 73728000, 64, 25, 0, 1},
+       { 28800000, 24000000,  5,  6, 0, 1},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
-       { 12000000, 216000000, 216, 12, 1, 4},
-       { 13000000, 216000000, 216, 13, 1, 4},
-       { 16800000, 216000000, 180, 14, 1, 4},
-       { 19200000, 216000000, 180, 16, 1, 4},
-       { 26000000, 216000000, 216, 26, 1, 4},
-       { 12000000, 594000000, 594, 12, 1, 8},
-       { 13000000, 594000000, 594, 13, 1, 8},
-       { 16800000, 594000000, 495, 14, 1, 8},
-       { 19200000, 594000000, 495, 16, 1, 8},
-       { 26000000, 594000000, 594, 26, 1, 8},
-       { 12000000, 1000000000, 1000, 12, 1, 12},
-       { 13000000, 1000000000, 1000, 13, 1, 12},
-       { 19200000, 1000000000, 625,  12, 1, 8},
-       { 26000000, 1000000000, 1000, 26, 1, 12},
+       { 12000000, 216000000, 216, 12, 0, 4},
+       { 13000000, 216000000, 216, 13, 0, 4},
+       { 16800000, 216000000, 180, 14, 0, 4},
+       { 19200000, 216000000, 180, 16, 0, 4},
+       { 26000000, 216000000, 216, 26, 0, 4},
+       { 12000000, 594000000, 594, 12, 0, 8},
+       { 13000000, 594000000, 594, 13, 0, 8},
+       { 16800000, 594000000, 495, 14, 0, 8},
+       { 19200000, 594000000, 495, 16, 0, 8},
+       { 26000000, 594000000, 594, 26, 0, 8},
+       { 12000000, 1000000000, 1000, 12, 0, 12},
+       { 13000000, 1000000000, 1000, 13, 0, 12},
+       { 19200000, 1000000000, 625,  12, 0, 8},
+       { 26000000, 1000000000, 1000, 26, 0, 12},
  
        { 0, 0, 0, 0, 0, 0 },
  };
  
+ static struct pdiv_map pllu_p[] = {
+       { .pdiv = 1, .hw_val = 1 },
+       { .pdiv = 2, .hw_val = 0 },
+       { .pdiv = 0, .hw_val = 0 },
+ };
  static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
-       { 12000000, 480000000, 960, 12, 2, 12},
-       { 13000000, 480000000, 960, 13, 2, 12},
-       { 16800000, 480000000, 400, 7,  2, 5},
-       { 19200000, 480000000, 200, 4,  2, 3},
-       { 26000000, 480000000, 960, 26, 2, 12},
+       { 12000000, 480000000, 960, 12, 0, 12},
+       { 13000000, 480000000, 960, 13, 0, 12},
+       { 16800000, 480000000, 400, 7,  0, 5},
+       { 19200000, 480000000, 200, 4,  0, 3},
+       { 26000000, 480000000, 960, 26, 0, 12},
        { 0, 0, 0, 0, 0, 0 },
  };
  
  static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
        /* 1.7 GHz */
-       { 12000000, 1700000000, 850,  6,  1, 8},
-       { 13000000, 1700000000, 915,  7,  1, 8},        /* actual: 1699.2 MHz */
-       { 16800000, 1700000000, 708,  7,  1, 8},        /* actual: 1699.2 MHz */
-       { 19200000, 1700000000, 885,  10, 1, 8},        /* actual: 1699.2 MHz */
-       { 26000000, 1700000000, 850,  13, 1, 8},
+       { 12000000, 1700000000, 850,  6,  0, 8},
+       { 13000000, 1700000000, 915,  7,  0, 8},        /* actual: 1699.2 MHz */
+       { 16800000, 1700000000, 708,  7,  0, 8},        /* actual: 1699.2 MHz */
+       { 19200000, 1700000000, 885,  10, 0, 8},        /* actual: 1699.2 MHz */
+       { 26000000, 1700000000, 850,  13, 0, 8},
  
        /* 1.6 GHz */
-       { 12000000, 1600000000, 800,  6,  1, 8},
-       { 13000000, 1600000000, 738,  6,  1, 8},        /* actual: 1599.0 MHz */
-       { 16800000, 1600000000, 857,  9,  1, 8},        /* actual: 1599.7 MHz */
-       { 19200000, 1600000000, 500,  6,  1, 8},
-       { 26000000, 1600000000, 800,  13, 1, 8},
+       { 12000000, 1600000000, 800,  6,  0, 8},
+       { 13000000, 1600000000, 738,  6,  0, 8},        /* actual: 1599.0 MHz */
+       { 16800000, 1600000000, 857,  9,  0, 8},        /* actual: 1599.7 MHz */
+       { 19200000, 1600000000, 500,  6,  0, 8},
+       { 26000000, 1600000000, 800,  13, 0, 8},
  
        /* 1.5 GHz */
-       { 12000000, 1500000000, 750,  6,  1, 8},
-       { 13000000, 1500000000, 923,  8,  1, 8},        /* actual: 1499.8 MHz */
-       { 16800000, 1500000000, 625,  7,  1, 8},
-       { 19200000, 1500000000, 625,  8,  1, 8},
-       { 26000000, 1500000000, 750,  13, 1, 8},
+       { 12000000, 1500000000, 750,  6,  0, 8},
+       { 13000000, 1500000000, 923,  8,  0, 8},        /* actual: 1499.8 MHz */
+       { 16800000, 1500000000, 625,  7,  0, 8},
+       { 19200000, 1500000000, 625,  8,  0, 8},
+       { 26000000, 1500000000, 750,  13, 0, 8},
  
        /* 1.4 GHz */
-       { 12000000, 1400000000, 700,  6,  1, 8},
-       { 13000000, 1400000000, 969,  9,  1, 8},        /* actual: 1399.7 MHz */
-       { 16800000, 1400000000, 1000, 12, 1, 8},
-       { 19200000, 1400000000, 875,  12, 1, 8},
-       { 26000000, 1400000000, 700,  13, 1, 8},
+       { 12000000, 1400000000, 700,  6,  0, 8},
+       { 13000000, 1400000000, 969,  9,  0, 8},        /* actual: 1399.7 MHz */
+       { 16800000, 1400000000, 1000, 12, 0, 8},
+       { 19200000, 1400000000, 875,  12, 0, 8},
+       { 26000000, 1400000000, 700,  13, 0, 8},
  
        /* 1.3 GHz */
-       { 12000000, 1300000000, 975,  9,  1, 8},
-       { 13000000, 1300000000, 1000, 10, 1, 8},
-       { 16800000, 1300000000, 928,  12, 1, 8},        /* actual: 1299.2 MHz */
-       { 19200000, 1300000000, 812,  12, 1, 8},        /* actual: 1299.2 MHz */
-       { 26000000, 1300000000, 650,  13, 1, 8},
+       { 12000000, 1300000000, 975,  9,  0, 8},
+       { 13000000, 1300000000, 1000, 10, 0, 8},
+       { 16800000, 1300000000, 928,  12, 0, 8},        /* actual: 1299.2 MHz */
+       { 19200000, 1300000000, 812,  12, 0, 8},        /* actual: 1299.2 MHz */
+       { 26000000, 1300000000, 650,  13, 0, 8},
  
        /* 1.2 GHz */
-       { 12000000, 1200000000, 1000, 10, 1, 8},
-       { 13000000, 1200000000, 923,  10, 1, 8},        /* actual: 1199.9 MHz */
-       { 16800000, 1200000000, 1000, 14, 1, 8},
-       { 19200000, 1200000000, 1000, 16, 1, 8},
-       { 26000000, 1200000000, 600,  13, 1, 8},
+       { 12000000, 1200000000, 1000, 10, 0, 8},
+       { 13000000, 1200000000, 923,  10, 0, 8},        /* actual: 1199.9 MHz */
+       { 16800000, 1200000000, 1000, 14, 0, 8},
+       { 19200000, 1200000000, 1000, 16, 0, 8},
+       { 26000000, 1200000000, 600,  13, 0, 8},
  
        /* 1.1 GHz */
-       { 12000000, 1100000000, 825,  9,  1, 8},
-       { 13000000, 1100000000, 846,  10, 1, 8},        /* actual: 1099.8 MHz */
-       { 16800000, 1100000000, 982,  15, 1, 8},        /* actual: 1099.8 MHz */
-       { 19200000, 1100000000, 859,  15, 1, 8},        /* actual: 1099.5 MHz */
-       { 26000000, 1100000000, 550,  13, 1, 8},
+       { 12000000, 1100000000, 825,  9,  0, 8},
+       { 13000000, 1100000000, 846,  10, 0, 8},        /* actual: 1099.8 MHz */
+       { 16800000, 1100000000, 982,  15, 0, 8},        /* actual: 1099.8 MHz */
+       { 19200000, 1100000000, 859,  15, 0, 8},        /* actual: 1099.5 MHz */
+       { 26000000, 1100000000, 550,  13, 0, 8},
  
        /* 1 GHz */
-       { 12000000, 1000000000, 1000, 12, 1, 8},
-       { 13000000, 1000000000, 1000, 13, 1, 8},
-       { 16800000, 1000000000, 833,  14, 1, 8},        /* actual: 999.6 MHz */
-       { 19200000, 1000000000, 625,  12, 1, 8},
-       { 26000000, 1000000000, 1000, 26, 1, 8},
+       { 12000000, 1000000000, 1000, 12, 0, 8},
+       { 13000000, 1000000000, 1000, 13, 0, 8},
+       { 16800000, 1000000000, 833,  14, 0, 8},        /* actual: 999.6 MHz */
+       { 19200000, 1000000000, 625,  12, 0, 8},
+       { 26000000, 1000000000, 1000, 26, 0, 8},
  
        { 0, 0, 0, 0, 0, 0 },
  };
@@@ -552,7 -559,7 +558,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLC_BASE,
        .misc_reg = PLLC_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -566,7 -573,7 +572,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1200000000,
        .base_reg = PLLM_BASE,
        .misc_reg = PLLM_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -580,7 -587,7 +586,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLP_BASE,
        .misc_reg = PLLP_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -594,7 -601,7 +600,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1400000000,
        .base_reg = PLLA_BASE,
        .misc_reg = PLLA_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -608,7 -615,7 +614,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1000000000,
        .base_reg = PLLD_BASE,
        .misc_reg = PLLD_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
        .lock_delay = 1000,
  };
@@@ -622,7 -629,7 +628,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 1000000000,
        .base_reg = PLLD2_BASE,
        .misc_reg = PLLD2_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
        .lock_delay = 1000,
  };
@@@ -636,9 -643,10 +642,10 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 960000000,
        .base_reg = PLLU_BASE,
        .misc_reg = PLLU_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
        .lock_delay = 1000,
+       .pdiv_tohw = pllu_p,
  };
  
  static struct tegra_clk_pll_params pll_x_params = {
        .vco_max = 1700000000,
        .base_reg = PLLX_BASE,
        .misc_reg = PLLX_MISC,
-       .lock_bit_idx = PLL_BASE_LOCK,
+       .lock_mask = PLL_BASE_LOCK,
        .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -664,7 -672,7 +671,7 @@@ static struct tegra_clk_pll_params pll_
        .vco_max = 2400000000U,
        .base_reg = PLLE_BASE,
        .misc_reg = PLLE_MISC,
-       .lock_bit_idx = PLLE_MISC_LOCK,
+       .lock_mask = PLLE_MISC_LOCK,
        .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
        .lock_delay = 300,
  };
@@@ -1660,7 -1668,7 +1667,7 @@@ static void __init tegra30_periph_clk_i
                data = &tegra_periph_clk_list[i];
                clk = tegra_clk_register_periph(data->name, data->parent_names,
                                data->num_parents, &data->periph,
-                               clk_base, data->offset);
+                               clk_base, data->offset, data->flags);
                clk_register_clkdev(clk, data->con_id, data->dev_id);
                clks[data->clk_id] = clk;
        }
@@@ -1910,9 -1918,16 +1917,16 @@@ static __initdata struct tegra_clk_init
        {disp1, pll_p, 600000000, 0},
        {disp2, pll_p, 600000000, 0},
        {twd, clk_max, 0, 1},
+       {gr2d, pll_c, 300000000, 0},
+       {gr3d, pll_c, 300000000, 0},
        {clk_max, clk_max, 0, 0}, /* This MUST be the last entry. */
  };
  
+ static void __init tegra30_clock_apply_init_table(void)
+ {
+       tegra_init_from_table(init_table, clks, clk_max);
+ }
  /*
   * Some clocks may be used by different drivers depending on the board
   * configuration.  List those here to register them twice in the clock lookup
@@@ -1986,7 -2001,7 +2000,7 @@@ void __init tegra30_clock_init(struct d
        clk_data.clk_num = ARRAY_SIZE(clks);
        of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
  
-       tegra_init_from_table(init_table, clks, clk_max);
+       tegra_clk_apply_init_table = tegra30_clock_apply_init_table;
  
        tegra_cpu_car_ops = &tegra30_cpu_car_ops;
  }
index 9002185a0a1a3b95fe68ccb1e5c94694df320de5,73fcddb8314d4c1fba7277ddb98d8d06aaad526a..7bc6e51757eeda9fddc14b19a6814cbbc3e5d304
@@@ -25,12 -25,15 +25,15 @@@ config DW_APB_TIMER_O
  config ARMADA_370_XP_TIMER
        bool
  
 -config SUNXI_TIMER
 +config SUN4I_TIMER
        bool
  
  config VT8500_TIMER
        bool
  
+ config CADENCE_TTC_TIMER
+       bool
  config CLKSRC_NOMADIK_MTU
        bool
        depends on (ARCH_NOMADIK || ARCH_U8500)
@@@ -67,3 -70,8 +70,8 @@@ config CLKSRC_METAG_GENERI
        def_bool y if METAG
        help
          This option enables support for the Meta per-thread timers.
+ config CLKSRC_EXYNOS_MCT
+       def_bool y if ARCH_EXYNOS
+       help
+         Support for Multi Core Timer controller on Exynos SoCs.
index 682d48d081645c619aaafd50d59c82016ab088e1,cd1f09cbd61a7c37895ce5c0c46d552b9b77076c..caacdb63aff982a97e4950759fa3527cfe37d51b
@@@ -16,13 -16,11 +16,15 @@@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU)   += nom
  obj-$(CONFIG_CLKSRC_DBX500_PRCMU)     += clksrc-dbx500-prcmu.o
  obj-$(CONFIG_ARMADA_370_XP_TIMER)     += time-armada-370-xp.o
  obj-$(CONFIG_ARCH_BCM2835)    += bcm2835_timer.o
 -obj-$(CONFIG_SUNXI_TIMER)     += sunxi_timer.o
 +obj-$(CONFIG_ARCH_MARCO)      += timer-marco.o
 +obj-$(CONFIG_ARCH_MXS)                += mxs_timer.o
 +obj-$(CONFIG_ARCH_PRIMA2)     += timer-prima2.o
 +obj-$(CONFIG_SUN4I_TIMER)     += sun4i_timer.o
  obj-$(CONFIG_ARCH_TEGRA)      += tegra20_timer.o
  obj-$(CONFIG_VT8500_TIMER)    += vt8500_timer.o
 +obj-$(CONFIG_ARCH_BCM)                += bcm_kona_timer.o
+ obj-$(CONFIG_CADENCE_TTC_TIMER)       += cadence_ttc_timer.o
+ obj-$(CONFIG_CLKSRC_EXYNOS_MCT)       += exynos_mct.o
  
  obj-$(CONFIG_ARM_ARCH_TIMER)          += arm_arch_timer.o
  obj-$(CONFIG_CLKSRC_METAG_GENERIC)    += metag_generic.o
diff --combined drivers/irqchip/Makefile
index 10ef57f35a6e15583ffa5e6c931be2c326d66e1e,48fbdf978494c36c8e8fa82fb8dcaab19f3f1d3d..c28fcccf4a0da770750693e47f2144c751471bac
@@@ -2,12 -2,14 +2,16 @@@ obj-$(CONFIG_IRQCHIP)                 += irqchip.
  
  obj-$(CONFIG_ARCH_BCM2835)            += irq-bcm2835.o
  obj-$(CONFIG_ARCH_EXYNOS)             += exynos-combiner.o
 +obj-$(CONFIG_ARCH_MXS)                        += irq-mxs.o
+ obj-$(CONFIG_ARCH_S3C24XX)            += irq-s3c24xx.o
  obj-$(CONFIG_METAG)                   += irq-metag-ext.o
  obj-$(CONFIG_METAG_PERFCOUNTER_IRQS)  += irq-metag.o
 -obj-$(CONFIG_ARCH_SUNXI)              += irq-sunxi.o
 +obj-$(CONFIG_ARCH_SUNXI)              += irq-sun4i.o
  obj-$(CONFIG_ARCH_SPEAR3XX)           += spear-shirq.o
  obj-$(CONFIG_ARM_GIC)                 += irq-gic.o
  obj-$(CONFIG_ARM_VIC)                 += irq-vic.o
 +obj-$(CONFIG_SIRF_IRQ)                        += irq-sirfsoc.o
+ obj-$(CONFIG_RENESAS_INTC_IRQPIN)     += irq-renesas-intc-irqpin.o
+ obj-$(CONFIG_RENESAS_IRQC)            += irq-renesas-irqc.o
  obj-$(CONFIG_VERSATILE_FPGA_IRQ)      += irq-versatile-fpga.o
+ obj-$(CONFIG_ARCH_VT8500)             += irq-vt8500.o
index 6a52013515073b8939adedb4237c162b326b67f4,e8501dbaa0b7002c6ecdb08710390dbd03e2599e..02492ab20d22a466a7ba4923e94c02ed892870f3
@@@ -13,7 -13,6 +13,7 @@@
  #include <linux/init.h>
  #include <linux/io.h>
  #include <linux/irqdomain.h>
 +#include <linux/irqchip/chained_irq.h>
  #include <linux/of_address.h>
  #include <linux/of_irq.h>
  #include <asm/mach/irq.h>
@@@ -32,6 -31,7 +32,7 @@@ struct combiner_chip_data 
        unsigned int irq_offset;
        unsigned int irq_mask;
        void __iomem *base;
+       unsigned int parent_irq;
  };
  
  static struct irq_domain *combiner_irq_domain;
@@@ -88,22 -88,46 +89,46 @@@ static void combiner_handle_cascade_irq
        chained_irq_exit(chip, desc);
  }
  
+ #ifdef CONFIG_SMP
+ static int combiner_set_affinity(struct irq_data *d,
+                                const struct cpumask *mask_val, bool force)
+ {
+       struct combiner_chip_data *chip_data = irq_data_get_irq_chip_data(d);
+       struct irq_chip *chip = irq_get_chip(chip_data->parent_irq);
+       struct irq_data *data = irq_get_irq_data(chip_data->parent_irq);
+       if (chip && chip->irq_set_affinity)
+               return chip->irq_set_affinity(data, mask_val, force);
+       else
+               return -EINVAL;
+ }
+ #endif
  static struct irq_chip combiner_chip = {
-       .name           = "COMBINER",
-       .irq_mask       = combiner_mask_irq,
-       .irq_unmask     = combiner_unmask_irq,
+       .name                   = "COMBINER",
+       .irq_mask               = combiner_mask_irq,
+       .irq_unmask             = combiner_unmask_irq,
+ #ifdef CONFIG_SMP
+       .irq_set_affinity       = combiner_set_affinity,
+ #endif
  };
  
- static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
+ static unsigned int max_combiner_nr(void)
  {
-       unsigned int max_nr;
        if (soc_is_exynos5250())
-               max_nr = EXYNOS5_MAX_COMBINER_NR;
+               return EXYNOS5_MAX_COMBINER_NR;
+       else if (soc_is_exynos4412())
+               return EXYNOS4412_MAX_COMBINER_NR;
+       else if (soc_is_exynos4212())
+               return EXYNOS4212_MAX_COMBINER_NR;
        else
-               max_nr = EXYNOS4_MAX_COMBINER_NR;
+               return EXYNOS4210_MAX_COMBINER_NR;
+ }
  
-       if (combiner_nr >= max_nr)
+ static void __init combiner_cascade_irq(unsigned int combiner_nr,
+                                       unsigned int irq)
+ {
+       if (combiner_nr >= max_combiner_nr())
                BUG();
        if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
                BUG();
  }
  
  static void __init combiner_init_one(unsigned int combiner_nr,
-                                    void __iomem *base)
+                                    void __iomem *base, unsigned int irq)
  {
        combiner_data[combiner_nr].base = base;
        combiner_data[combiner_nr].irq_offset = irq_find_mapping(
                combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
        combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
+       combiner_data[combiner_nr].parent_irq = irq;
  
        /* Disable all interrupts */
        __raw_writel(combiner_data[combiner_nr].irq_mask,
@@@ -167,23 -192,38 +193,38 @@@ static struct irq_domain_ops combiner_i
        .map    = combiner_irq_domain_map,
  };
  
+ static unsigned int exynos4x12_combiner_extra_irq(int group)
+ {
+       switch (group) {
+       case 16:
+               return IRQ_SPI(107);
+       case 17:
+               return IRQ_SPI(108);
+       case 18:
+               return IRQ_SPI(48);
+       case 19:
+               return IRQ_SPI(42);
+       default:
+               return 0;
+       }
+ }
  void __init combiner_init(void __iomem *combiner_base,
                          struct device_node *np)
  {
        int i, irq, irq_base;
        unsigned int max_nr, nr_irq;
  
+       max_nr = max_combiner_nr();
        if (np) {
                if (of_property_read_u32(np, "samsung,combiner-nr", &max_nr)) {
-                       pr_warning("%s: number of combiners not specified, "
+                       pr_info("%s: number of combiners not specified, "
                                "setting default as %d.\n",
-                               __func__, EXYNOS4_MAX_COMBINER_NR);
-                       max_nr = EXYNOS4_MAX_COMBINER_NR;
+                               __func__, max_nr);
                }
-       } else {
-               max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
-                                               EXYNOS4_MAX_COMBINER_NR;
        }
        nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
  
        irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
        }
  
        for (i = 0; i < max_nr; i++) {
-               combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
-               irq = IRQ_SPI(i);
+               if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
+                       irq = IRQ_SPI(i);
+               else
+                       irq = exynos4x12_combiner_extra_irq(i);
  #ifdef CONFIG_OF
                if (np)
                        irq = irq_of_parse_and_map(np, i);
  #endif
+               combiner_init_one(i, combiner_base + (i >> 2) * 0x10, irq);
                combiner_cascade_irq(i, irq);
        }
  }
index 0000000000000000000000000000000000000000,f750f551fc7029208019dc7d18ffdda89cfc4676..bbcc944ed94ff4f51d2dd8921e9ca4b5e8bb09c5
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,1355 +1,1356 @@@
 -              intc->reg_pending = base + 0x08;
+ /*
+  * S3C24XX IRQ handling
+  *
+  * Copyright (c) 2003-2004 Simtec Electronics
+  *    Ben Dooks <ben@simtec.co.uk>
+  * Copyright (c) 2012 Heiko Stuebner <heiko@sntech.de>
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+ */
+ #include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/module.h>
+ #include <linux/io.h>
+ #include <linux/err.h>
+ #include <linux/interrupt.h>
+ #include <linux/ioport.h>
+ #include <linux/device.h>
+ #include <linux/irqdomain.h>
++#include <linux/irqchip/chained_irq.h>
+ #include <linux/of.h>
+ #include <linux/of_irq.h>
+ #include <linux/of_address.h>
+ #include <asm/exception.h>
+ #include <asm/mach/irq.h>
+ #include <mach/regs-irq.h>
+ #include <mach/regs-gpio.h>
+ #include <plat/cpu.h>
+ #include <plat/regs-irqtype.h>
+ #include <plat/pm.h>
+ #include "irqchip.h"
+ #define S3C_IRQTYPE_NONE      0
+ #define S3C_IRQTYPE_EINT      1
+ #define S3C_IRQTYPE_EDGE      2
+ #define S3C_IRQTYPE_LEVEL     3
+ struct s3c_irq_data {
+       unsigned int type;
+       unsigned long offset;
+       unsigned long parent_irq;
+       /* data gets filled during init */
+       struct s3c_irq_intc *intc;
+       unsigned long sub_bits;
+       struct s3c_irq_intc *sub_intc;
+ };
+ /*
+  * Sructure holding the controller data
+  * @reg_pending               register holding pending irqs
+  * @reg_intpnd                special register intpnd in main intc
+  * @reg_mask          mask register
+  * @domain            irq_domain of the controller
+  * @parent            parent controller for ext and sub irqs
+  * @irqs              irq-data, always s3c_irq_data[32]
+  */
+ struct s3c_irq_intc {
+       void __iomem            *reg_pending;
+       void __iomem            *reg_intpnd;
+       void __iomem            *reg_mask;
+       struct irq_domain       *domain;
+       struct s3c_irq_intc     *parent;
+       struct s3c_irq_data     *irqs;
+ };
+ /*
+  * Array holding pointers to the global controller structs
+  * [0] ... main_intc
+  * [1] ... sub_intc
+  * [2] ... main_intc2 on s3c2416
+  */
+ static struct s3c_irq_intc *s3c_intc[3];
+ static void s3c_irq_mask(struct irq_data *data)
+ {
+       struct s3c_irq_data *irq_data = irq_data_get_irq_chip_data(data);
+       struct s3c_irq_intc *intc = irq_data->intc;
+       struct s3c_irq_intc *parent_intc = intc->parent;
+       struct s3c_irq_data *parent_data;
+       unsigned long mask;
+       unsigned int irqno;
+       mask = __raw_readl(intc->reg_mask);
+       mask |= (1UL << irq_data->offset);
+       __raw_writel(mask, intc->reg_mask);
+       if (parent_intc) {
+               parent_data = &parent_intc->irqs[irq_data->parent_irq];
+               /* check to see if we need to mask the parent IRQ
+                * The parent_irq is always in main_intc, so the hwirq
+                * for find_mapping does not need an offset in any case.
+                */
+               if ((mask & parent_data->sub_bits) == parent_data->sub_bits) {
+                       irqno = irq_find_mapping(parent_intc->domain,
+                                        irq_data->parent_irq);
+                       s3c_irq_mask(irq_get_irq_data(irqno));
+               }
+       }
+ }
+ static void s3c_irq_unmask(struct irq_data *data)
+ {
+       struct s3c_irq_data *irq_data = irq_data_get_irq_chip_data(data);
+       struct s3c_irq_intc *intc = irq_data->intc;
+       struct s3c_irq_intc *parent_intc = intc->parent;
+       unsigned long mask;
+       unsigned int irqno;
+       mask = __raw_readl(intc->reg_mask);
+       mask &= ~(1UL << irq_data->offset);
+       __raw_writel(mask, intc->reg_mask);
+       if (parent_intc) {
+               irqno = irq_find_mapping(parent_intc->domain,
+                                        irq_data->parent_irq);
+               s3c_irq_unmask(irq_get_irq_data(irqno));
+       }
+ }
+ static inline void s3c_irq_ack(struct irq_data *data)
+ {
+       struct s3c_irq_data *irq_data = irq_data_get_irq_chip_data(data);
+       struct s3c_irq_intc *intc = irq_data->intc;
+       unsigned long bitval = 1UL << irq_data->offset;
+       __raw_writel(bitval, intc->reg_pending);
+       if (intc->reg_intpnd)
+               __raw_writel(bitval, intc->reg_intpnd);
+ }
+ static int s3c_irq_type(struct irq_data *data, unsigned int type)
+ {
+       switch (type) {
+       case IRQ_TYPE_NONE:
+               break;
+       case IRQ_TYPE_EDGE_RISING:
+       case IRQ_TYPE_EDGE_FALLING:
+       case IRQ_TYPE_EDGE_BOTH:
+               irq_set_handler(data->irq, handle_edge_irq);
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+       case IRQ_TYPE_LEVEL_HIGH:
+               irq_set_handler(data->irq, handle_level_irq);
+               break;
+       default:
+               pr_err("No such irq type %d", type);
+               return -EINVAL;
+       }
+       return 0;
+ }
+ static int s3c_irqext_type_set(void __iomem *gpcon_reg,
+                              void __iomem *extint_reg,
+                              unsigned long gpcon_offset,
+                              unsigned long extint_offset,
+                              unsigned int type)
+ {
+       unsigned long newvalue = 0, value;
+       /* Set the GPIO to external interrupt mode */
+       value = __raw_readl(gpcon_reg);
+       value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
+       __raw_writel(value, gpcon_reg);
+       /* Set the external interrupt to pointed trigger type */
+       switch (type)
+       {
+               case IRQ_TYPE_NONE:
+                       pr_warn("No edge setting!\n");
+                       break;
+               case IRQ_TYPE_EDGE_RISING:
+                       newvalue = S3C2410_EXTINT_RISEEDGE;
+                       break;
+               case IRQ_TYPE_EDGE_FALLING:
+                       newvalue = S3C2410_EXTINT_FALLEDGE;
+                       break;
+               case IRQ_TYPE_EDGE_BOTH:
+                       newvalue = S3C2410_EXTINT_BOTHEDGE;
+                       break;
+               case IRQ_TYPE_LEVEL_LOW:
+                       newvalue = S3C2410_EXTINT_LOWLEV;
+                       break;
+               case IRQ_TYPE_LEVEL_HIGH:
+                       newvalue = S3C2410_EXTINT_HILEV;
+                       break;
+               default:
+                       pr_err("No such irq type %d", type);
+                       return -EINVAL;
+       }
+       value = __raw_readl(extint_reg);
+       value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
+       __raw_writel(value, extint_reg);
+       return 0;
+ }
+ static int s3c_irqext_type(struct irq_data *data, unsigned int type)
+ {
+       void __iomem *extint_reg;
+       void __iomem *gpcon_reg;
+       unsigned long gpcon_offset, extint_offset;
+       if ((data->hwirq >= 4) && (data->hwirq <= 7)) {
+               gpcon_reg = S3C2410_GPFCON;
+               extint_reg = S3C24XX_EXTINT0;
+               gpcon_offset = (data->hwirq) * 2;
+               extint_offset = (data->hwirq) * 4;
+       } else if ((data->hwirq >= 8) && (data->hwirq <= 15)) {
+               gpcon_reg = S3C2410_GPGCON;
+               extint_reg = S3C24XX_EXTINT1;
+               gpcon_offset = (data->hwirq - 8) * 2;
+               extint_offset = (data->hwirq - 8) * 4;
+       } else if ((data->hwirq >= 16) && (data->hwirq <= 23)) {
+               gpcon_reg = S3C2410_GPGCON;
+               extint_reg = S3C24XX_EXTINT2;
+               gpcon_offset = (data->hwirq - 8) * 2;
+               extint_offset = (data->hwirq - 16) * 4;
+       } else {
+               return -EINVAL;
+       }
+       return s3c_irqext_type_set(gpcon_reg, extint_reg, gpcon_offset,
+                                  extint_offset, type);
+ }
+ static int s3c_irqext0_type(struct irq_data *data, unsigned int type)
+ {
+       void __iomem *extint_reg;
+       void __iomem *gpcon_reg;
+       unsigned long gpcon_offset, extint_offset;
+       if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
+               gpcon_reg = S3C2410_GPFCON;
+               extint_reg = S3C24XX_EXTINT0;
+               gpcon_offset = (data->hwirq) * 2;
+               extint_offset = (data->hwirq) * 4;
+       } else {
+               return -EINVAL;
+       }
+       return s3c_irqext_type_set(gpcon_reg, extint_reg, gpcon_offset,
+                                  extint_offset, type);
+ }
+ static struct irq_chip s3c_irq_chip = {
+       .name           = "s3c",
+       .irq_ack        = s3c_irq_ack,
+       .irq_mask       = s3c_irq_mask,
+       .irq_unmask     = s3c_irq_unmask,
+       .irq_set_type   = s3c_irq_type,
+       .irq_set_wake   = s3c_irq_wake
+ };
+ static struct irq_chip s3c_irq_level_chip = {
+       .name           = "s3c-level",
+       .irq_mask       = s3c_irq_mask,
+       .irq_unmask     = s3c_irq_unmask,
+       .irq_ack        = s3c_irq_ack,
+       .irq_set_type   = s3c_irq_type,
+ };
+ static struct irq_chip s3c_irqext_chip = {
+       .name           = "s3c-ext",
+       .irq_mask       = s3c_irq_mask,
+       .irq_unmask     = s3c_irq_unmask,
+       .irq_ack        = s3c_irq_ack,
+       .irq_set_type   = s3c_irqext_type,
+       .irq_set_wake   = s3c_irqext_wake
+ };
+ static struct irq_chip s3c_irq_eint0t4 = {
+       .name           = "s3c-ext0",
+       .irq_ack        = s3c_irq_ack,
+       .irq_mask       = s3c_irq_mask,
+       .irq_unmask     = s3c_irq_unmask,
+       .irq_set_wake   = s3c_irq_wake,
+       .irq_set_type   = s3c_irqext0_type,
+ };
+ static void s3c_irq_demux(unsigned int irq, struct irq_desc *desc)
+ {
+       struct irq_chip *chip = irq_desc_get_chip(desc);
+       struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc);
+       struct s3c_irq_intc *intc = irq_data->intc;
+       struct s3c_irq_intc *sub_intc = irq_data->sub_intc;
+       unsigned long src;
+       unsigned long msk;
+       unsigned int n;
+       unsigned int offset;
+       /* we're using individual domains for the non-dt case
+        * and one big domain for the dt case where the subintc
+        * starts at hwirq number 32.
+        */
+       offset = (intc->domain->of_node) ? 32 : 0;
+       chained_irq_enter(chip, desc);
+       src = __raw_readl(sub_intc->reg_pending);
+       msk = __raw_readl(sub_intc->reg_mask);
+       src &= ~msk;
+       src &= irq_data->sub_bits;
+       while (src) {
+               n = __ffs(src);
+               src &= ~(1 << n);
+               irq = irq_find_mapping(sub_intc->domain, offset + n);
+               generic_handle_irq(irq);
+       }
+       chained_irq_exit(chip, desc);
+ }
+ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc,
+                                     struct pt_regs *regs, int intc_offset)
+ {
+       int pnd;
+       int offset;
+       int irq;
+       pnd = __raw_readl(intc->reg_intpnd);
+       if (!pnd)
+               return false;
+       /* non-dt machines use individual domains */
+       if (!intc->domain->of_node)
+               intc_offset = 0;
+       /* We have a problem that the INTOFFSET register does not always
+        * show one interrupt. Occasionally we get two interrupts through
+        * the prioritiser, and this causes the INTOFFSET register to show
+        * what looks like the logical-or of the two interrupt numbers.
+        *
+        * Thanks to Klaus, Shannon, et al for helping to debug this problem
+        */
+       offset = __raw_readl(intc->reg_intpnd + 4);
+       /* Find the bit manually, when the offset is wrong.
+        * The pending register only ever contains the one bit of the next
+        * interrupt to handle.
+        */
+       if (!(pnd & (1 << offset)))
+               offset =  __ffs(pnd);
+       irq = irq_find_mapping(intc->domain, intc_offset + offset);
+       handle_IRQ(irq, regs);
+       return true;
+ }
+ asmlinkage void __exception_irq_entry s3c24xx_handle_irq(struct pt_regs *regs)
+ {
+       do {
+               if (likely(s3c_intc[0]))
+                       if (s3c24xx_handle_intc(s3c_intc[0], regs, 0))
+                               continue;
+               if (s3c_intc[2])
+                       if (s3c24xx_handle_intc(s3c_intc[2], regs, 64))
+                               continue;
+               break;
+       } while (1);
+ }
+ #ifdef CONFIG_FIQ
+ /**
+  * s3c24xx_set_fiq - set the FIQ routing
+  * @irq: IRQ number to route to FIQ on processor.
+  * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
+  *
+  * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
+  * @on is true, the @irq is checked to see if it can be routed and the
+  * interrupt controller updated to route the IRQ. If @on is false, the FIQ
+  * routing is cleared, regardless of which @irq is specified.
+  */
+ int s3c24xx_set_fiq(unsigned int irq, bool on)
+ {
+       u32 intmod;
+       unsigned offs;
+       if (on) {
+               offs = irq - FIQ_START;
+               if (offs > 31)
+                       return -EINVAL;
+               intmod = 1 << offs;
+       } else {
+               intmod = 0;
+       }
+       __raw_writel(intmod, S3C2410_INTMOD);
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(s3c24xx_set_fiq);
+ #endif
+ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
+                                                       irq_hw_number_t hw)
+ {
+       struct s3c_irq_intc *intc = h->host_data;
+       struct s3c_irq_data *irq_data = &intc->irqs[hw];
+       struct s3c_irq_intc *parent_intc;
+       struct s3c_irq_data *parent_irq_data;
+       unsigned int irqno;
+       /* attach controller pointer to irq_data */
+       irq_data->intc = intc;
+       irq_data->offset = hw;
+       parent_intc = intc->parent;
+       /* set handler and flags */
+       switch (irq_data->type) {
+       case S3C_IRQTYPE_NONE:
+               return 0;
+       case S3C_IRQTYPE_EINT:
+               /* On the S3C2412, the EINT0to3 have a parent irq
+                * but need the s3c_irq_eint0t4 chip
+                */
+               if (parent_intc && (!soc_is_s3c2412() || hw >= 4))
+                       irq_set_chip_and_handler(virq, &s3c_irqext_chip,
+                                                handle_edge_irq);
+               else
+                       irq_set_chip_and_handler(virq, &s3c_irq_eint0t4,
+                                                handle_edge_irq);
+               break;
+       case S3C_IRQTYPE_EDGE:
+               if (parent_intc || intc->reg_pending == S3C2416_SRCPND2)
+                       irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
+                                                handle_edge_irq);
+               else
+                       irq_set_chip_and_handler(virq, &s3c_irq_chip,
+                                                handle_edge_irq);
+               break;
+       case S3C_IRQTYPE_LEVEL:
+               if (parent_intc)
+                       irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
+                                                handle_level_irq);
+               else
+                       irq_set_chip_and_handler(virq, &s3c_irq_chip,
+                                                handle_level_irq);
+               break;
+       default:
+               pr_err("irq-s3c24xx: unsupported irqtype %d\n", irq_data->type);
+               return -EINVAL;
+       }
+       irq_set_chip_data(virq, irq_data);
+       set_irq_flags(virq, IRQF_VALID);
+       if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {
+               if (irq_data->parent_irq > 31) {
+                       pr_err("irq-s3c24xx: parent irq %lu is out of range\n",
+                              irq_data->parent_irq);
+                       goto err;
+               }
+               parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];
+               parent_irq_data->sub_intc = intc;
+               parent_irq_data->sub_bits |= (1UL << hw);
+               /* attach the demuxer to the parent irq */
+               irqno = irq_find_mapping(parent_intc->domain,
+                                        irq_data->parent_irq);
+               if (!irqno) {
+                       pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n",
+                              irq_data->parent_irq);
+                       goto err;
+               }
+               irq_set_chained_handler(irqno, s3c_irq_demux);
+       }
+       return 0;
+ err:
+       set_irq_flags(virq, 0);
+       /* the only error can result from bad mapping data*/
+       return -EINVAL;
+ }
+ static struct irq_domain_ops s3c24xx_irq_ops = {
+       .map = s3c24xx_irq_map,
+       .xlate = irq_domain_xlate_twocell,
+ };
+ static void s3c24xx_clear_intc(struct s3c_irq_intc *intc)
+ {
+       void __iomem *reg_source;
+       unsigned long pend;
+       unsigned long last;
+       int i;
+       /* if intpnd is set, read the next pending irq from there */
+       reg_source = intc->reg_intpnd ? intc->reg_intpnd : intc->reg_pending;
+       last = 0;
+       for (i = 0; i < 4; i++) {
+               pend = __raw_readl(reg_source);
+               if (pend == 0 || pend == last)
+                       break;
+               __raw_writel(pend, intc->reg_pending);
+               if (intc->reg_intpnd)
+                       __raw_writel(pend, intc->reg_intpnd);
+               pr_info("irq: clearing pending status %08x\n", (int)pend);
+               last = pend;
+       }
+ }
+ static struct s3c_irq_intc * __init s3c24xx_init_intc(struct device_node *np,
+                                      struct s3c_irq_data *irq_data,
+                                      struct s3c_irq_intc *parent,
+                                      unsigned long address)
+ {
+       struct s3c_irq_intc *intc;
+       void __iomem *base = (void *)0xf6000000; /* static mapping */
+       int irq_num;
+       int irq_start;
+       int ret;
+       intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL);
+       if (!intc)
+               return ERR_PTR(-ENOMEM);
+       intc->irqs = irq_data;
+       if (parent)
+               intc->parent = parent;
+       /* select the correct data for the controller.
+        * Need to hard code the irq num start and offset
+        * to preserve the static mapping for now
+        */
+       switch (address) {
+       case 0x4a000000:
+               pr_debug("irq: found main intc\n");
+               intc->reg_pending = base;
+               intc->reg_mask = base + 0x08;
+               intc->reg_intpnd = base + 0x10;
+               irq_num = 32;
+               irq_start = S3C2410_IRQ(0);
+               break;
+       case 0x4a000018:
+               pr_debug("irq: found subintc\n");
+               intc->reg_pending = base + 0x18;
+               intc->reg_mask = base + 0x1c;
+               irq_num = 29;
+               irq_start = S3C2410_IRQSUB(0);
+               break;
+       case 0x4a000040:
+               pr_debug("irq: found intc2\n");
+               intc->reg_pending = base + 0x40;
+               intc->reg_mask = base + 0x48;
+               intc->reg_intpnd = base + 0x50;
+               irq_num = 8;
+               irq_start = S3C2416_IRQ(0);
+               break;
+       case 0x560000a4:
+               pr_debug("irq: found eintc\n");
+               base = (void *)0xfd000000;
+               intc->reg_mask = base + 0xa4;
++              intc->reg_pending = base + 0xa8;
+               irq_num = 24;
+               irq_start = S3C2410_IRQ(32);
+               break;
+       default:
+               pr_err("irq: unsupported controller address\n");
+               ret = -EINVAL;
+               goto err;
+       }
+       /* now that all the data is complete, init the irq-domain */
+       s3c24xx_clear_intc(intc);
+       intc->domain = irq_domain_add_legacy(np, irq_num, irq_start,
+                                            0, &s3c24xx_irq_ops,
+                                            intc);
+       if (!intc->domain) {
+               pr_err("irq: could not create irq-domain\n");
+               ret = -EINVAL;
+               goto err;
+       }
+       set_handle_irq(s3c24xx_handle_irq);
+       return intc;
+ err:
+       kfree(intc);
+       return ERR_PTR(ret);
+ }
+ static struct s3c_irq_data init_eint[32] = {
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT4 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT5 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT6 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT7 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT8 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT9 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT10 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT11 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT12 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT13 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT14 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT15 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT16 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT17 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT18 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT19 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT20 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT21 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT22 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT23 */
+ };
+ #ifdef CONFIG_CPU_S3C2410
+ static struct s3c_irq_data init_s3c2410base[32] = {
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2410subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+ };
+ void __init s3c2410_init_irq(void)
+ {
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2410base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2410subint[0],
+                                       s3c_intc[0], 0x4a000018);
+       s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4);
+ }
+ #endif
+ #ifdef CONFIG_CPU_S3C2412
+ static struct s3c_irq_data init_s3c2412base[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* SDI/CF */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2412eint[32] = {
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 0 }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 1 }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 2 }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 3 }, /* EINT3 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT4 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT5 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT6 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT7 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT8 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT9 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT10 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT11 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT12 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT13 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT14 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT15 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT16 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT17 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT18 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT19 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT20 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT21 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT22 */
+       { .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT23 */
+ };
+ static struct s3c_irq_data init_s3c2412subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+       { .type = S3C_IRQTYPE_NONE, },
+       { .type = S3C_IRQTYPE_NONE, },
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 21 }, /* SDI */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 21 }, /* CF */
+ };
+ void __init s3c2412_init_irq(void)
+ {
+       pr_info("S3C2412: IRQ Support\n");
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2412base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c24xx_init_intc(NULL, &init_s3c2412eint[0], s3c_intc[0], 0x560000a4);
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2412subint[0],
+                                       s3c_intc[0], 0x4a000018);
+ }
+ #endif
+ #ifdef CONFIG_CPU_S3C2416
+ static struct s3c_irq_data init_s3c2416base[32] = {
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* LCD */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* DMA */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART3 */
+       { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* NAND */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_NONE, },
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2416subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD2 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD3 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD4 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA0 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA1 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA2 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA3 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA4 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA5 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
+ };
+ static struct s3c_irq_data init_s3c2416_second[32] = {
+       { .type = S3C_IRQTYPE_EDGE }, /* 2D */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE }, /* PCM0 */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_EDGE }, /* I2S0 */
+ };
+ void __init s3c2416_init_irq(void)
+ {
+       pr_info("S3C2416: IRQ Support\n");
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2416base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4);
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2416subint[0],
+                                       s3c_intc[0], 0x4a000018);
+       s3c_intc[2] = s3c24xx_init_intc(NULL, &init_s3c2416_second[0],
+                                       NULL, 0x4a000040);
+ }
+ #endif
+ #ifdef CONFIG_CPU_S3C2440
+ static struct s3c_irq_data init_s3c2440base[32] = {
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* NFCON */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2440subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_C */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_P */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
+ };
+ void __init s3c2440_init_irq(void)
+ {
+       pr_info("S3C2440: IRQ Support\n");
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2440base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4);
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2440subint[0],
+                                       s3c_intc[0], 0x4a000018);
+ }
+ #endif
+ #ifdef CONFIG_CPU_S3C2442
+ static struct s3c_irq_data init_s3c2442base[32] = {
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_EDGE, }, /* WDT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* LCD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* DMA3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* NFCON */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2442subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_C */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_P */
+ };
+ void __init s3c2442_init_irq(void)
+ {
+       pr_info("S3C2442: IRQ Support\n");
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2442base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4);
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2442subint[0],
+                                       s3c_intc[0], 0x4a000018);
+ }
+ #endif
+ #ifdef CONFIG_CPU_S3C2443
+ static struct s3c_irq_data init_s3c2443base[32] = {
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+       { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* CAM */
+       { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART2 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* LCD */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* DMA */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART3 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* CFON */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SDI0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* NAND */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+       { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+       { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* UART0 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* SPI1 */
+       { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+       { .type = S3C_IRQTYPE_LEVEL, }, /* ADCPARENT */
+ };
+ static struct s3c_irq_data init_s3c2443subint[32] = {
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 28 }, /* UART0-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 23 }, /* UART1-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 15 }, /* UART2-ERR */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* TC */
+       { .type = S3C_IRQTYPE_EDGE, .parent_irq = 31 }, /* ADC */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_C */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 6 }, /* CAM_P */
+       { .type = S3C_IRQTYPE_NONE }, /* reserved */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD1 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD2 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD3 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 16 }, /* LCD4 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA0 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA1 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA2 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA3 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA4 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 17 }, /* DMA5 */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-RX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-TX */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 18 }, /* UART3-ERR */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* WDT */
+       { .type = S3C_IRQTYPE_LEVEL, .parent_irq = 9 }, /* AC97 */
+ };
+ void __init s3c2443_init_irq(void)
+ {
+       pr_info("S3C2443: IRQ Support\n");
+ #ifdef CONFIG_FIQ
+       init_FIQ(FIQ_START);
+ #endif
+       s3c_intc[0] = s3c24xx_init_intc(NULL, &init_s3c2443base[0], NULL,
+                                       0x4a000000);
+       if (IS_ERR(s3c_intc[0])) {
+               pr_err("irq: could not create main interrupt controller\n");
+               return;
+       }
+       s3c24xx_init_intc(NULL, &init_eint[0], s3c_intc[0], 0x560000a4);
+       s3c_intc[1] = s3c24xx_init_intc(NULL, &init_s3c2443subint[0],
+                                       s3c_intc[0], 0x4a000018);
+ }
+ #endif
+ #ifdef CONFIG_OF
+ static int s3c24xx_irq_map_of(struct irq_domain *h, unsigned int virq,
+                                                       irq_hw_number_t hw)
+ {
+       unsigned int ctrl_num = hw / 32;
+       unsigned int intc_hw = hw % 32;
+       struct s3c_irq_intc *intc = s3c_intc[ctrl_num];
+       struct s3c_irq_intc *parent_intc = intc->parent;
+       struct s3c_irq_data *irq_data = &intc->irqs[intc_hw];
+       /* attach controller pointer to irq_data */
+       irq_data->intc = intc;
+       irq_data->offset = intc_hw;
+       if (!parent_intc)
+               irq_set_chip_and_handler(virq, &s3c_irq_chip, handle_edge_irq);
+       else
+               irq_set_chip_and_handler(virq, &s3c_irq_level_chip,
+                                        handle_edge_irq);
+       irq_set_chip_data(virq, irq_data);
+       set_irq_flags(virq, IRQF_VALID);
+       return 0;
+ }
+ /* Translate our of irq notation
+  * format: <ctrl_num ctrl_irq parent_irq type>
+  */
+ static int s3c24xx_irq_xlate_of(struct irq_domain *d, struct device_node *n,
+                       const u32 *intspec, unsigned int intsize,
+                       irq_hw_number_t *out_hwirq, unsigned int *out_type)
+ {
+       struct s3c_irq_intc *intc;
+       struct s3c_irq_intc *parent_intc;
+       struct s3c_irq_data *irq_data;
+       struct s3c_irq_data *parent_irq_data;
+       int irqno;
+       if (WARN_ON(intsize < 4))
+               return -EINVAL;
+       if (intspec[0] > 2 || !s3c_intc[intspec[0]]) {
+               pr_err("controller number %d invalid\n", intspec[0]);
+               return -EINVAL;
+       }
+       intc = s3c_intc[intspec[0]];
+       *out_hwirq = intspec[0] * 32 + intspec[2];
+       *out_type = intspec[3] & IRQ_TYPE_SENSE_MASK;
+       parent_intc = intc->parent;
+       if (parent_intc) {
+               irq_data = &intc->irqs[intspec[2]];
+               irq_data->parent_irq = intspec[1];
+               parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];
+               parent_irq_data->sub_intc = intc;
+               parent_irq_data->sub_bits |= (1UL << intspec[2]);
+               /* parent_intc is always s3c_intc[0], so no offset */
+               irqno = irq_create_mapping(parent_intc->domain, intspec[1]);
+               if (irqno < 0) {
+                       pr_err("irq: could not map parent interrupt\n");
+                       return irqno;
+               }
+               irq_set_chained_handler(irqno, s3c_irq_demux);
+       }
+       return 0;
+ }
+ static struct irq_domain_ops s3c24xx_irq_ops_of = {
+       .map = s3c24xx_irq_map_of,
+       .xlate = s3c24xx_irq_xlate_of,
+ };
+ struct s3c24xx_irq_of_ctrl {
+       char                    *name;
+       unsigned long           offset;
+       struct s3c_irq_intc     **handle;
+       struct s3c_irq_intc     **parent;
+       struct irq_domain_ops   *ops;
+ };
+ static int __init s3c_init_intc_of(struct device_node *np,
+                       struct device_node *interrupt_parent,
+                       struct s3c24xx_irq_of_ctrl *s3c_ctrl, int num_ctrl)
+ {
+       struct s3c_irq_intc *intc;
+       struct s3c24xx_irq_of_ctrl *ctrl;
+       struct irq_domain *domain;
+       void __iomem *reg_base;
+       int i;
+       reg_base = of_iomap(np, 0);
+       if (!reg_base) {
+               pr_err("irq-s3c24xx: could not map irq registers\n");
+               return -EINVAL;
+       }
+       domain = irq_domain_add_linear(np, num_ctrl * 32,
+                                                    &s3c24xx_irq_ops_of, NULL);
+       if (!domain) {
+               pr_err("irq: could not create irq-domain\n");
+               return -EINVAL;
+       }
+       for (i = 0; i < num_ctrl; i++) {
+               ctrl = &s3c_ctrl[i];
+               pr_debug("irq: found controller %s\n", ctrl->name);
+               intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL);
+               if (!intc)
+                       return -ENOMEM;
+               intc->domain = domain;
+               intc->irqs = kzalloc(sizeof(struct s3c_irq_data) * 32,
+                                    GFP_KERNEL);
+               if (!intc->irqs) {
+                       kfree(intc);
+                       return -ENOMEM;
+               }
+               if (ctrl->parent) {
+                       intc->reg_pending = reg_base + ctrl->offset;
+                       intc->reg_mask = reg_base + ctrl->offset + 0x4;
+                       if (*(ctrl->parent)) {
+                               intc->parent = *(ctrl->parent);
+                       } else {
+                               pr_warn("irq: parent of %s missing\n",
+                                       ctrl->name);
+                               kfree(intc->irqs);
+                               kfree(intc);
+                               continue;
+                       }
+               } else {
+                       intc->reg_pending = reg_base + ctrl->offset;
+                       intc->reg_mask = reg_base + ctrl->offset + 0x08;
+                       intc->reg_intpnd = reg_base + ctrl->offset + 0x10;
+               }
+               s3c24xx_clear_intc(intc);
+               s3c_intc[i] = intc;
+       }
+       set_handle_irq(s3c24xx_handle_irq);
+       return 0;
+ }
+ static struct s3c24xx_irq_of_ctrl s3c2410_ctrl[] = {
+       {
+               .name = "intc",
+               .offset = 0,
+       }, {
+               .name = "subintc",
+               .offset = 0x18,
+               .parent = &s3c_intc[0],
+       }
+ };
+ int __init s3c2410_init_intc_of(struct device_node *np,
+                       struct device_node *interrupt_parent,
+                       struct s3c24xx_irq_of_ctrl *ctrl, int num_ctrl)
+ {
+       return s3c_init_intc_of(np, interrupt_parent,
+                               s3c2410_ctrl, ARRAY_SIZE(s3c2410_ctrl));
+ }
+ IRQCHIP_DECLARE(s3c2410_irq, "samsung,s3c2410-irq", s3c2410_init_intc_of);
+ static struct s3c24xx_irq_of_ctrl s3c2416_ctrl[] = {
+       {
+               .name = "intc",
+               .offset = 0,
+       }, {
+               .name = "subintc",
+               .offset = 0x18,
+               .parent = &s3c_intc[0],
+       }, {
+               .name = "intc2",
+               .offset = 0x40,
+       }
+ };
+ int __init s3c2416_init_intc_of(struct device_node *np,
+                       struct device_node *interrupt_parent,
+                       struct s3c24xx_irq_of_ctrl *ctrl, int num_ctrl)
+ {
+       return s3c_init_intc_of(np, interrupt_parent,
+                               s3c2416_ctrl, ARRAY_SIZE(s3c2416_ctrl));
+ }
+ IRQCHIP_DECLARE(s3c2416_irq, "samsung,s3c2416-irq", s3c2416_init_intc_of);
+ #endif
diff --combined drivers/of/base.c
index 0a2bdd106b237f72fc3ca84f55e6c7f49bf1c8d8,c6443de58fb0f29fd093497639ff82cac4085e5a..c76d16c972cc6cfaf6ce08fd56ebe89020508032
@@@ -382,7 -382,6 +382,7 @@@ struct device_node *of_get_next_parent(
        raw_spin_unlock_irqrestore(&devtree_lock, flags);
        return parent;
  }
 +EXPORT_SYMBOL(of_get_next_parent);
  
  /**
   *    of_get_next_child - Iterate a node childs
@@@ -746,6 -745,64 +746,64 @@@ struct device_node *of_find_node_by_pha
  }
  EXPORT_SYMBOL(of_find_node_by_phandle);
  
+ /**
+  * of_find_property_value_of_size
+  *
+  * @np:               device node from which the property value is to be read.
+  * @propname: name of the property to be searched.
+  * @len:      requested length of property value
+  *
+  * Search for a property in a device node and valid the requested size.
+  * Returns the property value on success, -EINVAL if the property does not
+  *  exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
+  * property data isn't large enough.
+  *
+  */
+ static void *of_find_property_value_of_size(const struct device_node *np,
+                       const char *propname, u32 len)
+ {
+       struct property *prop = of_find_property(np, propname, NULL);
+       if (!prop)
+               return ERR_PTR(-EINVAL);
+       if (!prop->value)
+               return ERR_PTR(-ENODATA);
+       if (len > prop->length)
+               return ERR_PTR(-EOVERFLOW);
+       return prop->value;
+ }
+ /**
+  * of_property_read_u32_index - Find and read a u32 from a multi-value property.
+  *
+  * @np:               device node from which the property value is to be read.
+  * @propname: name of the property to be searched.
+  * @index:    index of the u32 in the list of values
+  * @out_value:        pointer to return value, modified only if no error.
+  *
+  * Search for a property in a device node and read nth 32-bit value from
+  * it. Returns 0 on success, -EINVAL if the property does not exist,
+  * -ENODATA if property does not have a value, and -EOVERFLOW if the
+  * property data isn't large enough.
+  *
+  * The out_value is modified only if a valid u32 value can be decoded.
+  */
+ int of_property_read_u32_index(const struct device_node *np,
+                                      const char *propname,
+                                      u32 index, u32 *out_value)
+ {
+       const u32 *val = of_find_property_value_of_size(np, propname,
+                                       ((index + 1) * sizeof(*out_value)));
+       if (IS_ERR(val))
+               return PTR_ERR(val);
+       *out_value = be32_to_cpup(((__be32 *)val) + index);
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(of_property_read_u32_index);
  /**
   * of_property_read_u8_array - Find and read an array of u8 from a property.
   *
  int of_property_read_u8_array(const struct device_node *np,
                        const char *propname, u8 *out_values, size_t sz)
  {
-       struct property *prop = of_find_property(np, propname, NULL);
-       const u8 *val;
+       const u8 *val = of_find_property_value_of_size(np, propname,
+                                               (sz * sizeof(*out_values)));
  
-       if (!prop)
-               return -EINVAL;
-       if (!prop->value)
-               return -ENODATA;
-       if ((sz * sizeof(*out_values)) > prop->length)
-               return -EOVERFLOW;
+       if (IS_ERR(val))
+               return PTR_ERR(val);
  
-       val = prop->value;
        while (sz--)
                *out_values++ = *val++;
        return 0;
@@@ -805,17 -857,12 +858,12 @@@ EXPORT_SYMBOL_GPL(of_property_read_u8_a
  int of_property_read_u16_array(const struct device_node *np,
                        const char *propname, u16 *out_values, size_t sz)
  {
-       struct property *prop = of_find_property(np, propname, NULL);
-       const __be16 *val;
+       const __be16 *val = of_find_property_value_of_size(np, propname,
+                                               (sz * sizeof(*out_values)));
  
-       if (!prop)
-               return -EINVAL;
-       if (!prop->value)
-               return -ENODATA;
-       if ((sz * sizeof(*out_values)) > prop->length)
-               return -EOVERFLOW;
+       if (IS_ERR(val))
+               return PTR_ERR(val);
  
-       val = prop->value;
        while (sz--)
                *out_values++ = be16_to_cpup(val++);
        return 0;
@@@ -842,17 -889,12 +890,12 @@@ int of_property_read_u32_array(const st
                               const char *propname, u32 *out_values,
                               size_t sz)
  {
-       struct property *prop = of_find_property(np, propname, NULL);
-       const __be32 *val;
+       const __be32 *val = of_find_property_value_of_size(np, propname,
+                                               (sz * sizeof(*out_values)));
  
-       if (!prop)
-               return -EINVAL;
-       if (!prop->value)
-               return -ENODATA;
-       if ((sz * sizeof(*out_values)) > prop->length)
-               return -EOVERFLOW;
+       if (IS_ERR(val))
+               return PTR_ERR(val);
  
-       val = prop->value;
        while (sz--)
                *out_values++ = be32_to_cpup(val++);
        return 0;
@@@ -875,15 -917,13 +918,13 @@@ EXPORT_SYMBOL_GPL(of_property_read_u32_
  int of_property_read_u64(const struct device_node *np, const char *propname,
                         u64 *out_value)
  {
-       struct property *prop = of_find_property(np, propname, NULL);
+       const __be32 *val = of_find_property_value_of_size(np, propname,
+                                               sizeof(*out_value));
  
-       if (!prop)
-               return -EINVAL;
-       if (!prop->value)
-               return -ENODATA;
-       if (sizeof(*out_value) > prop->length)
-               return -EOVERFLOW;
-       *out_value = of_read_number(prop->value, 2);
+       if (IS_ERR(val))
+               return PTR_ERR(val);
+       *out_value = of_read_number(val, 2);
        return 0;
  }
  EXPORT_SYMBOL_GPL(of_property_read_u64);
@@@ -1453,7 -1493,16 +1494,7 @@@ int of_attach_node(struct device_node *
  #ifdef CONFIG_PROC_DEVICETREE
  static void of_remove_proc_dt_entry(struct device_node *dn)
  {
 -      struct device_node *parent = dn->parent;
 -      struct property *prop = dn->properties;
 -
 -      while (prop) {
 -              remove_proc_entry(prop->name, dn->pde);
 -              prop = prop->next;
 -      }
 -
 -      if (dn->pde)
 -              remove_proc_entry(dn->pde->name, parent->pde);
 +      proc_remove(dn->pde);
  }
  #else
  static void of_remove_proc_dt_entry(struct device_node *dn)
diff --combined drivers/pinctrl/Kconfig
index 51336b2aedc92010d1c628d59b8131e9b423664c,35e94009829bf6eb2a4a444e624cae10362fde7c..8f669243814935c3df4544e8d61127997cde2332
@@@ -93,20 -93,12 +93,20 @@@ config PINCTRL_IMX5
          Say Y here to enable the imx53 pinctrl driver
  
  config PINCTRL_IMX6Q
 -      bool "IMX6Q pinctrl driver"
 +      bool "IMX6Q/DL pinctrl driver"
        depends on OF
        depends on SOC_IMX6Q
        select PINCTRL_IMX
        help
 -        Say Y here to enable the imx6q pinctrl driver
 +        Say Y here to enable the imx6q/dl pinctrl driver
 +
 +config PINCTRL_IMX6SL
 +      bool "IMX6SL pinctrl driver"
 +      depends on OF
 +      depends on SOC_IMX6SL
 +      select PINCTRL_IMX
 +      help
 +        Say Y here to enable the imx6sl pinctrl driver
  
  config PINCTRL_LANTIQ
        bool
        select PINMUX
        select PINCONF
  
 -config PINCTRL_PXA3xx
 -      bool
 -      select PINMUX
 -
  config PINCTRL_FALCON
        bool
        depends on SOC_FALCON
        depends on PINCTRL_LANTIQ
  
 -config PINCTRL_MMP2
 -      bool "MMP2 pin controller driver"
 -      depends on ARCH_MMP
 -      select PINCTRL_PXA3xx
 -
  config PINCTRL_MXS
        bool
        select PINMUX
@@@ -150,12 -151,21 +150,12 @@@ config PINCTRL_DB854
        bool "DB8540 pin controller driver"
        depends on PINCTRL_NOMADIK && ARCH_U8500
  
 -config PINCTRL_PXA168
 -      bool "PXA168 pin controller driver"
 -      depends on ARCH_MMP
 -      select PINCTRL_PXA3xx
 -
 -config PINCTRL_PXA910
 -      bool "PXA910 pin controller driver"
 -      depends on ARCH_MMP
 -      select PINCTRL_PXA3xx
 -
  config PINCTRL_SINGLE
        tristate "One-register-per-pin type device tree based pinctrl driver"
        depends on OF
        select PINMUX
        select PINCONF
 +      select GENERIC_PINCONF
        help
          This selects the device tree based generic pinctrl driver.
  
@@@ -216,14 -226,10 +216,15 @@@ config PINCTRL_EXYNOS544
        select PINMUX
        select PINCONF
  
 +config PINCTRL_S3C64XX
 +      bool "Samsung S3C64XX SoC pinctrl driver"
 +      depends on ARCH_S3C64XX
 +      select PINCTRL_SAMSUNG
 +
  source "drivers/pinctrl/mvebu/Kconfig"
  source "drivers/pinctrl/sh-pfc/Kconfig"
  source "drivers/pinctrl/spear/Kconfig"
+ source "drivers/pinctrl/vt8500/Kconfig"
  
  config PINCTRL_XWAY
        bool
diff --combined drivers/pinctrl/Makefile
index b9aaa61facd1b4a7f1bcad07d4ebd13d3de08527,a5a52c83c13a42eeb70d52cc9598586ad23d02c6..9bdaeb8785ce5336d9eb174c73e989dac8418022
@@@ -21,8 -21,9 +21,8 @@@ obj-$(CONFIG_PINCTRL_IMX35)   += pinctrl-
  obj-$(CONFIG_PINCTRL_IMX51)   += pinctrl-imx51.o
  obj-$(CONFIG_PINCTRL_IMX53)   += pinctrl-imx53.o
  obj-$(CONFIG_PINCTRL_IMX6Q)   += pinctrl-imx6q.o
 -obj-$(CONFIG_PINCTRL_PXA3xx)  += pinctrl-pxa3xx.o
 +obj-$(CONFIG_PINCTRL_IMX6Q)   += pinctrl-imx6dl.o
  obj-$(CONFIG_PINCTRL_FALCON)  += pinctrl-falcon.o
 -obj-$(CONFIG_PINCTRL_MMP2)    += pinctrl-mmp2.o
  obj-$(CONFIG_PINCTRL_MXS)     += pinctrl-mxs.o
  obj-$(CONFIG_PINCTRL_IMX23)   += pinctrl-imx23.o
  obj-$(CONFIG_PINCTRL_IMX28)   += pinctrl-imx28.o
@@@ -30,6 -31,8 +30,6 @@@ obj-$(CONFIG_PINCTRL_NOMADIK) += pinctr
  obj-$(CONFIG_PINCTRL_STN8815) += pinctrl-nomadik-stn8815.o
  obj-$(CONFIG_PINCTRL_DB8500)  += pinctrl-nomadik-db8500.o
  obj-$(CONFIG_PINCTRL_DB8540)  += pinctrl-nomadik-db8540.o
 -obj-$(CONFIG_PINCTRL_PXA168)  += pinctrl-pxa168.o
 -obj-$(CONFIG_PINCTRL_PXA910)  += pinctrl-pxa910.o
  obj-$(CONFIG_PINCTRL_SINGLE)  += pinctrl-single.o
  obj-$(CONFIG_PINCTRL_SIRF)    += pinctrl-sirf.o
  obj-$(CONFIG_PINCTRL_SUNXI)   += pinctrl-sunxi.o
@@@ -42,7 -45,6 +42,7 @@@ obj-$(CONFIG_PINCTRL_COH901)  += pinctrl
  obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o
  obj-$(CONFIG_PINCTRL_EXYNOS)  += pinctrl-exynos.o
  obj-$(CONFIG_PINCTRL_EXYNOS5440)      += pinctrl-exynos5440.o
 +obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o
  obj-$(CONFIG_PINCTRL_XWAY)    += pinctrl-xway.o
  obj-$(CONFIG_PINCTRL_LANTIQ)  += pinctrl-lantiq.o
  
@@@ -50,3 -52,4 +50,4 @@@ obj-$(CONFIG_PLAT_ORION)        += mveb
  obj-$(CONFIG_ARCH_SHMOBILE)   += sh-pfc/
  obj-$(CONFIG_SUPERH)          += sh-pfc/
  obj-$(CONFIG_PLAT_SPEAR)      += spear/
+ obj-$(CONFIG_ARCH_VT8500)     += vt8500/
index f28d4b08771abb4533e69727af6d84f492bb5043,2a2e427d765ee7b35b0635959d58dcdb3a28f0e5..c8f20a3d8f8850aa758759627075a2fd87e4f1f5
@@@ -699,11 -699,6 +699,6 @@@ static int bcm2835_pctl_dt_node_to_map_
        return 0;
  }
  
- static inline u32 prop_u32(struct property *p, int i)
- {
-       return be32_to_cpup(((__be32 *)p->value) + i);
- }
  static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
                struct device_node *np,
                struct pinctrl_map **map, unsigned *num_maps)
                return -ENOMEM;
  
        for (i = 0; i < num_pins; i++) {
-               pin = prop_u32(pins, i);
+               err = of_property_read_u32_index(np, "brcm,pins", i, &pin);
+               if (err)
+                       goto out;
                if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
                        dev_err(pc->dev, "%s: invalid brcm,pins value %d\n",
                                of_node_full_name(np), pin);
                }
  
                if (num_funcs) {
-                       func = prop_u32(funcs, (num_funcs > 1) ? i : 0);
+                       err = of_property_read_u32_index(np, "brcm,function",
+                                       (num_funcs > 1) ? i : 0, &func);
+                       if (err)
+                               goto out;
                        err = bcm2835_pctl_dt_node_to_map_func(pc, np, pin,
                                                        func, &cur_map);
                        if (err)
                                goto out;
                }
                if (num_pulls) {
-                       pull = prop_u32(pulls, (num_pulls > 1) ? i : 0);
+                       err = of_property_read_u32_index(np, "brcm,pull",
+                                       (num_funcs > 1) ? i : 0, &pull);
+                       if (err)
+                               goto out;
                        err = bcm2835_pctl_dt_node_to_map_pull(pc, np, pin,
                                                        pull, &cur_map);
                        if (err)
@@@ -795,7 -798,7 +798,7 @@@ out
        return err;
  }
  
 -static struct pinctrl_ops bcm2835_pctl_ops = {
 +static const struct pinctrl_ops bcm2835_pctl_ops = {
        .get_groups_count = bcm2835_pctl_get_groups_count,
        .get_group_name = bcm2835_pctl_get_group_name,
        .get_group_pins = bcm2835_pctl_get_group_pins,
@@@ -872,7 -875,7 +875,7 @@@ static int bcm2835_pmx_gpio_set_directi
        return 0;
  }
  
 -static struct pinmux_ops bcm2835_pmx_ops = {
 +static const struct pinmux_ops bcm2835_pmx_ops = {
        .get_functions_count = bcm2835_pmx_get_functions_count,
        .get_function_name = bcm2835_pmx_get_function_name,
        .get_function_groups = bcm2835_pmx_get_function_groups,
@@@ -916,7 -919,7 +919,7 @@@ static int bcm2835_pinconf_set(struct p
        return 0;
  }
  
 -static struct pinconf_ops bcm2835_pinconf_ops = {
 +static const struct pinconf_ops bcm2835_pinconf_ops = {
        .pin_config_get = bcm2835_pinconf_get,
        .pin_config_set = bcm2835_pinconf_set,
  };
index ec1567842a7e3fbba71aedcbb51c412311c13cdd,8738933a57d73c9ffc9193a83c3a375ae34151e2..ac742817ebceeebf1797a27b6f1995931a9df363
  #include <linux/interrupt.h>
  #include <linux/irqdomain.h>
  #include <linux/irq.h>
 +#include <linux/irqchip/chained_irq.h>
  #include <linux/of_irq.h>
  #include <linux/io.h>
  #include <linux/slab.h>
 +#include <linux/spinlock.h>
  #include <linux/err.h>
  
 -#include <asm/mach/irq.h>
 -
  #include "pinctrl-samsung.h"
  #include "pinctrl-exynos.h"
  
 +
 +static struct samsung_pin_bank_type bank_type_off = {
 +      .fld_width = { 4, 1, 2, 2, 2, 2, },
 +      .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
 +};
 +
 +static struct samsung_pin_bank_type bank_type_alive = {
 +      .fld_width = { 4, 1, 2, 2, },
 +      .reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
 +};
 +
  /* list of external wakeup controllers supported */
  static const struct of_device_id exynos_wkup_irq_ids[] = {
        { .compatible = "samsung,exynos4210-wakeup-eint", },
@@@ -86,14 -75,12 +86,14 @@@ static void exynos_gpio_irq_ack(struct 
  static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
  {
        struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
 +      struct samsung_pin_bank_type *bank_type = bank->type;
        struct samsung_pinctrl_drv_data *d = bank->drvdata;
        struct samsung_pin_ctrl *ctrl = d->ctrl;
        unsigned int pin = irqd->hwirq;
        unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
        unsigned int con, trig_type;
        unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
 +      unsigned long flags;
        unsigned int mask;
  
        switch (type) {
        con |= trig_type << shift;
        writel(con, d->virt_base + reg_con);
  
 -      reg_con = bank->pctl_offset;
 -      shift = pin * bank->func_width;
 -      mask = (1 << bank->func_width) - 1;
 +      reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
 +      shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
 +      mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
 +
 +      spin_lock_irqsave(&bank->slock, flags);
  
        con = readl(d->virt_base + reg_con);
        con &= ~(mask << shift);
        con |= EXYNOS_EINT_FUNC << shift;
        writel(con, d->virt_base + reg_con);
  
 +      spin_unlock_irqrestore(&bank->slock, flags);
 +
        return 0;
  }
  
@@@ -270,13 -253,11 +270,13 @@@ static void exynos_wkup_irq_ack(struct 
  static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
  {
        struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
 +      struct samsung_pin_bank_type *bank_type = bank->type;
        struct samsung_pinctrl_drv_data *d = bank->drvdata;
        unsigned int pin = irqd->hwirq;
        unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
        unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
        unsigned long con, trig_type;
 +      unsigned long flags;
        unsigned int mask;
  
        switch (type) {
        con |= trig_type << shift;
        writel(con, d->virt_base + reg_con);
  
 -      reg_con = bank->pctl_offset;
 -      shift = pin * bank->func_width;
 -      mask = (1 << bank->func_width) - 1;
 +      reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
 +      shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
 +      mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
 +
 +      spin_lock_irqsave(&bank->slock, flags);
  
        con = readl(d->virt_base + reg_con);
        con &= ~(mask << shift);
        con |= EXYNOS_EINT_FUNC << shift;
        writel(con, d->virt_base + reg_con);
  
 +      spin_unlock_irqrestore(&bank->slock, flags);
 +
        return 0;
  }
  
@@@ -700,3 -677,111 +700,111 @@@ struct samsung_pin_ctrl exynos4x12_pin_
                .label          = "exynos4x12-gpio-ctrl3",
        },
  };
+ /* pin banks of exynos5250 pin-controller 0 */
+ static struct samsung_pin_bank exynos5250_pin_banks0[] = {
+       EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
+       EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
+       EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
+       EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
+       EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
+       EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
+       EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
+       EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
+       EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc1", 0x20),
+       EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc2", 0x24),
+       EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc3", 0x28),
+       EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpd0", 0x2c),
+       EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x30),
+       EXYNOS_PIN_BANK_EINTG(7, 0x2E0, "gpc4", 0x34),
+       EXYNOS_PIN_BANK_EINTN(6, 0x1A0, "gpy0"),
+       EXYNOS_PIN_BANK_EINTN(4, 0x1C0, "gpy1"),
+       EXYNOS_PIN_BANK_EINTN(6, 0x1E0, "gpy2"),
+       EXYNOS_PIN_BANK_EINTN(8, 0x200, "gpy3"),
+       EXYNOS_PIN_BANK_EINTN(8, 0x220, "gpy4"),
+       EXYNOS_PIN_BANK_EINTN(8, 0x240, "gpy5"),
+       EXYNOS_PIN_BANK_EINTN(8, 0x260, "gpy6"),
+       EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
+       EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
+       EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
+       EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
+ };
+ /* pin banks of exynos5250 pin-controller 1 */
+ static struct samsung_pin_bank exynos5250_pin_banks1[] = {
+       EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
+       EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
+       EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
+       EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf1", 0x0c),
+       EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
+       EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
+       EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
+       EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gph0", 0x1c),
+       EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph1", 0x20),
+ };
+ /* pin banks of exynos5250 pin-controller 2 */
+ static struct samsung_pin_bank exynos5250_pin_banks2[] = {
+       EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
+       EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
+       EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
+       EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
+       EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
+ };
+ /* pin banks of exynos5250 pin-controller 3 */
+ static struct samsung_pin_bank exynos5250_pin_banks3[] = {
+       EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
+ };
+ /*
+  * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
+  * four gpio/pin-mux/pinconfig controllers.
+  */
+ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = {
+       {
+               /* pin-controller instance 0 data */
+               .pin_banks      = exynos5250_pin_banks0,
+               .nr_banks       = ARRAY_SIZE(exynos5250_pin_banks0),
+               .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
+               .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
+               .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
+               .weint_con      = EXYNOS_WKUP_ECON_OFFSET,
+               .weint_mask     = EXYNOS_WKUP_EMASK_OFFSET,
+               .weint_pend     = EXYNOS_WKUP_EPEND_OFFSET,
+               .svc            = EXYNOS_SVC_OFFSET,
+               .eint_gpio_init = exynos_eint_gpio_init,
+               .eint_wkup_init = exynos_eint_wkup_init,
+               .label          = "exynos5250-gpio-ctrl0",
+       }, {
+               /* pin-controller instance 1 data */
+               .pin_banks      = exynos5250_pin_banks1,
+               .nr_banks       = ARRAY_SIZE(exynos5250_pin_banks1),
+               .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
+               .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
+               .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
+               .svc            = EXYNOS_SVC_OFFSET,
+               .eint_gpio_init = exynos_eint_gpio_init,
+               .label          = "exynos5250-gpio-ctrl1",
+       }, {
+               /* pin-controller instance 2 data */
+               .pin_banks      = exynos5250_pin_banks2,
+               .nr_banks       = ARRAY_SIZE(exynos5250_pin_banks2),
+               .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
+               .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
+               .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
+               .svc            = EXYNOS_SVC_OFFSET,
+               .eint_gpio_init = exynos_eint_gpio_init,
+               .label          = "exynos5250-gpio-ctrl2",
+       }, {
+               /* pin-controller instance 3 data */
+               .pin_banks      = exynos5250_pin_banks3,
+               .nr_banks       = ARRAY_SIZE(exynos5250_pin_banks3),
+               .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
+               .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
+               .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
+               .svc            = EXYNOS_SVC_OFFSET,
+               .eint_gpio_init = exynos_eint_gpio_init,
+               .label          = "exynos5250-gpio-ctrl3",
+       },
+ };
index 4f54faf2971f83f9fd8522e194a70ca6b64bf867,3d5cf639aa46c91f288e9cade71d9230023b01e1..976366899f68831f6765f1422ce996a1c8dec3b8
@@@ -27,7 -27,6 +27,7 @@@
  #include <linux/err.h>
  #include <linux/gpio.h>
  #include <linux/irqdomain.h>
 +#include <linux/spinlock.h>
  
  #include "core.h"
  #include "pinctrl-samsung.h"
@@@ -215,7 -214,7 +215,7 @@@ static void samsung_dt_free_map(struct 
  }
  
  /* list of pinctrl callbacks for the pinctrl core */
 -static struct pinctrl_ops samsung_pctrl_ops = {
 +static const struct pinctrl_ops samsung_pctrl_ops = {
        .get_groups_count       = samsung_get_group_count,
        .get_group_name         = samsung_get_group_name,
        .get_group_pins         = samsung_get_group_pins,
@@@ -275,6 -274,10 +275,6 @@@ static void pin_to_reg_bank(struct sams
        *offset = pin - b->pin_base;
        if (bank)
                *bank = b;
 -
 -      /* some banks have two config registers in a single bank */
 -      if (*offset * b->func_width > BITS_PER_LONG)
 -              *reg += 4;
  }
  
  /* enable or disable a pinmux function */
@@@ -286,7 -289,6 +286,7 @@@ static void samsung_pinmux_setup(struc
        struct samsung_pin_bank *bank;
        void __iomem *reg;
        u32 mask, shift, data, pin_offset, cnt;
 +      unsigned long flags;
  
        drvdata = pinctrl_dev_get_drvdata(pctldev);
        pins = drvdata->pin_groups[group].pins;
         * pin function number in the config register.
         */
        for (cnt = 0; cnt < drvdata->pin_groups[group].num_pins; cnt++) {
 +              struct samsung_pin_bank_type *type;
 +
                pin_to_reg_bank(drvdata, pins[cnt] - drvdata->ctrl->base,
                                &reg, &pin_offset, &bank);
 -              mask = (1 << bank->func_width) - 1;
 -              shift = pin_offset * bank->func_width;
 +              type = bank->type;
 +              mask = (1 << type->fld_width[PINCFG_TYPE_FUNC]) - 1;
 +              shift = pin_offset * type->fld_width[PINCFG_TYPE_FUNC];
 +              if (shift >= 32) {
 +                      /* Some banks have two config registers */
 +                      shift -= 32;
 +                      reg += 4;
 +              }
 +
 +              spin_lock_irqsave(&bank->slock, flags);
  
 -              data = readl(reg);
 +              data = readl(reg + type->reg_offset[PINCFG_TYPE_FUNC]);
                data &= ~(mask << shift);
                if (enable)
                        data |= drvdata->pin_groups[group].func << shift;
 -              writel(data, reg);
 +              writel(data, reg + type->reg_offset[PINCFG_TYPE_FUNC]);
 +
 +              spin_unlock_irqrestore(&bank->slock, flags);
        }
  }
  
@@@ -344,44 -334,30 +344,44 @@@ static void samsung_pinmux_disable(stru
  static int samsung_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
                struct pinctrl_gpio_range *range, unsigned offset, bool input)
  {
 +      struct samsung_pin_bank_type *type;
        struct samsung_pin_bank *bank;
        struct samsung_pinctrl_drv_data *drvdata;
        void __iomem *reg;
        u32 data, pin_offset, mask, shift;
 +      unsigned long flags;
  
        bank = gc_to_pin_bank(range->gc);
 +      type = bank->type;
        drvdata = pinctrl_dev_get_drvdata(pctldev);
  
        pin_offset = offset - bank->pin_base;
 -      reg = drvdata->virt_base + bank->pctl_offset;
 +      reg = drvdata->virt_base + bank->pctl_offset +
 +                                      type->reg_offset[PINCFG_TYPE_FUNC];
 +
 +      mask = (1 << type->fld_width[PINCFG_TYPE_FUNC]) - 1;
 +      shift = pin_offset * type->fld_width[PINCFG_TYPE_FUNC];
 +      if (shift >= 32) {
 +              /* Some banks have two config registers */
 +              shift -= 32;
 +              reg += 4;
 +      }
  
 -      mask = (1 << bank->func_width) - 1;
 -      shift = pin_offset * bank->func_width;
 +      spin_lock_irqsave(&bank->slock, flags);
  
        data = readl(reg);
        data &= ~(mask << shift);
        if (!input)
                data |= FUNC_OUTPUT << shift;
        writel(data, reg);
 +
 +      spin_unlock_irqrestore(&bank->slock, flags);
 +
        return 0;
  }
  
  /* list of pinmux callbacks for the pinmux vertical in pinctrl core */
 -static struct pinmux_ops samsung_pinmux_ops = {
 +static const struct pinmux_ops samsung_pinmux_ops = {
        .get_functions_count    = samsung_get_functions_count,
        .get_function_name      = samsung_pinmux_get_fname,
        .get_function_groups    = samsung_pinmux_get_groups,
@@@ -395,26 -371,40 +395,26 @@@ static int samsung_pinconf_rw(struct pi
                                unsigned long *config, bool set)
  {
        struct samsung_pinctrl_drv_data *drvdata;
 +      struct samsung_pin_bank_type *type;
        struct samsung_pin_bank *bank;
        void __iomem *reg_base;
        enum pincfg_type cfg_type = PINCFG_UNPACK_TYPE(*config);
        u32 data, width, pin_offset, mask, shift;
        u32 cfg_value, cfg_reg;
 +      unsigned long flags;
  
        drvdata = pinctrl_dev_get_drvdata(pctldev);
        pin_to_reg_bank(drvdata, pin - drvdata->ctrl->base, &reg_base,
                                        &pin_offset, &bank);
 +      type = bank->type;
  
 -      switch (cfg_type) {
 -      case PINCFG_TYPE_PUD:
 -              width = bank->pud_width;
 -              cfg_reg = PUD_REG;
 -              break;
 -      case PINCFG_TYPE_DRV:
 -              width = bank->drv_width;
 -              cfg_reg = DRV_REG;
 -              break;
 -      case PINCFG_TYPE_CON_PDN:
 -              width = bank->conpdn_width;
 -              cfg_reg = CONPDN_REG;
 -              break;
 -      case PINCFG_TYPE_PUD_PDN:
 -              width = bank->pudpdn_width;
 -              cfg_reg = PUDPDN_REG;
 -              break;
 -      default:
 -              WARN_ON(1);
 +      if (cfg_type >= PINCFG_TYPE_NUM || !type->fld_width[cfg_type])
                return -EINVAL;
 -      }
  
 -      if (!width)
 -              return -EINVAL;
 +      width = type->fld_width[cfg_type];
 +      cfg_reg = type->reg_offset[cfg_type];
 +
 +      spin_lock_irqsave(&bank->slock, flags);
  
        mask = (1 << width) - 1;
        shift = pin_offset * width;
                data &= mask;
                *config = PINCFG_PACK(cfg_type, data);
        }
 +
 +      spin_unlock_irqrestore(&bank->slock, flags);
 +
        return 0;
  }
  
@@@ -481,7 -468,7 +481,7 @@@ static int samsung_pinconf_group_get(st
  }
  
  /* list of pinconfig callbacks for pinconfig vertical in the pinctrl code */
 -static struct pinconf_ops samsung_pinconf_ops = {
 +static const struct pinconf_ops samsung_pinconf_ops = {
        .pin_config_get         = samsung_pinconf_get,
        .pin_config_set         = samsung_pinconf_set,
        .pin_config_group_get   = samsung_pinconf_group_get,
  static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
  {
        struct samsung_pin_bank *bank = gc_to_pin_bank(gc);
 +      struct samsung_pin_bank_type *type = bank->type;
 +      unsigned long flags;
        void __iomem *reg;
        u32 data;
  
        reg = bank->drvdata->virt_base + bank->pctl_offset;
  
 -      data = readl(reg + DAT_REG);
 +      spin_lock_irqsave(&bank->slock, flags);
 +
 +      data = readl(reg + type->reg_offset[PINCFG_TYPE_DAT]);
        data &= ~(1 << offset);
        if (value)
                data |= 1 << offset;
 -      writel(data, reg + DAT_REG);
 +      writel(data, reg + type->reg_offset[PINCFG_TYPE_DAT]);
 +
 +      spin_unlock_irqrestore(&bank->slock, flags);
  }
  
  /* gpiolib gpio_get callback function */
@@@ -516,11 -497,10 +516,11 @@@ static int samsung_gpio_get(struct gpio
        void __iomem *reg;
        u32 data;
        struct samsung_pin_bank *bank = gc_to_pin_bank(gc);
 +      struct samsung_pin_bank_type *type = bank->type;
  
        reg = bank->drvdata->virt_base + bank->pctl_offset;
  
 -      data = readl(reg + DAT_REG);
 +      data = readl(reg + type->reg_offset[PINCFG_TYPE_DAT]);
        data >>= offset;
        data &= 1;
        return data;
@@@ -879,7 -859,6 +879,7 @@@ static struct samsung_pin_ctrl *samsung
  
        bank = ctrl->pin_banks;
        for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
 +              spin_lock_init(&bank->slock);
                bank->drvdata = d;
                bank->pin_base = ctrl->nr_pins;
                ctrl->nr_pins += bank->nr_pins;
@@@ -965,16 -944,12 +965,18 @@@ static int samsung_pinctrl_probe(struc
  }
  
  static const struct of_device_id samsung_pinctrl_dt_match[] = {
 +#ifdef CONFIG_PINCTRL_EXYNOS
        { .compatible = "samsung,exynos4210-pinctrl",
                .data = (void *)exynos4210_pin_ctrl },
        { .compatible = "samsung,exynos4x12-pinctrl",
                .data = (void *)exynos4x12_pin_ctrl },
+       { .compatible = "samsung,exynos5250-pinctrl",
+               .data = (void *)exynos5250_pin_ctrl },
 +#endif
 +#ifdef CONFIG_PINCTRL_S3C64XX
 +      { .compatible = "samsung,s3c64xx-pinctrl",
 +              .data = s3c64xx_pin_ctrl },
 +#endif
        {},
  };
  MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);
index 45f27b41e30ce02f1c91d1592179ea079a397e41,ee964aadce0c3390d4a774771a66cf83ed9ab50a..7c7f9ebcd05b13d183889f6bb360f080ccc7d8ca
  
  #include <linux/gpio.h>
  
 -/* register offsets within a pin bank */
 -#define DAT_REG               0x4
 -#define PUD_REG               0x8
 -#define DRV_REG               0xC
 -#define CONPDN_REG    0x10
 -#define PUDPDN_REG    0x14
 -
  /* pinmux function number for pin as gpio output line */
  #define FUNC_OUTPUT   0x1
  
  /**
   * enum pincfg_type - possible pin configuration types supported.
 + * @PINCFG_TYPE_FUNC: Function configuration.
 + * @PINCFG_TYPE_DAT: Pin value configuration.
   * @PINCFG_TYPE_PUD: Pull up/down configuration.
   * @PINCFG_TYPE_DRV: Drive strength configuration.
   * @PINCFG_TYPE_CON_PDN: Pin function in power down mode.
   * @PINCFG_TYPE_PUD_PDN: Pull up/down configuration in power down mode.
   */
  enum pincfg_type {
 +      PINCFG_TYPE_FUNC,
 +      PINCFG_TYPE_DAT,
        PINCFG_TYPE_PUD,
        PINCFG_TYPE_DRV,
        PINCFG_TYPE_CON_PDN,
        PINCFG_TYPE_PUD_PDN,
 +
 +      PINCFG_TYPE_NUM
  };
  
  /*
@@@ -101,41 -102,34 +101,41 @@@ enum eint_type 
  
  struct samsung_pinctrl_drv_data;
  
 +/**
 + * struct samsung_pin_bank_type: pin bank type description
 + * @fld_width: widths of configuration bitfields (0 if unavailable)
 + * @reg_offset: offsets of configuration registers (don't care of width is 0)
 + */
 +struct samsung_pin_bank_type {
 +      u8 fld_width[PINCFG_TYPE_NUM];
 +      u8 reg_offset[PINCFG_TYPE_NUM];
 +};
 +
  /**
   * struct samsung_pin_bank: represent a controller pin-bank.
 + * @type: type of the bank (register offsets and bitfield widths)
   * @pctl_offset: starting offset of the pin-bank registers.
   * @pin_base: starting pin number of the bank.
   * @nr_pins: number of pins included in this bank.
 - * @func_width: width of the function selector bit field.
 - * @pud_width: width of the pin pull up/down selector bit field.
 - * @drv_width: width of the pin driver strength selector bit field.
 - * @conpdn_width: width of the sleep mode function selector bin field.
 - * @pudpdn_width: width of the sleep mode pull up/down selector bit field.
 + * @eint_func: function to set in CON register to configure pin as EINT.
   * @eint_type: type of the external interrupt supported by the bank.
 + * @eint_mask: bit mask of pins which support EINT function.
   * @name: name to be prefixed for each pin in this pin bank.
   * @of_node: OF node of the bank.
   * @drvdata: link to controller driver data
   * @irq_domain: IRQ domain of the bank.
   * @gpio_chip: GPIO chip of the bank.
   * @grange: linux gpio pin range supported by this bank.
 + * @slock: spinlock protecting bank registers
   */
  struct samsung_pin_bank {
 +      struct samsung_pin_bank_type *type;
        u32             pctl_offset;
        u32             pin_base;
        u8              nr_pins;
 -      u8              func_width;
 -      u8              pud_width;
 -      u8              drv_width;
 -      u8              conpdn_width;
 -      u8              pudpdn_width;
 +      u8              eint_func;
        enum eint_type  eint_type;
 +      u32             eint_mask;
        u32             eint_offset;
        char            *name;
        struct device_node *of_node;
        struct irq_domain *irq_domain;
        struct gpio_chip gpio_chip;
        struct pinctrl_gpio_range grange;
 +      spinlock_t slock;
  };
  
  /**
@@@ -244,6 -237,6 +244,7 @@@ struct samsung_pmx_func 
  /* list of all exported SoC specific data */
  extern struct samsung_pin_ctrl exynos4210_pin_ctrl[];
  extern struct samsung_pin_ctrl exynos4x12_pin_ctrl[];
+ extern struct samsung_pin_ctrl exynos5250_pin_ctrl[];
 +extern struct samsung_pin_ctrl s3c64xx_pin_ctrl[];
  
  #endif /* __PINCTRL_SAMSUNG_H */
index 98348ec0b3ce1f9ad342ceb7feadd0a0c6fdc3ba,c1a2914447e14c4aef834a9e23fc70d6ad49377b..540909de6247b19daabb6fc6affa650fe6a70f9a
  #define ATMEL_LCDC_DMA_BURST_LEN      8       /* words */
  #define ATMEL_LCDC_FIFO_SIZE          512     /* words */
  
+ struct atmel_lcdfb_config {
+       bool have_alt_pixclock;
+       bool have_hozval;
+       bool have_intensity_bit;
+ };
+ static struct atmel_lcdfb_config at91sam9261_config = {
+       .have_hozval            = true,
+       .have_intensity_bit     = true,
+ };
+ static struct atmel_lcdfb_config at91sam9263_config = {
+       .have_intensity_bit     = true,
+ };
+ static struct atmel_lcdfb_config at91sam9g10_config = {
+       .have_hozval            = true,
+ };
+ static struct atmel_lcdfb_config at91sam9g45_config = {
+       .have_alt_pixclock      = true,
+ };
+ static struct atmel_lcdfb_config at91sam9g45es_config = {
+ };
+ static struct atmel_lcdfb_config at91sam9rl_config = {
+       .have_intensity_bit     = true,
+ };
+ static struct atmel_lcdfb_config at32ap_config = {
+       .have_hozval            = true,
+ };
+ static const struct platform_device_id atmel_lcdfb_devtypes[] = {
+       {
+               .name = "at91sam9261-lcdfb",
+               .driver_data = (unsigned long)&at91sam9261_config,
+       }, {
+               .name = "at91sam9263-lcdfb",
+               .driver_data = (unsigned long)&at91sam9263_config,
+       }, {
+               .name = "at91sam9g10-lcdfb",
+               .driver_data = (unsigned long)&at91sam9g10_config,
+       }, {
+               .name = "at91sam9g45-lcdfb",
+               .driver_data = (unsigned long)&at91sam9g45_config,
+       }, {
+               .name = "at91sam9g45es-lcdfb",
+               .driver_data = (unsigned long)&at91sam9g45es_config,
+       }, {
+               .name = "at91sam9rl-lcdfb",
+               .driver_data = (unsigned long)&at91sam9rl_config,
+       }, {
+               .name = "at32ap-lcdfb",
+               .driver_data = (unsigned long)&at32ap_config,
+       }, {
+               /* terminator */
+       }
+ };
+ static struct atmel_lcdfb_config *
+ atmel_lcdfb_get_config(struct platform_device *pdev)
+ {
+       unsigned long data;
+       data = platform_get_device_id(pdev)->driver_data;
+       return (struct atmel_lcdfb_config *)data;
+ }
  #if defined(CONFIG_ARCH_AT91)
  #define       ATMEL_LCDFB_FBINFO_DEFAULT      (FBINFO_DEFAULT \
                                         | FBINFO_PARTIAL_PAN_OK \
@@@ -193,14 -264,16 +264,16 @@@ static struct fb_fix_screeninfo atmel_l
        .accel          = FB_ACCEL_NONE,
  };
  
- static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
+ static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo,
+                                                       unsigned long xres)
  {
+       unsigned long lcdcon2;
        unsigned long value;
  
-       if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10()
-               || cpu_is_at32ap7000()))
+       if (!sinfo->config->have_hozval)
                return xres;
  
+       lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2);
        value = xres;
        if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) {
                /* STN display */
@@@ -423,7 -496,7 +496,7 @@@ static int atmel_lcdfb_check_var(struc
                break;
        case 16:
                /* Older SOCs use IBGR:555 rather than BGR:565. */
-               if (sinfo->have_intensity_bit)
+               if (sinfo->config->have_intensity_bit)
                        var->green.length = 5;
                else
                        var->green.length = 6;
@@@ -531,7 -604,7 +604,7 @@@ static int atmel_lcdfb_set_par(struct f
        /* Now, the LCDC core... */
  
        /* Set pixel clock */
-       if (cpu_is_at91sam9g45() && !cpu_is_at91sam9g45es())
+       if (sinfo->config->have_alt_pixclock)
                pix_factor = 1;
  
        clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
        lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value);
  
        /* Horizontal value (aka line size) */
-       hozval_linesz = compute_hozval(info->var.xres,
-                                       lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2));
+       hozval_linesz = compute_hozval(sinfo, info->var.xres);
  
        /* Display size */
        value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET;
@@@ -684,7 -756,7 +756,7 @@@ static int atmel_lcdfb_setcolreg(unsign
  
        case FB_VISUAL_PSEUDOCOLOR:
                if (regno < 256) {
-                       if (sinfo->have_intensity_bit) {
+                       if (sinfo->config->have_intensity_bit) {
                                /* old style I+BGR:555 */
                                val  = ((red   >> 11) & 0x001f);
                                val |= ((green >>  6) & 0x03e0);
@@@ -821,15 -893,13 +893,13 @@@ static int __init atmel_lcdfb_init_fbin
  
  static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
  {
-       if (sinfo->bus_clk)
-               clk_enable(sinfo->bus_clk);
+       clk_enable(sinfo->bus_clk);
        clk_enable(sinfo->lcdc_clk);
  }
  
  static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
  {
-       if (sinfo->bus_clk)
-               clk_disable(sinfo->bus_clk);
+       clk_disable(sinfo->bus_clk);
        clk_disable(sinfo->lcdc_clk);
  }
  
@@@ -874,10 -944,9 +944,9 @@@ static int __init atmel_lcdfb_probe(str
        }
        sinfo->info = info;
        sinfo->pdev = pdev;
-       if (cpu_is_at91sam9261() || cpu_is_at91sam9263() ||
-                                                       cpu_is_at91sam9rl()) {
-               sinfo->have_intensity_bit = true;
-       }
+       sinfo->config = atmel_lcdfb_get_config(pdev);
+       if (!sinfo->config)
+               goto free_info;
  
        strcpy(info->fix.id, sinfo->pdev->name);
        info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
        info->fix = atmel_lcdfb_fix;
  
        /* Enable LCDC Clocks */
-       if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()
-        || cpu_is_at32ap7000()) {
-               sinfo->bus_clk = clk_get(dev, "hck1");
-               if (IS_ERR(sinfo->bus_clk)) {
-                       ret = PTR_ERR(sinfo->bus_clk);
-                       goto free_info;
-               }
+       sinfo->bus_clk = clk_get(dev, "hclk");
+       if (IS_ERR(sinfo->bus_clk)) {
+               ret = PTR_ERR(sinfo->bus_clk);
+               goto free_info;
        }
        sinfo->lcdc_clk = clk_get(dev, "lcdc_clk");
        if (IS_ERR(sinfo->lcdc_clk)) {
@@@ -1055,8 -1121,7 +1121,7 @@@ stop_clk
        atmel_lcdfb_stop_clock(sinfo);
        clk_put(sinfo->lcdc_clk);
  put_bus_clk:
-       if (sinfo->bus_clk)
-               clk_put(sinfo->bus_clk);
+       clk_put(sinfo->bus_clk);
  free_info:
        framebuffer_release(info);
  out:
@@@ -1081,8 -1146,7 +1146,7 @@@ static int __exit atmel_lcdfb_remove(st
        unregister_framebuffer(info);
        atmel_lcdfb_stop_clock(sinfo);
        clk_put(sinfo->lcdc_clk);
-       if (sinfo->bus_clk)
-               clk_put(sinfo->bus_clk);
+       clk_put(sinfo->bus_clk);
        fb_dealloc_cmap(&info->cmap);
        free_irq(sinfo->irq_base, info);
        iounmap(sinfo->mmio);
@@@ -1151,14 -1215,25 +1215,14 @@@ static struct platform_driver atmel_lcd
        .remove         = __exit_p(atmel_lcdfb_remove),
        .suspend        = atmel_lcdfb_suspend,
        .resume         = atmel_lcdfb_resume,
+       .id_table       = atmel_lcdfb_devtypes,
        .driver         = {
                .name   = "atmel_lcdfb",
                .owner  = THIS_MODULE,
        },
  };
  
 -static int __init atmel_lcdfb_init(void)
 -{
 -      return platform_driver_probe(&atmel_lcdfb_driver, atmel_lcdfb_probe);
 -}
 -
 -static void __exit atmel_lcdfb_exit(void)
 -{
 -      platform_driver_unregister(&atmel_lcdfb_driver);
 -}
 -
 -module_init(atmel_lcdfb_init);
 -module_exit(atmel_lcdfb_exit);
 +module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe);
  
  MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver");
  MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>");
diff --combined include/linux/of.h
index 2d25ff8fe39aad527cfb1ab2c3a8287a62a32e70,c0747a44eafffad720fe4e625866cdb6639b8cf7..fb2002f3c7dc5c2487632aae4719fdf1548cc7d3
@@@ -235,6 -235,9 +235,9 @@@ extern struct device_node *of_find_node
  extern struct property *of_find_property(const struct device_node *np,
                                         const char *name,
                                         int *lenp);
+ extern int of_property_read_u32_index(const struct device_node *np,
+                                      const char *propname,
+                                      u32 index, u32 *out_value);
  extern int of_property_read_u8_array(const struct device_node *np,
                        const char *propname, u8 *out_values, size_t sz);
  extern int of_property_read_u16_array(const struct device_node *np,
@@@ -394,6 -397,12 +397,12 @@@ static inline struct device_node *of_fi
        return NULL;
  }
  
+ static inline int of_property_read_u32_index(const struct device_node *np,
+                       const char *propname, u32 index, u32 *out_value)
+ {
+       return -ENOSYS;
+ }
  static inline int of_property_read_u8_array(const struct device_node *np,
                        const char *propname, u8 *out_values, size_t sz)
  {
@@@ -540,14 -549,4 +549,14 @@@ static inline int of_property_read_u32(
        return of_property_read_u32_array(np, propname, out_value, 1);
  }
  
 +#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
 +extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
 +extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
 +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde,
 +                                       struct property *prop);
 +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde,
 +                                       struct property *newprop,
 +                                       struct property *oldprop);
 +#endif
 +
  #endif /* _LINUX_OF_H */