Merge tag 'boards-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 May 2013 19:34:30 +0000 (12:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 May 2013 19:34:30 +0000 (12:34 -0700)
Pull ARM SoC board specific changes (part 1) from Olof Johansson:
 "These changes are all for board specific files.  These used to make up
  a large portion of the ARM changes in the past, but as we are
  generalizing the support and moving to device tree probing, this has
  gotten significantly smaller.

  The only platform actually adding new code here at the moment is
  Renesas shmobile, as they are still busy converting their code to
  device tree and have not come far enough to not need it."

* tag 'boards-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (43 commits)
  ARM: msm: USB_MSM_OTG needs USB_PHY
  ARM: davinci: da850 evm: fix const qualifier placement
  ARM: davinci: da850 board: add remoteproc support
  ARM: pxa: move debug uart code
  ARM: pxa: select PXA935 on saar & tavorevb
  ARM: mmp: add more compatible names in gpio driver
  ARM: pxa: move PXA_GPIO_TO_IRQ macro
  ARM: pxa: remove cpu_is_xxx in gpio driver
  ARM: Kirkwood: update Network Space Mini v2 description
  ARM: Kirkwood: DT board setup for CloudBox
  ARM: Kirkwood: sort board entries by ASCII-code order
  ARM: OMAP: board-4430sdp: Provide regulator to pwm-backlight
  ARM: OMAP: zoom: Use pwm stack for lcd and keyboard backlight
  ARM: OMAP2+: omap2plus_defconfig: Add support for BMP085 pressure sensor
  omap2+: Remove useless Makefile line
  omap2+: Remove useless Makefile line
  ARM: OMAP: RX-51: add missing regulator supply definitions for lis3lv02d
  ARM: OMAP1: fix omap_udc registration
  ARM: davinci: use is IS_ENABLED macro
  ARM: kirkwood: add MACH_GURUPLUG_DT to defconfig
  ...

12 files changed:
1  2 
arch/arm/Kconfig.debug
arch/arm/boot/dts/Makefile
arch/arm/configs/kirkwood_defconfig
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-mackerel.c
drivers/gpio/gpio-pxa.c

diff --combined arch/arm/Kconfig.debug
@@@ -89,10 -89,6 +89,10 @@@ choic
                bool "Kernel low-level debugging on 9263 and 9g45"
                depends on HAVE_AT91_DBGU1
  
 +      config DEBUG_BCM2835
 +              bool "Kernel low-level debugging on BCM2835 PL011 UART"
 +              depends on ARCH_BCM2835
 +
        config DEBUG_CLPS711X_UART1
                bool "Kernel low-level debugging messages via UART1"
                depends on ARCH_CLPS711X
                  Say Y here if you want the debug print routines to direct
                  their output to the second serial port on these devices.
  
 +      config DEBUG_CNS3XXX
 +              bool "Kernel Kernel low-level debugging on Cavium Networks CNS3xxx"
 +              depends on ARCH_CNS3XXX
 +              help
 +                Say Y here if you want the debug print routines to direct
 +                  their output to the CNS3xxx UART0.
 +
        config DEBUG_DAVINCI_DA8XX_UART1
                bool "Kernel low-level debugging on DaVinci DA8XX using UART1"
                depends on ARCH_DAVINCI_DA8XX
                  Say Y here if you want kernel low-level debugging support
                  on MVEBU based platforms.
  
 +      config DEBUG_NOMADIK_UART
 +              bool "Kernel low-level debugging messages via NOMADIK UART"
 +              depends on ARCH_NOMADIK
 +              help
 +                Say Y here if you want kernel low-level debugging support
 +                on NOMADIK based platforms.
 +
        config DEBUG_OMAP2PLUS_UART
                bool "Kernel low-level debugging messages via OMAP2PLUS UART"
                depends on ARCH_OMAP2PLUS
                  Say Y here if you want kernel low-level debugging support
                  on PicoXcell based platforms.
  
+       config DEBUG_PXA_UART1
+               depends on ARCH_PXA
+               bool "Use PXA UART1 for low-level debug"
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on PXA UART1.
        config DEBUG_REALVIEW_STD_PORT
                bool "RealView Default UART"
                depends on ARCH_REALVIEW
  
        config DEBUG_S3C_UART0
                depends on PLAT_SAMSUNG
 +              select DEBUG_EXYNOS_UART if ARCH_EXYNOS
                bool "Use S3C UART 0 for low-level debug"
                help
                  Say Y here if you want the debug print routines to direct
  
        config DEBUG_S3C_UART1
                depends on PLAT_SAMSUNG
 +              select DEBUG_EXYNOS_UART if ARCH_EXYNOS
                bool "Use S3C UART 1 for low-level debug"
                help
                  Say Y here if you want the debug print routines to direct
  
        config DEBUG_S3C_UART2
                depends on PLAT_SAMSUNG
 +              select DEBUG_EXYNOS_UART if ARCH_EXYNOS
                bool "Use S3C UART 2 for low-level debug"
                help
                  Say Y here if you want the debug print routines to direct
  
        config DEBUG_S3C_UART3
                depends on PLAT_SAMSUNG && ARCH_EXYNOS
 +              select DEBUG_EXYNOS_UART
                bool "Use S3C UART 3 for low-level debug"
                help
                  Say Y here if you want the debug print routines to direct
                  Say Y here if you want the debug print routines to direct
                  their output to the uart1 port on SiRFmarco devices.
  
 +      config DEBUG_UX500_UART
 +              depends on ARCH_U8500
 +              bool "Use Ux500 UART for low-level debug"
 +              help
 +                Say Y here if you want kernel low-level debugging support
 +                on Ux500 based platforms.
 +
        config DEBUG_VEXPRESS_UART0_DETECT
                bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
                depends on ARCH_VEXPRESS && CPU_CP15_MMU
  
  endchoice
  
 +config DEBUG_EXYNOS_UART
 +      bool
 +
  config DEBUG_IMX_UART_PORT
        int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
                                                DEBUG_IMX25_UART || \
@@@ -612,9 -587,6 +619,10 @@@ endchoic
  
  config DEBUG_LL_INCLUDE
        string
 +      default "debug/bcm2835.S" if DEBUG_BCM2835
 +      default "debug/cns3xxx.S" if DEBUG_CNS3XXX
 +      default "debug/exynos.S" if DEBUG_EXYNOS_UART
++      default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/icedcc.S" if DEBUG_ICEDCC
        default "debug/imx.S" if DEBUG_IMX1_UART || \
                                 DEBUG_IMX25_UART || \
                                 DEBUG_IMX51_UART || \
                                 DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART
--      default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/mvebu.S" if DEBUG_MVEBU_UART
 +      default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
 +      default "debug/nomadik.S" if DEBUG_NOMADIK_UART
        default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
        default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
+       default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
+                                DEBUG_MMP_UART3
 +      default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
        default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
        default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
++      default "debug/tegra.S" if DEBUG_TEGRA_UART
++      default "debug/ux500.S" if DEBUG_UX500_UART
        default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
                DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
        default "debug/vt8500.S" if DEBUG_VT8500_UART0
--      default "debug/tegra.S" if DEBUG_TEGRA_UART
-       default "debug/ux500.S" if DEBUG_UX500_UART
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
  
 +config DEBUG_UNCOMPRESS
 +      bool
 +      default y if ARCH_MULTIPLATFORM && DEBUG_LL && \
 +                   !DEBUG_OMAP2PLUS_UART && \
 +                   !DEBUG_TEGRA_UART
 +
 +config UNCOMPRESS_INCLUDE
 +      string
 +      default "debug/uncompress.h" if ARCH_MULTIPLATFORM
 +      default "mach/uncompress.h"
 +
  config EARLY_PRINTK
        bool "Early printk"
        depends on DEBUG_LL
@@@ -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,10 -42,7 +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
@@@ -61,7 -51,8 +61,8 @@@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank
  dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
        integratorcp.dtb
  dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
- dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
+ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
+       kirkwood-dns320.dtb \
        kirkwood-dns325.dtb \
        kirkwood-dockstar.dtb \
        kirkwood-dreamplug.dtb \
@@@ -75,6 -66,7 +76,7 @@@
        kirkwood-lschlv2.dtb \
        kirkwood-lsxhl.dtb \
        kirkwood-mplcec4.dtb \
+       kirkwood-netgear_readynas_duo_v2.dtb \
        kirkwood-ns2.dtb \
        kirkwood-ns2lite.dtb \
        kirkwood-ns2max.dtb \
@@@ -97,26 -89,19 +99,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 \
@@@ -153,7 -138,9 +155,9 @@@ dtb-$(CONFIG_ARCH_U8500) += snowball.dt
        ccu9540.dtb
  dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
        r8a7740-armadillo800eva.dtb \
+       r8a7779-marzen-reference.dtb \
        sh73a0-kzm9g.dtb \
+       sh73a0-kzm9g-reference.dtb \
        sh7372-mackerel.dtb
  dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
        socfpga_vt.dtb
@@@ -10,45 -10,48 +10,48 @@@ CONFIG_MODULES=
  CONFIG_MODULE_UNLOAD=y
  # CONFIG_BLK_DEV_BSG is not set
  CONFIG_ARCH_KIRKWOOD=y
+ CONFIG_MACH_D2NET_V2=y
  CONFIG_MACH_DB88F6281_BP=y
+ CONFIG_MACH_DOCKSTAR=y
+ CONFIG_MACH_ESATA_SHEEVAPLUG=y
+ CONFIG_MACH_GURUPLUG=y
+ CONFIG_MACH_INETSPACE_V2=y
+ CONFIG_MACH_MV88F6281GTW_GE=y
+ CONFIG_MACH_NET2BIG_V2=y
+ CONFIG_MACH_NET5BIG_V2=y
+ CONFIG_MACH_NETSPACE_MAX_V2=y
+ CONFIG_MACH_NETSPACE_V2=y
+ CONFIG_MACH_OPENRD_BASE=y
+ CONFIG_MACH_OPENRD_CLIENT=y
+ CONFIG_MACH_OPENRD_ULTIMATE=y
  CONFIG_MACH_RD88F6192_NAS=y
  CONFIG_MACH_RD88F6281=y
- CONFIG_MACH_MV88F6281GTW_GE=y
  CONFIG_MACH_SHEEVAPLUG=y
- CONFIG_MACH_ESATA_SHEEVAPLUG=y
- CONFIG_MACH_GURUPLUG=y
- CONFIG_MACH_DREAMPLUG_DT=y
- CONFIG_MACH_ICONNECT_DT=y
+ CONFIG_MACH_T5325=y
+ CONFIG_MACH_TS219=y
+ CONFIG_MACH_TS41X=y
+ CONFIG_MACH_CLOUDBOX_DT=y
  CONFIG_MACH_DLINK_KIRKWOOD_DT=y
- CONFIG_MACH_IB62X0_DT=y
- CONFIG_MACH_TS219_DT=y
  CONFIG_MACH_DOCKSTAR_DT=y
+ CONFIG_MACH_DREAMPLUG_DT=y
  CONFIG_MACH_GOFLEXNET_DT=y
- CONFIG_MACH_LSXL_DT=y
+ CONFIG_MACH_GURUPLUG_DT=y
+ CONFIG_MACH_IB62X0_DT=y
+ CONFIG_MACH_ICONNECT_DT=y
+ CONFIG_MACH_INETSPACE_V2_DT=y
  CONFIG_MACH_IOMEGA_IX2_200_DT=y
  CONFIG_MACH_KM_KIRKWOOD_DT=y
- CONFIG_MACH_INETSPACE_V2_DT=y
+ CONFIG_MACH_LSXL_DT=y
  CONFIG_MACH_MPLCEC4_DT=y
- CONFIG_MACH_NETSPACE_V2_DT=y
- CONFIG_MACH_NETSPACE_MAX_V2_DT=y
  CONFIG_MACH_NETSPACE_LITE_V2_DT=y
+ CONFIG_MACH_NETSPACE_MAX_V2_DT=y
  CONFIG_MACH_NETSPACE_MINI_V2_DT=y
+ CONFIG_MACH_NETSPACE_V2_DT=y
+ CONFIG_MACH_NSA310_DT=y
  CONFIG_MACH_OPENBLOCKS_A6_DT=y
+ CONFIG_MACH_READYNAS_DT=y
  CONFIG_MACH_TOPKICK_DT=y
- CONFIG_MACH_TS219=y
- CONFIG_MACH_TS41X=y
- CONFIG_MACH_DOCKSTAR=y
- CONFIG_MACH_OPENRD_BASE=y
- CONFIG_MACH_OPENRD_CLIENT=y
- CONFIG_MACH_OPENRD_ULTIMATE=y
- CONFIG_MACH_NETSPACE_V2=y
- CONFIG_MACH_INETSPACE_V2=y
- CONFIG_MACH_NETSPACE_MAX_V2=y
- CONFIG_MACH_D2NET_V2=y
- CONFIG_MACH_NET2BIG_V2=y
- CONFIG_MACH_NET5BIG_V2=y
- CONFIG_MACH_T5325=y
- CONFIG_MACH_NSA310_DT=y
+ CONFIG_MACH_TS219_DT=y
  # CONFIG_CPU_FEROCEON_OLD_ID is not set
  CONFIG_PREEMPT=y
  CONFIG_AEABI=y
@@@ -56,6 -59,7 +59,6 @@@
  CONFIG_ZBOOT_ROM_TEXT=0x0
  CONFIG_ZBOOT_ROM_BSS=0x0
  CONFIG_CPU_IDLE=y
 -CONFIG_CPU_IDLE_KIRKWOOD=y
  CONFIG_NET=y
  CONFIG_PACKET=y
  CONFIG_UNIX=y
@@@ -118,8 -122,6 +121,8 @@@ CONFIG_SPI=
  CONFIG_SPI_ORION=y
  CONFIG_GPIO_SYSFS=y
  # CONFIG_HWMON is not set
 +CONFIG_THERMAL=y
 +CONFIG_KIRKWOOD_THERMAL=y
  CONFIG_WATCHDOG=y
  CONFIG_ORION_WATCHDOG=y
  CONFIG_HID_DRAGONRISE=y
@@@ -621,7 -621,7 +621,7 @@@ static struct vpbe_enc_mode_info dm644x
        {
                .name           = "ntsc",
                .timings_type   = VPBE_ENC_STD,
 -              .std_id         = V4L2_STD_525_60,
 +              .std_id         = V4L2_STD_NTSC,
                .interlaced     = 1,
                .xres           = 720,
                .yres           = 480,
        {
                .name           = "pal",
                .timings_type   = VPBE_ENC_STD,
 -              .std_id         = V4L2_STD_625_50,
 +              .std_id         = V4L2_STD_PAL,
                .interlaced     = 1,
                .xres           = 720,
                .yres           = 576,
  static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
        {
                .name           = "480p59_94",
 -              .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
                .dv_timings     = V4L2_DV_BT_CEA_720X480P59_94,
                .interlaced     = 0,
                .xres           = 720,
        },
        {
                .name           = "576p50",
 -              .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
                .dv_timings     = V4L2_DV_BT_CEA_720X576P50,
                .interlaced     = 0,
                .xres           = 720,
@@@ -749,26 -749,11 +749,11 @@@ static int davinci_phy_fixup(struct phy
        return 0;
  }
  
- #if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
-     defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
- #define HAS_ATA 1
- #else
- #define HAS_ATA 0
- #endif
- #if defined(CONFIG_MTD_PHYSMAP) || \
-     defined(CONFIG_MTD_PHYSMAP_MODULE)
- #define HAS_NOR 1
- #else
- #define HAS_NOR 0
- #endif
- #if defined(CONFIG_MTD_NAND_DAVINCI) || \
-     defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
- #define HAS_NAND 1
- #else
- #define HAS_NAND 0
- #endif
+ #define HAS_ATA               IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710)
+ #define HAS_NOR               IS_ENABLED(CONFIG_MTD_PHYSMAP)
+ #define HAS_NAND      IS_ENABLED(CONFIG_MTD_NAND_DAVINCI)
  
  static __init void davinci_evm_init(void)
  {
@@@ -117,12 -117,7 +117,7 @@@ static struct platform_device davinci_n
        },
  };
  
- #if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
-     defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
- #define HAS_ATA 1
- #else
- #define HAS_ATA 0
- #endif
+ #define HAS_ATA               IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710)
  
  /* CPLD Register 0 bits to control ATA */
  #define DM646X_EVM_ATA_RST            BIT(0)
@@@ -514,7 -509,7 +509,7 @@@ static const struct vpif_output dm6467_
                        .index = 1,
                        .name = "Component",
                        .type = V4L2_OUTPUT_TYPE_ANALOG,
 -                      .capabilities = V4L2_OUT_CAP_CUSTOM_TIMINGS,
 +                      .capabilities = V4L2_OUT_CAP_DV_TIMINGS,
                },
                .subdev_name = "adv7343",
                .output_route = ADV7343_COMPONENT_ID,
@@@ -9,6 -9,7 +9,7 @@@
   *  publishhed by the Free Software Foundation.
   */
  #include <linux/gpio.h>
+ #include <linux/gpio-pxa.h>
  #include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/platform_device.h>
@@@ -110,6 -111,10 +111,10 @@@ static unsigned long common_pin_config[
        GPIO121_KP_MKIN4,
  };
  
+ static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
+       .irq_base       = MMP_GPIO_TO_IRQ(0),
+ };
  static struct smc91x_platdata smc91x_info = {
        .flags  = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  };
@@@ -223,7 -228,13 +228,7 @@@ static struct pxa27x_keypad_platform_da
  };
  
  #if defined(CONFIG_USB_EHCI_MV)
 -static char *pxa168_sph_clock_name[] = {
 -      [0] = "PXA168-USBCLK",
 -};
 -
  static struct mv_usb_platform_data pxa168_sph_pdata = {
 -      .clknum         = 1,
 -      .clkname        = pxa168_sph_clock_name,
        .mode           = MV_USB_MODE_HOST,
        .phy_init       = pxa_usb_phy_init,
        .phy_deinit     = pxa_usb_phy_deinit,
@@@ -242,6 -253,8 +247,8 @@@ static void __init common_init(void
        pxa168_add_nand(&aspenite_nand_info);
        pxa168_add_fb(&aspenite_lcd_info);
        pxa168_add_keypad(&aspenite_keypad_info);
+       platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
+                                sizeof(struct pxa_gpio_platform_data));
        platform_device_register(&pxa168_device_gpio);
  
        /* off-chip devices */
@@@ -17,6 -17,7 +17,7 @@@
  #include <linux/interrupt.h>
  #include <linux/i2c/pca953x.h>
  #include <linux/gpio.h>
+ #include <linux/gpio-pxa.h>
  #include <linux/mfd/88pm860x.h>
  #include <linux/platform_data/mv_usb.h>
  #include <linux/spi/spi.h>
@@@ -75,6 -76,10 +76,10 @@@ static unsigned long ttc_dkb_pin_config
        DF_RDY0_DF_RDY0,
  };
  
+ static struct pxa_gpio_platform_data pxa910_gpio_pdata = {
+       .irq_base       = MMP_GPIO_TO_IRQ(0),
+ };
  static struct mtd_partition ttc_dkb_onenand_partitions[] = {
        {
                .name           = "bootloader",
@@@ -162,7 -167,13 +167,7 @@@ static struct i2c_board_info ttc_dkb_i2
  #ifdef CONFIG_USB_SUPPORT
  #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
  
 -static char *pxa910_usb_clock_name[] = {
 -      [0] = "U2OCLK",
 -};
 -
  static struct mv_usb_platform_data ttc_usb_pdata = {
 -      .clknum         = 1,
 -      .clkname        = pxa910_usb_clock_name,
        .vbus           = NULL,
        .mode           = MV_USB_MODE_OTG,
        .otg_force_a_bus_req = 1,
@@@ -278,6 -289,8 +283,8 @@@ static void __init ttc_dkb_init(void
  
        /* off-chip devices */
        pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
+       platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata,
+                                sizeof(struct pxa_gpio_platform_data));
        platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
  
  #ifdef CONFIG_USB_MV_UDC
@@@ -16,7 -16,6 +16,7 @@@ config ARCH_SH73A
        select CPU_V7
        select I2C
        select SH_CLK_CPG
 +      select RENESAS_INTC_IRQPIN
  
  config ARCH_R8A7740
        bool "R-Mobile A1 (R8A77400)"
@@@ -32,7 -31,6 +32,7 @@@ config ARCH_R8A777
        select SH_CLK_CPG
        select USB_ARCH_HAS_EHCI
        select USB_ARCH_HAS_OHCI
 +      select RENESAS_INTC_IRQPIN
  
  config ARCH_EMEV2
        bool "Emma Mobile EV2"
@@@ -104,6 -102,19 +104,19 @@@ config MACH_MARZE
        select ARCH_REQUIRE_GPIOLIB
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
  
+ config MACH_MARZEN_REFERENCE
+       bool "MARZEN board - Reference Device Tree Implementation"
+       depends on ARCH_R8A7779
+       select ARCH_REQUIRE_GPIOLIB
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select USE_OF
+       ---help---
+          Use reference implementation of Marzen board support
+          which makes use of device tree at the expense
+          of not supporting a number of devices.
+          This is intended to aid developers
  config MACH_KZM9D
        bool "KZM9D board"
        depends on ARCH_EMEV2
@@@ -118,6 -129,20 +131,20 @@@ config MACH_KZM9
        select SND_SOC_AK4642 if SND_SIMPLE_CARD
        select USE_OF
  
+ config MACH_KZM9G_REFERENCE
+       bool "KZM-A9-GT board - Reference Device Tree Implementation"
+       depends on ARCH_SH73A0
+       select ARCH_REQUIRE_GPIOLIB
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select SND_SOC_AK4642 if SND_SIMPLE_CARD
+       select USE_OF
+       ---help---
+          Use reference implementation of KZM-A9-GT board support
+          which makes as greater use of device tree at the expense
+          of not supporting a number of devices.
+          This is intended to aid developers
  comment "SH-Mobile System Configuration"
  
  config CPU_HAS_INTEVT
  #include <linux/err.h>
  #include <linux/kernel.h>
  #include <linux/input.h>
 +#include <linux/platform_data/st1232_pdata.h>
  #include <linux/irq.h>
  #include <linux/platform_device.h>
  #include <linux/gpio.h>
  #include <linux/gpio_keys.h>
+ #include <linux/regulator/driver.h>
  #include <linux/pinctrl/machine.h>
  #include <linux/regulator/fixed.h>
+ #include <linux/regulator/gpio-regulator.h>
  #include <linux/regulator/machine.h>
  #include <linux/sh_eth.h>
  #include <linux/videodev2.h>
@@@ -171,7 -172,7 +173,7 @@@ static int usbhsf_get_id(struct platfor
        return USBHS_GADGET;
  }
  
 -static void usbhsf_power_ctrl(struct platform_device *pdev,
 +static int usbhsf_power_ctrl(struct platform_device *pdev,
                              void __iomem *base, int enable)
  {
        struct usbhsf_private *priv = usbhsf_get_priv(pdev);
                clk_disable(priv->pci);         /* usb work around */
                clk_disable(priv->usb24);       /* usb work around */
        }
 +
 +      return 0;
  }
  
  static int usbhsf_get_vbus(struct platform_device *pdev)
@@@ -243,7 -242,7 +245,7 @@@ static irqreturn_t usbhsf_interrupt(in
        return IRQ_HANDLED;
  }
  
 -static void usbhsf_hardware_exit(struct platform_device *pdev)
 +static int usbhsf_hardware_exit(struct platform_device *pdev)
  {
        struct usbhsf_private *priv = usbhsf_get_priv(pdev);
  
        priv->usbh_base = NULL;
  
        free_irq(IRQ7, pdev);
 +
 +      return 0;
  }
  
  static int usbhsf_hardware_init(struct platform_device *pdev)
@@@ -560,15 -557,119 +562,119 @@@ static struct platform_device gpio_keys
        },
  };
  
- /* Fixed 3.3V regulator to be used by SDHI0, SDHI1, MMCIF */
- static struct regulator_consumer_supply fixed3v3_power_consumers[] =
- {
+ /* Fixed 3.3V regulator to be used by SDHI1, MMCIF */
+ static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
+       REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
+       REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
+ };
+ /* Fixed 3.3V regulator to be used by SDHI0 */
+ static struct regulator_consumer_supply vcc_sdhi0_consumers[] = {
        REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
+ };
+ static struct regulator_init_data vcc_sdhi0_init_data = {
+       .constraints = {
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
+       .consumer_supplies      = vcc_sdhi0_consumers,
+ };
+ static struct fixed_voltage_config vcc_sdhi0_info = {
+       .supply_name = "SDHI0 Vcc",
+       .microvolts = 3300000,
+       .gpio = GPIO_PORT75,
+       .enable_high = 1,
+       .init_data = &vcc_sdhi0_init_data,
+ };
+ static struct platform_device vcc_sdhi0 = {
+       .name = "reg-fixed-voltage",
+       .id   = 1,
+       .dev  = {
+               .platform_data = &vcc_sdhi0_info,
+       },
+ };
+ /* 1.8 / 3.3V SDHI0 VccQ regulator */
+ static struct regulator_consumer_supply vccq_sdhi0_consumers[] = {
        REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+ };
+ static struct regulator_init_data vccq_sdhi0_init_data = {
+       .constraints = {
+               .input_uV       = 3300000,
+               .min_uV         = 1800000,
+               .max_uV         = 3300000,
+               .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+                                 REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(vccq_sdhi0_consumers),
+       .consumer_supplies      = vccq_sdhi0_consumers,
+ };
+ static struct gpio vccq_sdhi0_gpios[] = {
+       {GPIO_PORT17, GPIOF_OUT_INIT_LOW, "vccq-sdhi0" },
+ };
+ static struct gpio_regulator_state vccq_sdhi0_states[] = {
+       { .value = 3300000, .gpios = (0 << 0) },
+       { .value = 1800000, .gpios = (1 << 0) },
+ };
+ static struct gpio_regulator_config vccq_sdhi0_info = {
+       .supply_name = "vqmmc",
+       .enable_gpio = GPIO_PORT74,
+       .enable_high = 1,
+       .enabled_at_boot = 0,
+       .gpios = vccq_sdhi0_gpios,
+       .nr_gpios = ARRAY_SIZE(vccq_sdhi0_gpios),
+       .states = vccq_sdhi0_states,
+       .nr_states = ARRAY_SIZE(vccq_sdhi0_states),
+       .type = REGULATOR_VOLTAGE,
+       .init_data = &vccq_sdhi0_init_data,
+ };
+ static struct platform_device vccq_sdhi0 = {
+       .name = "gpio-regulator",
+       .id   = -1,
+       .dev  = {
+               .platform_data = &vccq_sdhi0_info,
+       },
+ };
+ /* Fixed 3.3V regulator to be used by SDHI1 */
+ static struct regulator_consumer_supply vcc_sdhi1_consumers[] = {
        REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
-       REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
-       REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
-       REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
+ };
+ static struct regulator_init_data vcc_sdhi1_init_data = {
+       .constraints = {
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi1_consumers),
+       .consumer_supplies      = vcc_sdhi1_consumers,
+ };
+ static struct fixed_voltage_config vcc_sdhi1_info = {
+       .supply_name = "SDHI1 Vcc",
+       .microvolts = 3300000,
+       .gpio = GPIO_PORT16,
+       .enable_high = 1,
+       .init_data = &vcc_sdhi1_init_data,
+ };
+ static struct platform_device vcc_sdhi1 = {
+       .name = "reg-fixed-voltage",
+       .id   = 2,
+       .dev  = {
+               .platform_data = &vcc_sdhi1_info,
+       },
  };
  
  /* SDHI0 */
  static struct sh_mobile_sdhi_info sdhi0_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
-       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
-                         MMC_CAP_NEEDS_POLL,
-       .tmio_ocr_mask  = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+                         MMC_CAP_POWER_OFF_CARD,
+       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+       .cd_gpio        = GPIO_PORT167,
  };
  
  static struct resource sdhi0_resources[] = {
@@@ -626,9 -727,11 +732,11 @@@ static struct platform_device sdhi0_dev
  static struct sh_mobile_sdhi_info sdhi1_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI1_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI1_RX,
-       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-       .tmio_ocr_mask  = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+                         MMC_CAP_POWER_OFF_CARD,
+       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+       /* Port72 cannot generate IRQs, will be used in polling mode. */
+       .cd_gpio        = GPIO_PORT72,
  };
  
  static struct resource sdhi1_resources[] = {
@@@ -676,7 -779,6 +784,6 @@@ static const struct pinctrl_map eva_sdh
  /* MMCIF */
  static struct sh_mmcif_plat_data sh_mmcif_plat = {
        .sup_pclk       = 0,
-       .ocr            = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
        .caps           = MMC_CAP_4_BIT_DATA |
                          MMC_CAP_8_BIT_DATA |
                          MMC_CAP_NONREMOVABLE,
@@@ -895,15 -997,10 +1002,15 @@@ static struct platform_device i2c_gpio_
  };
  
  /* I2C */
 +static struct st1232_pdata st1232_i2c0_pdata = {
 +      .reset_gpio = 166,
 +};
 +
  static struct i2c_board_info i2c0_devices[] = {
        {
                I2C_BOARD_INFO("st1232-ts", 0x55),
                .irq = evt2irq(0x0340),
 +              .platform_data = &st1232_i2c0_pdata,
        },
        {
                I2C_BOARD_INFO("wm8978", 0x1a),
@@@ -924,6 -1021,8 +1031,8 @@@ static struct platform_device *eva_devi
        &lcdc0_device,
        &gpio_keys_device,
        &sh_eth_device,
+       &vcc_sdhi0,
+       &vccq_sdhi0,
        &sdhi0_device,
        &sh_mmcif_device,
        &hdmi_device,
@@@ -1022,6 -1121,7 +1131,6 @@@ static void __init eva_init(void
  
        /* Touchscreen */
        gpio_request(GPIO_FN_IRQ10,     NULL); /* TP_INT */
 -      gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
  
        /* GETHER */
        gpio_request(GPIO_FN_ET_CRS,            NULL);
                usb = &usbhsf_device;
        }
  
-       /* SDHI0 */
-       gpio_request_one(17, GPIOF_OUT_INIT_LOW, NULL);  /* SDHI0_18/33_B */
-       gpio_request_one(74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
-       gpio_request_one(75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
-       /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
        /* CEU0 */
        gpio_request(GPIO_FN_VIO0_D7,           NULL);
        gpio_request(GPIO_FN_VIO0_D6,           NULL);
                pinctrl_register_mappings(eva_sdhi1_pinctrl_map,
                                          ARRAY_SIZE(eva_sdhi1_pinctrl_map));
  
-               /* SDSLOT2_PON */
-               gpio_request_one(16, GPIOF_OUT_INIT_HIGH, NULL);
+               platform_device_register(&vcc_sdhi1);
                platform_device_register(&sdhi1_device);
        }
  
@@@ -63,8 -63,8 +63,8 @@@
  
  /* Dummy supplies, where voltage doesn't matter */
  static struct regulator_consumer_supply dummy_supplies[] = {
-       REGULATOR_SUPPLY("vddvario", "smsc911x"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x"),
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
  };
  
  /*
@@@ -83,7 -83,7 +83,7 @@@ static struct resource smsc9221_resourc
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0x260), /* IRQ3 */
 +              .start  = irq_pin(3), /* IRQ3 */
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -117,7 -117,7 +117,7 @@@ static struct resource usb_resources[] 
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0x220), /* IRQ1 */
 +              .start  = irq_pin(1), /* IRQ1 */
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -140,7 -140,7 +140,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)
@@@ -157,14 -157,12 +157,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)
@@@ -206,7 -204,7 +206,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[] = {
@@@ -379,13 -375,64 +379,64 @@@ static struct platform_device mmc_devic
        .resource       = sh_mmcif_resources,
  };
  
- /* Fixed 2.8V regulators to be used by SDHI0 and SDHI2 */
- static struct regulator_consumer_supply fixed2v8_power_consumers[] =
+ /* Fixed 3.3V regulators to be used by SDHI0 */
+ static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
  {
        REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
-       REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+ };
+ static struct regulator_init_data vcc_sdhi0_init_data = {
+       .constraints = {
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
+       .consumer_supplies      = vcc_sdhi0_consumers,
+ };
+ static struct fixed_voltage_config vcc_sdhi0_info = {
+       .supply_name = "SDHI0 Vcc",
+       .microvolts = 3300000,
+       .gpio = 15,
+       .enable_high = 1,
+       .init_data = &vcc_sdhi0_init_data,
+ };
+ static struct platform_device vcc_sdhi0 = {
+       .name = "reg-fixed-voltage",
+       .id   = 0,
+       .dev  = {
+               .platform_data = &vcc_sdhi0_info,
+       },
+ };
+ /* Fixed 3.3V regulators to be used by SDHI2 */
+ static struct regulator_consumer_supply vcc_sdhi2_consumers[] =
+ {
        REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"),
-       REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"),
+ };
+ static struct regulator_init_data vcc_sdhi2_init_data = {
+       .constraints = {
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi2_consumers),
+       .consumer_supplies      = vcc_sdhi2_consumers,
+ };
+ static struct fixed_voltage_config vcc_sdhi2_info = {
+       .supply_name = "SDHI2 Vcc",
+       .microvolts = 3300000,
+       .gpio = 14,
+       .enable_high = 1,
+       .init_data = &vcc_sdhi2_init_data,
+ };
+ static struct platform_device vcc_sdhi2 = {
+       .name = "reg-fixed-voltage",
+       .id   = 1,
+       .dev  = {
+               .platform_data = &vcc_sdhi2_info,
+       },
  };
  
  /* SDHI */
@@@ -393,8 -440,8 +444,8 @@@ static struct sh_mobile_sdhi_info sdhi0
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
        .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
-       .tmio_caps      = MMC_CAP_SD_HIGHSPEED,
-       .tmio_ocr_mask  = MMC_VDD_27_28 | MMC_VDD_28_29,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+                         MMC_CAP_POWER_OFF_CARD,
  };
  
  static struct resource sdhi0_resources[] = {
@@@ -437,8 -484,7 +488,7 @@@ static struct sh_mobile_sdhi_info sdhi2
        .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
                          TMIO_MMC_USE_GPIO_CD |
                          TMIO_MMC_WRPROTECT_DISABLE,
-       .tmio_caps      = MMC_CAP_SD_HIGHSPEED,
-       .tmio_ocr_mask  = MMC_VDD_27_28 | MMC_VDD_28_29,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_POWER_OFF_CARD,
        .cd_gpio        = 13,
  };
  
@@@ -569,25 -615,25 +619,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,
        },
  };
@@@ -598,6 -644,8 +648,8 @@@ static struct platform_device *kzm_devi
        &usbhs_device,
        &lcdc_device,
        &mmc_device,
+       &vcc_sdhi0,
+       &vcc_sdhi2,
        &sdhi0_device,
        &sdhi2_device,
        &gpio_keys_device,
@@@ -718,11 -766,9 +770,9 @@@ device_initcall(as3711_enable_lcdc_back
  
  static void __init kzm_init(void)
  {
-       regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
+       regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers,
                                     ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
-       regulator_register_always_on(1, "fixed-2.8V", fixed2v8_power_consumers,
-                                    ARRAY_SIZE(fixed2v8_power_consumers), 2800000);
-       regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
+       regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
  
        pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
  
  
        /* enable SD */
        gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
-       gpio_request_one(15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
-       /* enable Micro SD */
-       gpio_request_one(14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
  
  #ifdef CONFIG_CACHE_L2X0
        /* Early BRESP enable, Shared attribute override enable, 64K*8way */
@@@ -597,14 -597,12 +597,14 @@@ static int usbhs_get_vbus(struct platfo
        return usbhs_is_connected(usbhs_get_priv(pdev));
  }
  
 -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->usbcrcaddr);
 +
 +      return 0;
  }
  
  static int usbhs0_get_id(struct platform_device *pdev)
@@@ -631,13 -629,11 +631,13 @@@ static int usbhs0_hardware_init(struct 
        return 0;
  }
  
 -static void usbhs0_hardware_exit(struct platform_device *pdev)
 +static int usbhs0_hardware_exit(struct platform_device *pdev)
  {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
  
        cancel_delayed_work_sync(&priv->work);
 +
 +      return 0;
  }
  
  static struct usbhs_private usbhs0_private = {
@@@ -740,7 -736,7 +740,7 @@@ static int usbhs1_hardware_init(struct 
        return 0;
  }
  
 -static void usbhs1_hardware_exit(struct platform_device *pdev)
 +static int usbhs1_hardware_exit(struct platform_device *pdev)
  {
        struct usbhs_private *priv = usbhs_get_priv(pdev);
  
        __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr);
  
        free_irq(IRQ8, pdev);
 +
 +      return 0;
  }
  
  static int usbhs1_get_id(struct platform_device *pdev)
@@@ -1149,7 -1143,7 +1149,7 @@@ static struct sh_mmcif_plat_data sh_mmc
        .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
  };
  
- static struct platform_device sh_mmcif_device = {
+ static struct platform_device sh_mmcif_device __maybe_unused = {
        .name           = "sh_mmcif",
        .id             = 0,
        .dev            = {
diff --combined drivers/gpio/gpio-pxa.c
@@@ -19,7 -19,6 +19,7 @@@
  #include <linux/init.h>
  #include <linux/irq.h>
  #include <linux/irqdomain.h>
 +#include <linux/irqchip/chained_irq.h>
  #include <linux/io.h>
  #include <linux/of.h>
  #include <linux/of_device.h>
@@@ -27,6 -26,8 +27,6 @@@
  #include <linux/syscore_ops.h>
  #include <linux/slab.h>
  
 -#include <asm/mach/irq.h>
 -
  #include <mach/irqs.h>
  
  /*
@@@ -85,20 -86,61 +85,61 @@@ struct pxa_gpio_chip 
  #endif
  };
  
- enum {
+ enum pxa_gpio_type {
        PXA25X_GPIO = 0,
        PXA26X_GPIO,
        PXA27X_GPIO,
        PXA3XX_GPIO,
        PXA93X_GPIO,
        MMP_GPIO = 0x10,
+       MMP2_GPIO,
+ };
+ struct pxa_gpio_id {
+       enum pxa_gpio_type      type;
+       int                     gpio_nums;
  };
  
  static DEFINE_SPINLOCK(gpio_lock);
  static struct pxa_gpio_chip *pxa_gpio_chips;
- static int gpio_type;
+ static enum pxa_gpio_type gpio_type;
  static void __iomem *gpio_reg_base;
  
+ static struct pxa_gpio_id pxa25x_id = {
+       .type           = PXA25X_GPIO,
+       .gpio_nums      = 85,
+ };
+ static struct pxa_gpio_id pxa26x_id = {
+       .type           = PXA26X_GPIO,
+       .gpio_nums      = 90,
+ };
+ static struct pxa_gpio_id pxa27x_id = {
+       .type           = PXA27X_GPIO,
+       .gpio_nums      = 121,
+ };
+ static struct pxa_gpio_id pxa3xx_id = {
+       .type           = PXA3XX_GPIO,
+       .gpio_nums      = 128,
+ };
+ static struct pxa_gpio_id pxa93x_id = {
+       .type           = PXA93X_GPIO,
+       .gpio_nums      = 192,
+ };
+ static struct pxa_gpio_id mmp_id = {
+       .type           = MMP_GPIO,
+       .gpio_nums      = 128,
+ };
+ static struct pxa_gpio_id mmp2_id = {
+       .type           = MMP2_GPIO,
+       .gpio_nums      = 192,
+ };
  #define for_each_gpio_chip(i, c)                      \
        for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++)
  
@@@ -431,47 -473,39 +472,39 @@@ static struct irq_chip pxa_muxed_gpio_c
        .irq_set_wake   = pxa_gpio_set_wake,
  };
  
- static int pxa_gpio_nums(void)
+ static int pxa_gpio_nums(struct platform_device *pdev)
  {
+       const struct platform_device_id *id = platform_get_device_id(pdev);
+       struct pxa_gpio_id *pxa_id = (struct pxa_gpio_id *)id->driver_data;
        int count = 0;
  
- #ifdef CONFIG_ARCH_PXA
-       if (cpu_is_pxa25x()) {
- #ifdef CONFIG_CPU_PXA26x
-               count = 89;
-               gpio_type = PXA26X_GPIO;
- #elif defined(CONFIG_PXA25x)
-               count = 84;
-               gpio_type = PXA26X_GPIO;
- #endif /* CONFIG_CPU_PXA26x */
-       } else if (cpu_is_pxa27x()) {
-               count = 120;
-               gpio_type = PXA27X_GPIO;
-       } else if (cpu_is_pxa93x()) {
-               count = 191;
-               gpio_type = PXA93X_GPIO;
-       } else if (cpu_is_pxa3xx()) {
-               count = 127;
-               gpio_type = PXA3XX_GPIO;
-       }
- #endif /* CONFIG_ARCH_PXA */
- #ifdef CONFIG_ARCH_MMP
-       if (cpu_is_pxa168() || cpu_is_pxa910()) {
-               count = 127;
-               gpio_type = MMP_GPIO;
-       } else if (cpu_is_mmp2()) {
-               count = 191;
-               gpio_type = MMP_GPIO;
+       switch (pxa_id->type) {
+       case PXA25X_GPIO:
+       case PXA26X_GPIO:
+       case PXA27X_GPIO:
+       case PXA3XX_GPIO:
+       case PXA93X_GPIO:
+       case MMP_GPIO:
+       case MMP2_GPIO:
+               gpio_type = pxa_id->type;
+               count = pxa_id->gpio_nums - 1;
+               break;
+       default:
+               count = -EINVAL;
+               break;
        }
- #endif /* CONFIG_ARCH_MMP */
        return count;
  }
  
  #ifdef CONFIG_OF
  static struct of_device_id pxa_gpio_dt_ids[] = {
-       { .compatible = "mrvl,pxa-gpio" },
-       { .compatible = "mrvl,mmp-gpio", .data = (void *)MMP_GPIO },
+       { .compatible = "intel,pxa25x-gpio",    .data = &pxa25x_id, },
+       { .compatible = "intel,pxa26x-gpio",    .data = &pxa26x_id, },
+       { .compatible = "intel,pxa27x-gpio",    .data = &pxa27x_id, },
+       { .compatible = "intel,pxa3xx-gpio",    .data = &pxa3xx_id, },
+       { .compatible = "marvell,pxa93x-gpio",  .data = &pxa93x_id, },
+       { .compatible = "marvell,mmp-gpio",     .data = &mmp_id, },
+       { .compatible = "marvell,mmp2-gpio",    .data = &mmp2_id, },
        {}
  };
  
@@@ -491,16 -525,18 +524,18 @@@ const struct irq_domain_ops pxa_irq_dom
  
  static int pxa_gpio_probe_dt(struct platform_device *pdev)
  {
-       int ret, nr_banks, nr_gpios;
+       int ret, nr_gpios;
        struct device_node *prev, *next, *np = pdev->dev.of_node;
        const struct of_device_id *of_id =
                                of_match_device(pxa_gpio_dt_ids, &pdev->dev);
+       const struct pxa_gpio_id *gpio_id;
  
-       if (!of_id) {
+       if (!of_id || !of_id->data) {
                dev_err(&pdev->dev, "Failed to find gpio controller\n");
                return -EFAULT;
        }
-       gpio_type = (int)of_id->data;
+       gpio_id = of_id->data;
+       gpio_type = gpio_id->type;
  
        next = of_get_next_child(np, NULL);
        prev = next;
                ret = -EINVAL;
                goto err;
        }
-       for (nr_banks = 1; ; nr_banks++) {
-               next = of_get_next_child(np, prev);
-               if (!next)
-                       break;
-               prev = next;
-       }
        of_node_put(prev);
-       nr_gpios = nr_banks << 5;
+       nr_gpios = gpio_id->gpio_nums;
        pxa_last_gpio = nr_gpios - 1;
  
        irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0);
@@@ -545,19 -575,18 +574,18 @@@ static int pxa_gpio_probe(struct platfo
        int gpio, irq, ret, use_of = 0;
        int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
  
-       ret = pxa_gpio_probe_dt(pdev);
-       if (ret < 0) {
-               pxa_last_gpio = pxa_gpio_nums();
- #ifdef CONFIG_ARCH_PXA
-               if (gpio_is_pxa_type(gpio_type))
-                       irq_base = PXA_GPIO_TO_IRQ(0);
- #endif
- #ifdef CONFIG_ARCH_MMP
-               if (gpio_is_mmp_type(gpio_type))
-                       irq_base = MMP_GPIO_TO_IRQ(0);
- #endif
+       info = dev_get_platdata(&pdev->dev);
+       if (info) {
+               irq_base = info->irq_base;
+               if (irq_base <= 0)
+                       return -EINVAL;
+               pxa_last_gpio = pxa_gpio_nums(pdev);
        } else {
+               irq_base = 0;
                use_of = 1;
+               ret = pxa_gpio_probe_dt(pdev);
+               if (ret < 0)
+                       return -EINVAL;
        }
  
        if (!pxa_last_gpio)
        }
  
        /* Initialize GPIO chips */
-       info = dev_get_platdata(&pdev->dev);
        pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL);
  
        /* clear all GPIO edge detects */
        return 0;
  }
  
+ static const struct platform_device_id gpio_id_table[] = {
+       { "pxa25x-gpio",        (unsigned long)&pxa25x_id },
+       { "pxa26x-gpio",        (unsigned long)&pxa26x_id },
+       { "pxa27x-gpio",        (unsigned long)&pxa27x_id },
+       { "pxa3xx-gpio",        (unsigned long)&pxa3xx_id },
+       { "pxa93x-gpio",        (unsigned long)&pxa93x_id },
+       { "mmp-gpio",           (unsigned long)&mmp_id },
+       { "mmp2-gpio",          (unsigned long)&mmp2_id },
+       { },
+ };
  static struct platform_driver pxa_gpio_driver = {
        .probe          = pxa_gpio_probe,
        .driver         = {
                .name   = "pxa-gpio",
                .of_match_table = of_match_ptr(pxa_gpio_dt_ids),
        },
+       .id_table       = gpio_id_table,
  };
 -module_platform_driver(pxa_gpio_driver);
 +
 +static int __init pxa_gpio_init(void)
 +{
 +      return platform_driver_register(&pxa_gpio_driver);
 +}
 +postcore_initcall(pxa_gpio_init);
  
  #ifdef CONFIG_PM
  static int pxa_gpio_suspend(void)