Merge branch 'highbank/soc' into next/soc
authorArnd Bergmann <arnd@arndb.de>
Wed, 2 Nov 2011 01:46:10 +0000 (02:46 +0100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 2 Nov 2011 01:46:10 +0000 (02:46 +0100)
Conflicts:
arch/arm/mach-mxs/include/mach/gpio.h
arch/arm/mach-omap2/board-generic.c
arch/arm/plat-mxc/include/mach/gpio.h

12 files changed:
1  2 
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-imx/mach-mx27ads.c
arch/arm/mach-mxs/include/mach/gpio.h
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/devices.c
arch/arm/plat-mxc/include/mach/gpio.h
arch/arm/plat-omap/devices.c
drivers/gpio/gpio-omap.c

diff --combined MAINTAINERS
@@@ -688,6 -688,12 +688,12 @@@ F:       drivers/mtd/nand/bcm_umi_nand.
  F:    drivers/mtd/nand/bcm_umi_bch.c
  F:    drivers/mtd/nand/nand_bcm_umi.h
  
+ ARM/CALXEDA HIGHBANK ARCHITECTURE
+ M:    Rob Herring <rob.herring@calxeda.com>
+ L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+ S:    Maintained
+ F:    arch/arm/mach-highbank/
  ARM/CAVIUM NETWORKS CNS3XXX MACHINE SUPPORT
  M:    Anton Vorontsov <avorontsov@mvista.com>
  S:    Maintained
@@@ -2460,7 -2466,7 +2466,7 @@@ S:      Supporte
  F:    drivers/infiniband/hw/ehca/
  
  EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
 -M:    Breno Leitao <leitao@linux.vnet.ibm.com>
 +M:    Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ehea/
@@@ -3313,7 -3319,7 +3319,7 @@@ M:      David Woodhouse <dwmw2@infradead.org
  L:    iommu@lists.linux-foundation.org
  T:    git git://git.infradead.org/iommu-2.6.git
  S:    Supported
 -F:    drivers/pci/intel-iommu.c
 +F:    drivers/iommu/intel-iommu.c
  F:    include/linux/intel-iommu.h
  
  INTEL IOP-ADMA DMA DRIVER
@@@ -6366,10 -6372,10 +6372,10 @@@ F:   net/ipv4/tcp_lp.
  
  TEGRA SUPPORT
  M:    Colin Cross <ccross@android.com>
 -M:    Erik Gilling <konkers@android.com>
  M:    Olof Johansson <olof@lixom.net>
 +M:    Stephen Warren <swarren@nvidia.com>
  L:    linux-tegra@vger.kernel.org
 -T:    git git://android.git.kernel.org/kernel/tegra.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git
  S:    Supported
  F:    arch/arm/mach-tegra
  
diff --combined arch/arm/Kconfig
@@@ -330,6 -330,20 +330,20 @@@ config ARCH_BCMRIN
        help
          Support for Broadcom's BCMRing platform.
  
+ config ARCH_HIGHBANK
+       bool "Calxeda Highbank-based"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARM_AMBA
+       select ARM_GIC
+       select ARM_TIMER_SP804
+       select CLKDEV_LOOKUP
+       select CPU_V7
+       select GENERIC_CLOCKEVENTS
+       select HAVE_ARM_SCU
+       select USE_OF
+       help
+         Support for the Calxeda Highbank SoC based boards.
  config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x-based"
        select CPU_ARM720T
@@@ -413,7 -427,6 +427,7 @@@ config ARCH_MX
        select CLKSRC_MMIO
        select GENERIC_IRQ_CHIP
        select HAVE_SCHED_CLOCK
 +      select MULTI_IRQ_HANDLER
        help
          Support for Freescale MXC/iMX-based family of processors
  
@@@ -862,6 -875,7 +876,7 @@@ config ARCH_U30
        select CLKDEV_LOOKUP
        select HAVE_MACH_CLKDEV
        select GENERIC_GPIO
+       select ARCH_REQUIRE_GPIOLIB
        select NEED_MACH_MEMORY_H
        help
          Support for ST-Ericsson U300 series mobile platforms.
@@@ -1402,7 -1416,7 +1417,7 @@@ config SM
        depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
                 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
                 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
-                ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE
+                ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK
        select USE_GENERIC_SMP_HELPERS
        select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
        help
diff --combined arch/arm/Makefile
@@@ -144,6 -144,7 +144,7 @@@ machine-$(CONFIG_ARCH_EBSA110)             := ebsa
  machine-$(CONFIG_ARCH_EP93XX)         := ep93xx
  machine-$(CONFIG_ARCH_GEMINI)         := gemini
  machine-$(CONFIG_ARCH_H720X)          := h720x
+ machine-$(CONFIG_ARCH_HIGHBANK)               := highbank
  machine-$(CONFIG_ARCH_INTEGRATOR)     := integrator
  machine-$(CONFIG_ARCH_IOP13XX)                := iop13xx
  machine-$(CONFIG_ARCH_IOP32X)         := iop32x
@@@ -157,7 -158,9 +158,7 @@@ machine-$(CONFIG_ARCH_LPC32XX)             := lpc3
  machine-$(CONFIG_ARCH_MMP)            := mmp
  machine-$(CONFIG_ARCH_MSM)            := msm
  machine-$(CONFIG_ARCH_MV78XX0)                := mv78xx0
 -machine-$(CONFIG_ARCH_MX1)            := imx
 -machine-$(CONFIG_ARCH_MX2)            := imx
 -machine-$(CONFIG_ARCH_MX25)           := imx
 +machine-$(CONFIG_ARCH_IMX_V4_V5)      := imx
  machine-$(CONFIG_ARCH_MX3)            := imx
  machine-$(CONFIG_ARCH_MX5)            := mx5
  machine-$(CONFIG_ARCH_MXS)            := mxs
@@@ -13,7 -13,7 +13,7 @@@
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   */
+ #include <linux/gpio.h>
  #include <linux/platform_device.h>
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/map.h>
@@@ -27,7 -27,6 +27,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  #include <asm/mach/map.h>
- #include <mach/gpio.h>
  #include <mach/iomux-mx27.h>
  
  #include "devices-imx27.h"
@@@ -349,7 -348,6 +348,7 @@@ MACHINE_START(MX27ADS, "Freescale i.MX2
        .map_io = mx27ads_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
 +      .handle_irq = imx27_handle_irq,
        .timer = &mx27ads_timer,
        .init_machine = mx27ads_board_init,
  MACHINE_END
@@@ -1,31 -1,27 +1,1 @@@
--/*
-- * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
-- * Copyright 2008 Juergen Beisert, kernel@pengutronix.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.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-- * MA  02110-1301, USA.
-- */
--
--#ifndef __MACH_MXS_GPIO_H__
--#define __MACH_MXS_GPIO_H__
--
- #include <asm-generic/gpio.h>
 -#define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr))
--
- /* use gpiolib dispatchers */
- #define gpio_get_value                __gpio_get_value
- #define gpio_set_value                __gpio_set_value
- #define gpio_cansleep         __gpio_cansleep
- #define gpio_to_irq           __gpio_to_irq
 -#define irq_to_gpio(irq)      ((irq) - MXS_GPIO_IRQ_START)
--
--#endif /* __MACH_MXS_GPIO_H__ */
++/* empty */
  /*
 - * linux/arch/arm/mach-omap2/board-generic.c
 - *
   * Copyright (C) 2005 Nokia Corporation
   * Author: Paul Mundt <paul.mundt@nokia.com>
   *
 - * Modified from mach-omap/omap1/board-generic.c
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
   *
 - * Code for generic OMAP2 board. Should work on many OMAP2 systems where
 - * the bootloader passes the board-specific data to the kernel.
 - * Do not put any board specific code to this file; create a new machine
 - * type if you need custom low-level initializations.
 + * Modified from the original mach-omap/omap2/board-generic.c did by Paul
 + * to support the OMAP2+ device tree boards with an unique board file.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
+ #include <linux/gpio.h>
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/device.h>
 +#include <linux/io.h>
 +#include <linux/of_platform.h>
 +#include <linux/irqdomain.h>
 +#include <linux/i2c/twl.h>
  
  #include <mach/hardware.h>
 -#include <asm/mach-types.h>
  #include <asm/mach/arch.h>
 -#include <asm/mach/map.h>
  
+ #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
 +#include <mach/omap4-common.h>
 +#include "common-board-devices.h"
 +
 +/*
 + * XXX: Still needed to boot until the i2c & twl driver is adapted to
 + * device-tree
 + */
 +static struct twl4030_platform_data sdp4430_twldata = {
 +      .irq_base       = TWL6030_IRQ_BASE,
 +      .irq_end        = TWL6030_IRQ_END,
 +};
  
 -static struct omap_board_config_kernel generic_config[] = {
 +static void __init omap4_i2c_init(void)
 +{
 +      omap4_pmic_init("twl6030", &sdp4430_twldata);
 +}
 +
 +static struct twl4030_platform_data beagle_twldata = {
 +      .irq_base       = TWL4030_IRQ_BASE,
 +      .irq_end        = TWL4030_IRQ_END,
  };
  
 -static void __init omap_generic_init_early(void)
 +static void __init omap3_i2c_init(void)
  {
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 +      omap3_pmic_init("twl4030", &beagle_twldata);
  }
  
 +static struct of_device_id omap_dt_match_table[] __initdata = {
 +      { .compatible = "simple-bus", },
 +      { .compatible = "ti,omap-infra", },
 +      { }
 +};
 +
 +static struct of_device_id intc_match[] __initdata = {
 +      { .compatible = "ti,omap3-intc", },
 +      { .compatible = "arm,cortex-a9-gic", },
 +      { }
 +};
 +
  static void __init omap_generic_init(void)
  {
 +      struct device_node *node = of_find_matching_node(NULL, intc_match);
 +      if (node)
 +              irq_domain_add_simple(node, 0);
 +
        omap_serial_init();
 -      omap_board_config = generic_config;
 -      omap_board_config_size = ARRAY_SIZE(generic_config);
 +      omap_sdrc_init(NULL, NULL);
 +
 +      of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
 +}
 +
 +static void __init omap4_init(void)
 +{
 +      omap4_i2c_init();
 +      omap_generic_init();
  }
  
 -static void __init omap_generic_map_io(void)
 +static void __init omap3_init(void)
  {
 -      if (cpu_is_omap242x()) {
 -              omap2_set_globals_242x();
 -              omap242x_map_common_io();
 -      } else if (cpu_is_omap243x()) {
 -              omap2_set_globals_243x();
 -              omap243x_map_common_io();
 -      } else if (cpu_is_omap34xx()) {
 -              omap2_set_globals_3xxx();
 -              omap34xx_map_common_io();
 -      } else if (cpu_is_omap44xx()) {
 -              omap2_set_globals_443x();
 -              omap44xx_map_common_io();
 -      }
 +      omap3_i2c_init();
 +      omap_generic_init();
  }
  
 -/* XXX This machine entry name should be updated */
 -MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
 -      /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
 +#if defined(CONFIG_SOC_OMAP2420)
 +static const char *omap242x_boards_compat[] __initdata = {
 +      "ti,omap2420",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
 +      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
 +      .init_irq       = omap2_init_irq,
 +      .init_machine   = omap_generic_init,
 +      .timer          = &omap2_timer,
 +      .dt_compat      = omap242x_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_SOC_OMAP2430)
 +static const char *omap243x_boards_compat[] __initdata = {
 +      "ti,omap2430",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
        .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_generic_map_io,
 -      .init_early     = omap_generic_init_early,
 +      .map_io         = omap243x_map_io,
 +      .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap2_timer,
 +      .dt_compat      = omap243x_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_ARCH_OMAP3)
 +static const char *omap3_boards_compat[] __initdata = {
 +      "ti,omap3",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
 +      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap3_map_io,
 +      .init_early     = omap3430_init_early,
 +      .init_irq       = omap3_init_irq,
 +      .init_machine   = omap3_init,
 +      .timer          = &omap3_timer,
 +      .dt_compat      = omap3_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_ARCH_OMAP4)
 +static const char *omap4_boards_compat[] __initdata = {
 +      "ti,omap4",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
 +      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap4_map_io,
 +      .init_early     = omap4430_init_early,
 +      .init_irq       = gic_init_irq,
 +      .init_machine   = omap4_init,
 +      .timer          = &omap4_timer,
 +      .dt_compat      = omap4_boards_compat,
  MACHINE_END
 +#endif
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
+ #include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -31,7 -31,6 +31,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
- #include <mach/gpio.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
@@@ -290,6 -289,17 +289,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &h4_lcd_config },
  };
  
 -static void __init omap_h4_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
 -static void __init omap_h4_init_irq(void)
 -{
 -      omap2_init_irq();
 -}
 -
  static struct at24_platform_data m24c01 = {
        .byte_len       = SZ_1K / 8,
        .page_size      = 16,
@@@ -360,17 -370,22 +359,17 @@@ static void __init omap_h4_init(void
        platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
        omap2_usbfs_init(&h4_usb_config);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        h4_init_flash();
  }
  
 -static void __init omap_h4_map_io(void)
 -{
 -      omap2_set_globals_242x();
 -      omap242x_map_common_io();
 -}
 -
  MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
        .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_h4_map_io,
 -      .init_early     = omap_h4_init_early,
 -      .init_irq       = omap_h4_init_irq,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
 +      .init_irq       = omap2_init_irq,
        .init_machine   = omap_h4_init,
        .timer          = &omap2_timer,
  MACHINE_END
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
+ #include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -34,7 -34,6 +34,6 @@@
  #include <asm/mach/map.h>
  
  #include <plat/mcspi.h>
- #include <mach/gpio.h>
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/gpmc.h>
@@@ -193,6 -192,12 +192,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &ldp_lcd_config },
  };
  
 -static void __init omap_ldp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct twl4030_gpio_platform_data ldp_gpio_data = {
        .gpio_base      = OMAP_MAX_GPIO_LINES,
        .irq_base       = TWL4030_GPIO_IRQ_BASE,
@@@ -319,7 -324,6 +318,7 @@@ static void __init omap_ldp_init(void
        platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
        omap_ads7846_init(1, 54, 310, NULL);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        usb_musb_init(NULL);
        board_nand_init(ldp_nand_partitions,
                ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
@@@ -331,7 -335,7 +330,7 @@@ MACHINE_START(OMAP_LDP, "OMAP LDP board
        .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_ldp_init_early,
 +      .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_ldp_init,
        .timer          = &omap3_timer,
@@@ -8,7 -8,7 +8,7 @@@
   * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   */
+ #include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -16,7 -16,6 +16,7 @@@
  #include <linux/clk.h>
  #include <linux/err.h>
  #include <linux/slab.h>
 +#include <linux/of.h>
  
  #include <mach/hardware.h>
  #include <mach/irqs.h>
@@@ -27,7 -26,6 +27,6 @@@
  #include <plat/tc.h>
  #include <plat/board.h>
  #include <plat/mcbsp.h>
- #include <mach/gpio.h>
  #include <plat/mmc.h>
  #include <plat/dma.h>
  #include <plat/omap_hwmod.h>
@@@ -45,7 -43,7 +44,7 @@@ static int __init omap3_l3_init(void
  {
        int l;
        struct omap_hwmod *oh;
 -      struct omap_device *od;
 +      struct platform_device *pdev;
        char oh_name[L3_MODULES_MAX_LEN];
  
        /*
        if (!oh)
                pr_err("could not look up %s\n", oh_name);
  
 -      od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
 +      pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
                                                           NULL, 0, 0);
  
 -      WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
 +      WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
  
 -      return IS_ERR(od) ? PTR_ERR(od) : 0;
 +      return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  }
  postcore_initcall(omap3_l3_init);
  
@@@ -75,13 -73,9 +74,13 @@@ static int __init omap4_l3_init(void
  {
        int l, i;
        struct omap_hwmod *oh[3];
 -      struct omap_device *od;
 +      struct platform_device *pdev;
        char oh_name[L3_MODULES_MAX_LEN];
  
 +      /* If dtb is there, the devices will be created dynamically */
 +      if (of_have_populated_dt())
 +              return -ENODEV;
 +
        /*
         * To avoid code running on other OMAPs in
         * multi-omap builds
                        pr_err("could not look up %s\n", oh_name);
        }
  
 -      od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
 +      pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
                                                     0, NULL, 0, 0);
  
 -      WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
 +      WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
  
 -      return IS_ERR(od) ? PTR_ERR(od) : 0;
 +      return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  }
  postcore_initcall(omap4_l3_init);
  
@@@ -226,10 -220,18 +225,10 @@@ static inline void omap_init_camera(voi
  #endif
  }
  
 -struct omap_device_pm_latency omap_keyboard_latency[] = {
 -      {
 -              .deactivate_func = omap_device_idle_hwmods,
 -              .activate_func   = omap_device_enable_hwmods,
 -              .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 -      },
 -};
 -
  int __init omap4_keyboard_init(struct omap4_keypad_platform_data
                        *sdp4430_keypad_data, struct omap_board_data *bdata)
  {
 -      struct omap_device *od;
 +      struct platform_device *pdev;
        struct omap_hwmod *oh;
        struct omap4_keypad_platform_data *keypad_data;
        unsigned int id = -1;
  
        keypad_data = sdp4430_keypad_data;
  
 -      od = omap_device_build(name, id, oh, keypad_data,
 -                      sizeof(struct omap4_keypad_platform_data),
 -                      omap_keyboard_latency,
 -                      ARRAY_SIZE(omap_keyboard_latency), 0);
 +      pdev = omap_device_build(name, id, oh, keypad_data,
 +                      sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
  
 -      if (IS_ERR(od)) {
 +      if (IS_ERR(pdev)) {
                WARN(1, "Can't build omap_device for %s:%s.\n",
                                                name, oh->name);
 -              return PTR_ERR(od);
 +              return PTR_ERR(pdev);
        }
        oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
  
  }
  
  #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
 -static struct omap_device_pm_latency mbox_latencies[] = {
 -      [0] = {
 -              .activate_func = omap_device_enable_hwmods,
 -              .deactivate_func = omap_device_idle_hwmods,
 -              .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 -      },
 -};
 -
  static inline void omap_init_mbox(void)
  {
        struct omap_hwmod *oh;
 -      struct omap_device *od;
 +      struct platform_device *pdev;
  
        oh = omap_hwmod_lookup("mailbox");
        if (!oh) {
                return;
        }
  
 -      od = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
 -                              mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
 -      WARN(IS_ERR(od), "%s: could not build device, err %ld\n",
 -                                              __func__, PTR_ERR(od));
 +      pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0);
 +      WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
 +                                              __func__, PTR_ERR(pdev));
  }
  #else
  static inline void omap_init_mbox(void) { }
@@@ -320,9 -333,17 +319,9 @@@ static inline void omap_init_audio(void
  
  #include <plat/mcspi.h>
  
 -struct omap_device_pm_latency omap_mcspi_latency[] = {
 -      [0] = {
 -              .deactivate_func = omap_device_idle_hwmods,
 -              .activate_func   = omap_device_enable_hwmods,
 -              .flags           = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 -      },
 -};
 -
  static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
  {
 -      struct omap_device *od;
 +      struct platform_device *pdev;
        char *name = "omap2_mcspi";
        struct omap2_mcspi_platform_config *pdata;
        static int spi_num;
        }
  
        spi_num++;
 -      od = omap_device_build(name, spi_num, oh, pdata,
 -                              sizeof(*pdata), omap_mcspi_latency,
 -                              ARRAY_SIZE(omap_mcspi_latency), 0);
 -      WARN(IS_ERR(od), "Can't build omap_device for %s:%s\n",
 +      pdev = omap_device_build(name, spi_num, oh, pdata,
 +                              sizeof(*pdata), NULL, 0, 0);
 +      WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
                                name, oh->name);
        kfree(pdata);
        return 0;
@@@ -675,10 -697,18 +674,10 @@@ static int __init omap2_init_devices(vo
  arch_initcall(omap2_init_devices);
  
  #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
 -static struct omap_device_pm_latency omap_wdt_latency[] = {
 -      [0] = {
 -              .deactivate_func = omap_device_idle_hwmods,
 -              .activate_func   = omap_device_enable_hwmods,
 -              .flags           = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 -      },
 -};
 -
  static int __init omap_init_wdt(void)
  {
        int id = -1;
 -      struct omap_device *od;
 +      struct platform_device *pdev;
        struct omap_hwmod *oh;
        char *oh_name = "wd_timer2";
        char *dev_name = "omap_wdt";
                return -EINVAL;
        }
  
 -      od = omap_device_build(dev_name, id, oh, NULL, 0,
 -                              omap_wdt_latency,
 -                              ARRAY_SIZE(omap_wdt_latency), 0);
 -      WARN(IS_ERR(od), "Can't build omap_device for %s:%s.\n",
 +      pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
 +      WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
                                dev_name, oh->name);
        return 0;
  }
@@@ -1,32 -1,33 +1,1 @@@
--/*
-- * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
-- * Copyright 2008 Juergen Beisert, kernel@pengutronix.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.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-- */
--
--#ifndef __ASM_ARCH_MXC_GPIO_H__
--#define __ASM_ARCH_MXC_GPIO_H__
--
--#include <linux/spinlock.h>
--#include <mach/hardware.h>
- #include <asm-generic/gpio.h>
--
- /* use gpiolib dispatchers */
- #define gpio_get_value                __gpio_get_value
- #define gpio_set_value                __gpio_set_value
- #define gpio_cansleep         __gpio_cansleep
- #define gpio_to_irq           __gpio_to_irq
 -
 -/* There's a off-by-one betweem the gpio bank number and the gpiochip */
 -/* range e.g. GPIO_1_5 is gpio 5 under linux */
 -#define IMX_GPIO_NR(bank, nr)         (((bank) - 1) * 32 + (nr))
 -
 -#define gpio_to_irq(gpio)     (MXC_GPIO_IRQ_START + (gpio))
 -#define irq_to_gpio(irq)      ((irq) - MXC_GPIO_IRQ_START)
--
--#endif
++/* empty */
@@@ -8,7 -8,7 +8,7 @@@
   * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   */
+ #include <linux/gpio.h>
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <plat/tc.h>
  #include <plat/board.h>
  #include <plat/mmc.h>
- #include <mach/gpio.h>
  #include <plat/menelaus.h>
 -#include <plat/mcbsp.h>
  #include <plat/omap44xx.h>
  
 -/*-------------------------------------------------------------------------*/
 -
 -#if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE)
 -
 -static struct platform_device **omap_mcbsp_devices;
 -
 -void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
 -                      struct omap_mcbsp_platform_data *config, int size)
 -{
 -      int i;
 -
 -      omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
 -                                   GFP_KERNEL);
 -      if (!omap_mcbsp_devices) {
 -              printk(KERN_ERR "Could not register McBSP devices\n");
 -              return;
 -      }
 -
 -      for (i = 0; i < size; i++) {
 -              struct platform_device *new_mcbsp;
 -              int ret;
 -
 -              new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
 -              if (!new_mcbsp)
 -                      continue;
 -              platform_device_add_resources(new_mcbsp, &res[i * res_count],
 -                                      res_count);
 -              new_mcbsp->dev.platform_data = &config[i];
 -              ret = platform_device_add(new_mcbsp);
 -              if (ret) {
 -                      platform_device_put(new_mcbsp);
 -                      continue;
 -              }
 -              omap_mcbsp_devices[i] = new_mcbsp;
 -      }
 -}
 -
 -#else
 -void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
 -                      struct omap_mcbsp_platform_data *config, int size)
 -{  }
 -#endif
 -
 -/*-------------------------------------------------------------------------*/
 -
  #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
                defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
  
diff --combined drivers/gpio/gpio-omap.c
@@@ -25,7 -25,7 +25,7 @@@
  #include <mach/hardware.h>
  #include <asm/irq.h>
  #include <mach/irqs.h>
- #include <mach/gpio.h>
+ #include <asm/gpio.h>
  #include <asm/mach/irq.h>
  
  struct gpio_bank {
@@@ -34,8 -34,8 +34,8 @@@
        u16 irq;
        u16 virtual_irq_start;
        int method;
 -#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
        u32 suspend_wakeup;
 +#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
        u32 saved_wakeup;
  #endif
        u32 non_wakeup_gpios;