]> Git Repo - linux.git/commitdiff
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind...
authorLinus Torvalds <[email protected]>
Thu, 26 May 2011 19:11:54 +0000 (12:11 -0700)
committerLinus Torvalds <[email protected]>
Thu, 26 May 2011 19:11:54 +0000 (12:11 -0700)
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (33 commits)
  OMAP3: PM: Boot message is not an error, and not helpful, remove it
  OMAP3: cpuidle: change the power domains modes determination logic
  OMAP3: cpuidle: code rework for improved readability
  OMAP3: cpuidle: re-organize the C-states data
  OMAP3: clean-up mach specific cpuidle data structures
  OMAP3 cpuidle: remove useless SDP specific timings
  usb: otg: OMAP4430: Powerdown the internal PHY when USB is disabled
  usb: otg: OMAP4430: Fixing the omap4430_phy_init function
  usb: musb: am35x: fix compile error when building am35x
  usb: musb: OMAP4430: Power down the PHY during board init
  omap: drop board-igep0030.c
  omap: igep0020: add support for IGEP3
  omap: igep0020: minor refactoring
  omap: igep0020: name refactoring for future merge with IGEP3
  omap: Remove support for omap2evm
  arm: omap2plus: GPIO cleanup
  omap: musb: introduce default board config
  omap: move detection of NAND CS to common-board-devices
  omap: use common initialization for PMIC i2c bus
  omap: consolidate touch screen initialization among different boards
  ...

16 files changed:
1  2 
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-4430sdp.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-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rx51-video.c
arch/arm/mach-omap2/board-zoom-display.c
arch/arm/plat-omap/include/plat/uncompress.h

index 66dfbccacd25e0cabfdbbbf802f8cb59526d8fc7,f082f7d657609b630f87df8c2a7d685e1228573c..b14807794401243fac61205cfcafdb925398dfbd
@@@ -59,10 -59,10 +59,10 @@@ endi
  # Power Management
  ifeq ($(CONFIG_PM),y)
  obj-$(CONFIG_ARCH_OMAP2)              += pm24xx.o
 -obj-$(CONFIG_ARCH_OMAP2)              += sleep24xx.o pm_bus.o
 +obj-$(CONFIG_ARCH_OMAP2)              += sleep24xx.o
  obj-$(CONFIG_ARCH_OMAP3)              += pm34xx.o sleep34xx.o \
 -                                         cpuidle34xx.o pm_bus.o
 -obj-$(CONFIG_ARCH_OMAP4)              += pm44xx.o pm_bus.o
 +                                         cpuidle34xx.o
 +obj-$(CONFIG_ARCH_OMAP4)              += pm44xx.o
  obj-$(CONFIG_PM_DEBUG)                        += pm-debug.o
  obj-$(CONFIG_OMAP_SMARTREFLEX)          += sr_device.o smartreflex.o
  obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
@@@ -229,8 -229,6 +229,6 @@@ obj-$(CONFIG_MACH_CM_T35)          += board-cm-
  obj-$(CONFIG_MACH_CM_T3517)           += board-cm-t3517.o
  obj-$(CONFIG_MACH_IGEP0020)           += board-igep0020.o \
                                           hsmmc.o
- obj-$(CONFIG_MACH_IGEP0030)           += board-igep0030.o \
-                                          hsmmc.o
  obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)    += board-omap3touchbook.o \
                                           hsmmc.o
  obj-$(CONFIG_MACH_OMAP_4430SDP)               += board-4430sdp.o \
@@@ -270,3 -268,5 +268,5 @@@ obj-$(CONFIG_ARCH_OMAP4)           += hwspinlock
  
  disp-$(CONFIG_OMAP2_DSS)              := display.o
  obj-y                                 += $(disp-m) $(disp-y)
+ obj-y                                 += common-board-devices.o
index 23244cd0a5b6fed83adb041056558e8e58f6b13a,52dbdf3ab66c47f012d525cab4daf367e13537f1..ae2963a98041711a091a473cc1a66283a851397c
@@@ -19,7 -19,6 +19,6 @@@
  #include <linux/input.h>
  #include <linux/input/matrix_keypad.h>
  #include <linux/spi/spi.h>
- #include <linux/spi/ads7846.h>
  #include <linux/i2c/twl.h>
  #include <linux/regulator/machine.h>
  #include <linux/io.h>
@@@ -37,8 -36,8 +36,8 @@@
  #include <plat/common.h>
  #include <plat/dma.h>
  #include <plat/gpmc.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  
  #include <plat/gpmc-smc91x.h>
  
@@@ -48,6 -47,7 +47,7 @@@
  #include "hsmmc.h"
  #include "pm.h"
  #include "control.h"
+ #include "common-board-devices.h"
  
  #define CONFIG_DISABLE_HFCLK 1
  
  
  #define TWL4030_MSECURE_GPIO 22
  
- /* FIXME: These values need to be updated based on more profiling on 3430sdp*/
- static struct cpuidle_params omap3_cpuidle_params_table[] = {
-       /* C1 */
-       {1, 2, 2, 5},
-       /* C2 */
-       {1, 10, 10, 30},
-       /* C3 */
-       {1, 50, 50, 300},
-       /* C4 */
-       {1, 1500, 1800, 4000},
-       /* C5 */
-       {1, 2500, 7500, 12000},
-       /* C6 */
-       {1, 3000, 8500, 15000},
-       /* C7 */
-       {1, 10000, 30000, 300000},
- };
  static uint32_t board_keymap[] = {
        KEY(0, 0, KEY_LEFT),
        KEY(0, 1, KEY_RIGHT),
@@@ -123,63 -105,14 +105,14 @@@ static struct twl4030_keypad_data sdp34
        .rep            = 1,
  };
  
- static int ts_gpio;   /* Needed for ads7846_get_pendown_state */
- /**
-  * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
-  *
-  * @return - void. If request gpio fails then Flag KERN_ERR.
-  */
- static void ads7846_dev_init(void)
- {
-       if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
-               printk(KERN_ERR "can't get ads746 pen down GPIO\n");
-               return;
-       }
-       gpio_direction_input(ts_gpio);
-       gpio_set_debounce(ts_gpio, 310);
- }
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(ts_gpio);
- }
- static struct ads7846_platform_data tsc2046_config __initdata = {
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
-       .wakeup                         = true,
- };
- static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
- static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
-       [0] = {
-               /*
-                * TSC2046 operates at a max freqency of 2MHz, so
-                * operate slightly below at 1.5MHz
-                */
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &tsc2046_mcspi_config,
-               .irq                    = 0,
-               .platform_data          = &tsc2046_config,
-       },
- };
  #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO      8
  #define SDP3430_LCD_PANEL_ENABLE_GPIO         5
  
- static unsigned backlight_gpio;
- static unsigned enable_gpio;
+ static struct gpio sdp3430_dss_gpios[] __initdata = {
+       {SDP3430_LCD_PANEL_ENABLE_GPIO,    GPIOF_OUT_INIT_LOW, "LCD reset"    },
+       {SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
+ };
  static int lcd_enabled;
  static int dvi_enabled;
  
@@@ -187,29 -120,11 +120,11 @@@ static void __init sdp3430_display_init
  {
        int r;
  
-       enable_gpio    = SDP3430_LCD_PANEL_ENABLE_GPIO;
-       backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
-       r = gpio_request(enable_gpio, "LCD reset");
-       if (r) {
-               printk(KERN_ERR "failed to get LCD reset GPIO\n");
-               goto err0;
-       }
-       r = gpio_request(backlight_gpio, "LCD Backlight");
-       if (r) {
-               printk(KERN_ERR "failed to get LCD backlight GPIO\n");
-               goto err1;
-       }
-       gpio_direction_output(enable_gpio, 0);
-       gpio_direction_output(backlight_gpio, 0);
+       r = gpio_request_array(sdp3430_dss_gpios,
+                              ARRAY_SIZE(sdp3430_dss_gpios));
+       if (r)
+               printk(KERN_ERR "failed to get LCD control GPIOs\n");
  
-       return;
- err1:
-       gpio_free(enable_gpio);
- err0:
-       return;
  }
  
  static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
                return -EINVAL;
        }
  
-       gpio_direction_output(enable_gpio, 1);
-       gpio_direction_output(backlight_gpio, 1);
+       gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
+       gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
  
        lcd_enabled = 1;
  
@@@ -231,8 -146,8 +146,8 @@@ static void sdp3430_panel_disable_lcd(s
  {
        lcd_enabled = 0;
  
-       gpio_direction_output(enable_gpio, 0);
-       gpio_direction_output(backlight_gpio, 0);
+       gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
+       gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
  }
  
  static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
@@@ -360,12 -275,10 +275,10 @@@ static int sdp3430_twl_gpio_setup(struc
        omap2_hsmmc_init(mmc);
  
        /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
-       gpio_request(gpio + 7, "sub_lcd_en_bkl");
-       gpio_direction_output(gpio + 7, 0);
+       gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "sub_lcd_en_bkl");
  
        /* gpio + 15 is "sub_lcd_nRST" (output) */
-       gpio_request(gpio + 15, "sub_lcd_nRST");
-       gpio_direction_output(gpio + 15, 0);
+       gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST");
  
        return 0;
  }
@@@ -580,20 -493,10 +493,10 @@@ static struct twl4030_platform_data sdp
        .vpll2          = &sdp3430_vpll2,
  };
  
- static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl4030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &sdp3430_twldata,
-       },
- };
  static int __init omap3430_i2c_init(void)
  {
        /* i2c1 for PMIC only */
-       omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
-                       ARRAY_SIZE(sdp3430_i2c_boardinfo));
+       omap3_pmic_init("twl4030", &sdp3430_twldata);
        /* i2c2 on camera connector (for sensor control) and optional isp1301 */
        omap_register_i2c_bus(2, 400, NULL, 0);
        /* i2c3 on display connector (for DVI, tfp410) */
@@@ -872,30 -775,22 +775,22 @@@ static struct flash_partitions sdp_flas
        },
  };
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
  static void __init omap_3430sdp_init(void)
  {
+       int gpio_pendown;
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_board_config = sdp3430_config;
        omap_board_config_size = ARRAY_SIZE(sdp3430_config);
-       omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
        omap3430_i2c_init();
        omap_display_init(&sdp3430_dss_data);
        if (omap_rev() > OMAP3430_REV_ES1_0)
-               ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
+               gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV2;
        else
-               ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1;
-       sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
-       spi_register_board_info(sdp3430_spi_board_info,
-                               ARRAY_SIZE(sdp3430_spi_board_info));
-       ads7846_dev_init();
+               gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1;
+       omap_ads7846_init(1, gpio_pendown, 310, NULL);
        board_serial_init();
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        board_smc91x_init();
        board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
        sdp3430_display_init();
index 93edd7fcf4512bbeebd40a9801b6982d317b5d77,ae3153c5396dcbef45823116bb6ac3613b7810f7..73fa90bb6953dcffb47119328a0aa0f059ae6164
  #include <plat/usb.h>
  #include <plat/mmc.h>
  #include <plat/omap4-keypad.h>
 -#include <plat/display.h>
 +#include <video/omapdss.h>
  
  #include "mux.h"
  #include "hsmmc.h"
  #include "timer-gp.h"
  #include "control.h"
+ #include "common-board-devices.h"
  
  #define ETH_KS8851_IRQ                        34
  #define ETH_KS8851_POWER_ON           48
@@@ -251,58 -252,22 +252,22 @@@ static struct spi_board_info sdp4430_sp
        },
  };
  
+ static struct gpio sdp4430_eth_gpios[] __initdata = {
+       { ETH_KS8851_POWER_ON,  GPIOF_OUT_INIT_HIGH,    "eth_power"     },
+       { ETH_KS8851_QUART,     GPIOF_OUT_INIT_HIGH,    "quart"         },
+       { ETH_KS8851_IRQ,       GPIOF_IN,               "eth_irq"       },
+ };
  static int omap_ethernet_init(void)
  {
        int status;
  
        /* Request of GPIO lines */
+       status = gpio_request_array(sdp4430_eth_gpios,
+                                   ARRAY_SIZE(sdp4430_eth_gpios));
+       if (status)
+               pr_err("Cannot request ETH GPIOs\n");
  
-       status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
-               return status;
-       }
-       status = gpio_request(ETH_KS8851_QUART, "quart");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
-               goto error1;
-       }
-       status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
-               goto error2;
-       }
-       /* Configuration of requested GPIO lines */
-       status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
-       if (status) {
-               pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
-               goto error3;
-       }
-       status = gpio_direction_output(ETH_KS8851_QUART, 1);
-       if (status) {
-               pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
-               goto error3;
-       }
-       status = gpio_direction_input(ETH_KS8851_IRQ);
-       if (status) {
-               pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
-               goto error3;
-       }
-       return 0;
- error3:
-       gpio_free(ETH_KS8851_IRQ);
- error2:
-       gpio_free(ETH_KS8851_QUART);
- error1:
-       gpio_free(ETH_KS8851_POWER_ON);
        return status;
  }
  
@@@ -575,14 -540,6 +540,6 @@@ static struct twl4030_platform_data sdp
        .usb            = &omap4_usbphy_data
  };
  
- static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl6030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = OMAP44XX_IRQ_SYS_1N,
-               .platform_data = &sdp4430_twldata,
-       },
- };
  static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
        {
                I2C_BOARD_INFO("tmp105", 0x48),
@@@ -598,12 -555,7 +555,7 @@@ static struct i2c_board_info __initdat
  };
  static int __init omap4_i2c_init(void)
  {
-       /*
-        * Phoenix Audio IC needs I2C1 to
-        * start with 400 KHz or less
-        */
-       omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
-                       ARRAY_SIZE(sdp4430_i2c_boardinfo));
+       omap4_pmic_init("twl6030", &sdp4430_twldata);
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
                                ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
  
  static void __init omap_sfh7741prox_init(void)
  {
-       int  error;
+       int error;
  
-       error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741");
-       if (error < 0) {
+       error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
+                                GPIOF_OUT_INIT_LOW, "sfh7741");
+       if (error < 0)
                pr_err("%s:failed to request GPIO %d, error %d\n",
                        __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
-               return;
-       }
-       error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0);
-       if (error < 0) {
-               pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n",
-                        __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
-               gpio_free(OMAP4_SFH7741_ENABLE_GPIO);
-       }
  }
  
  static void sdp4430_hdmi_mux_init(void)
                        OMAP_PIN_INPUT_PULLUP);
  }
  
+ static struct gpio sdp4430_hdmi_gpios[] = {
+       { HDMI_GPIO_HPD,        GPIOF_OUT_INIT_HIGH,    "hdmi_gpio_hpd"   },
+       { HDMI_GPIO_LS_OE,      GPIOF_OUT_INIT_HIGH,    "hdmi_gpio_ls_oe" },
+ };
  static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
  {
        int status;
  
-       status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
-                                                       "hdmi_gpio_hpd");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
-               return status;
-       }
-       status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
-                                                       "hdmi_gpio_ls_oe");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
-               goto error1;
-       }
-       return 0;
- error1:
-       gpio_free(HDMI_GPIO_HPD);
+       status = gpio_request_array(sdp4430_hdmi_gpios,
+                                   ARRAY_SIZE(sdp4430_hdmi_gpios));
+       if (status)
+               pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
  
        return status;
  }
@@@ -680,15 -616,6 +616,15 @@@ static struct omap_dss_device sdp4430_h
        .name = "hdmi",
        .driver_name = "hdmi_panel",
        .type = OMAP_DISPLAY_TYPE_HDMI,
 +      .clocks = {
 +              .dispc  = {
 +                      .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
 +              },
 +              .hdmi   = {
 +                      .regn   = 15,
 +                      .regm2  = 1,
 +              },
 +      },
        .platform_enable = sdp4430_panel_enable_hdmi,
        .platform_disable = sdp4430_panel_disable_hdmi,
        .channel = OMAP_DSS_CHANNEL_DIGIT,
index ff8c59be36e5ff121fd6dcb0cda4efebfdf68da5,be44147d911a10cd580d8dceff8f60d0f1b2da92..63af4171c0436d85c3d7ea35d6a21679380414fa
@@@ -34,8 -34,8 +34,8 @@@
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  
  #include "mux.h"
  #include "control.h"
@@@ -174,19 -174,14 +174,14 @@@ static void __init am3517_evm_rtc_init(
        int r;
  
        omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP);
-       r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq");
+       r = gpio_request_one(GPIO_RTCS35390A_IRQ, GPIOF_IN, "rtcs35390a-irq");
        if (r < 0) {
                printk(KERN_WARNING "failed to request GPIO#%d\n",
                                GPIO_RTCS35390A_IRQ);
                return;
        }
-       r = gpio_direction_input(GPIO_RTCS35390A_IRQ);
-       if (r < 0) {
-               printk(KERN_WARNING "GPIO#%d cannot be configured as input\n",
-                               GPIO_RTCS35390A_IRQ);
-               gpio_free(GPIO_RTCS35390A_IRQ);
-               return;
-       }
        am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
  }
  
@@@ -242,6 -237,15 +237,15 @@@ static int dvi_enabled
  
  #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
                defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
+ static struct gpio am3517_evm_dss_gpios[] __initdata = {
+       /* GPIO 182 = LCD Backlight Power */
+       { LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
+       /* GPIO 181 = LCD Panel PWM */
+       { LCD_PANEL_PWM,         GPIOF_OUT_INIT_HIGH, "lcd bl enable"     },
+       /* GPIO 176 = LCD Panel Power enable pin */
+       { LCD_PANEL_PWR,         GPIOF_OUT_INIT_HIGH, "dvi enable"        },
+ };
  static void __init am3517_evm_display_init(void)
  {
        int r;
        omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
        omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
        omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
-       /*
-        * Enable GPIO 182 = LCD Backlight Power
-        */
-       r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr");
+       r = gpio_request_array(am3517_evm_dss_gpios,
+                              ARRAY_SIZE(am3517_evm_dss_gpios));
        if (r) {
-               printk(KERN_ERR "failed to get lcd_backlight_pwr\n");
+               printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
                return;
        }
-       gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1);
-       /*
-        * Enable GPIO 181 = LCD Panel PWM
-        */
-       r = gpio_request(LCD_PANEL_PWM, "lcd_pwm");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_pwm\n");
-               goto err_1;
-       }
-       gpio_direction_output(LCD_PANEL_PWM, 1);
-       /*
-        * Enable GPIO 176 = LCD Panel Power enable pin
-        */
-       r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_pwr\n");
-               goto err_2;
-       }
-       gpio_direction_output(LCD_PANEL_PWR, 1);
  
        printk(KERN_INFO "Display initialized successfully\n");
-       return;
- err_2:
-       gpio_free(LCD_PANEL_PWM);
- err_1:
-       gpio_free(LCD_PANEL_BKLIGHT_PWR);
  }
  #else
  static void __init am3517_evm_display_init(void) {}
@@@ -396,7 -374,7 +374,7 @@@ static struct omap_musb_board_data musb
        .power                  = 500,
        .set_phy_power          = am35x_musb_phy_power,
        .clear_irq              = am35x_musb_clear_irq,
-       .set_mode               = am35x_musb_set_mode,
+       .set_mode               = am35x_set_mode,
        .reset                  = am35x_musb_reset,
  };
  
index 9340f6a06f4a0a218bc56beb91508e9d22cdd0b6,6063be82b563e95a5e94acce63e010d90ef78554..c63115bc15368d7e953b3b784562f4a22c612ad2
@@@ -45,8 -45,8 +45,8 @@@
  #include <plat/nand.h>
  #include <plat/gpmc.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  #include <plat/mcspi.h>
  
  #include <mach/hardware.h>
@@@ -54,6 -54,7 +54,7 @@@
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
  #include "hsmmc.h"
+ #include "common-board-devices.h"
  
  #define CM_T35_GPIO_PENDOWN   57
  
  
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  #include <linux/smsc911x.h>
+ #include <plat/gpmc-smsc911x.h>
  
- static struct smsc911x_platform_config cm_t35_smsc911x_config = {
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
-       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
- };
- static struct resource cm_t35_smsc911x_resources[] = {
-       {
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO),
-               .end    = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO),
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
-       },
- };
- static struct platform_device cm_t35_smsc911x_device = {
-       .name           = "smsc911x",
+ static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = {
        .id             = 0,
-       .num_resources  = ARRAY_SIZE(cm_t35_smsc911x_resources),
-       .resource       = cm_t35_smsc911x_resources,
-       .dev            = {
-               .platform_data = &cm_t35_smsc911x_config,
-       },
- };
- static struct resource sb_t35_smsc911x_resources[] = {
-       {
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO),
-               .end    = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO),
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
-       },
+       .cs             = CM_T35_SMSC911X_CS,
+       .gpio_irq       = CM_T35_SMSC911X_GPIO,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  };
  
- static struct platform_device sb_t35_smsc911x_device = {
-       .name           = "smsc911x",
+ static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = {
        .id             = 1,
-       .num_resources  = ARRAY_SIZE(sb_t35_smsc911x_resources),
-       .resource       = sb_t35_smsc911x_resources,
-       .dev            = {
-               .platform_data = &cm_t35_smsc911x_config,
-       },
+       .cs             = SB_T35_SMSC911X_CS,
+       .gpio_irq       = SB_T35_SMSC911X_GPIO,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  };
  
- static void __init cm_t35_init_smsc911x(struct platform_device *dev,
-                                       int cs, int irq_gpio)
- {
-       unsigned long cs_mem_base;
-       if (gpmc_cs_request(cs, SZ_16M, &cs_mem_base) < 0) {
-               pr_err("CM-T35: Failed request for GPMC mem for smsc911x\n");
-               return;
-       }
-       dev->resource[0].start = cs_mem_base + 0x0;
-       dev->resource[0].end   = cs_mem_base + 0xff;
-       if ((gpio_request(irq_gpio, "ETH IRQ") == 0) &&
-           (gpio_direction_input(irq_gpio) == 0)) {
-               gpio_export(irq_gpio, 0);
-       } else {
-               pr_err("CM-T35: could not obtain gpio for SMSC911X IRQ\n");
-               return;
-       }
-       platform_device_register(dev);
- }
  static void __init cm_t35_init_ethernet(void)
  {
-       cm_t35_init_smsc911x(&cm_t35_smsc911x_device,
-                            CM_T35_SMSC911X_CS, CM_T35_SMSC911X_GPIO);
-       cm_t35_init_smsc911x(&sb_t35_smsc911x_device,
-                            SB_T35_SMSC911X_CS, SB_T35_SMSC911X_GPIO);
+       gpmc_smsc911x_init(&cm_t35_smsc911x_cfg);
+       gpmc_smsc911x_init(&sb_t35_smsc911x_cfg);
  }
  #else
  static inline void __init cm_t35_init_ethernet(void) { return; }
@@@ -235,69 -178,10 +178,10 @@@ static void __init cm_t35_init_nand(voi
  static inline void cm_t35_init_nand(void) {}
  #endif
  
- #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
-       defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
- #include <linux/spi/ads7846.h>
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(CM_T35_GPIO_PENDOWN);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 3,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
- };
- static struct spi_board_info cm_t35_spi_board_info[] __initdata = {
-       {
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &ads7846_mcspi_config,
-               .irq                    = OMAP_GPIO_IRQ(CM_T35_GPIO_PENDOWN),
-               .platform_data          = &ads7846_config,
-       },
- };
- static void __init cm_t35_init_ads7846(void)
- {
-       if ((gpio_request(CM_T35_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
-           (gpio_direction_input(CM_T35_GPIO_PENDOWN) == 0)) {
-               gpio_export(CM_T35_GPIO_PENDOWN, 0);
-       } else {
-               pr_err("CM-T35: could not obtain gpio for ADS7846_PENDOWN\n");
-               return;
-       }
-       spi_register_board_info(cm_t35_spi_board_info,
-                               ARRAY_SIZE(cm_t35_spi_board_info));
- }
- #else
- static inline void cm_t35_init_ads7846(void) {}
- #endif
  #define CM_T35_LCD_EN_GPIO 157
  #define CM_T35_LCD_BL_GPIO 58
  #define CM_T35_DVI_EN_GPIO 54
  
- static int lcd_bl_gpio;
- static int lcd_en_gpio;
- static int dvi_en_gpio;
  static int lcd_enabled;
  static int dvi_enabled;
  
@@@ -308,8 -192,8 +192,8 @@@ static int cm_t35_panel_enable_lcd(stru
                return -EINVAL;
        }
  
-       gpio_set_value(lcd_en_gpio, 1);
-       gpio_set_value(lcd_bl_gpio, 1);
+       gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
+       gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
  
        lcd_enabled = 1;
  
@@@ -320,8 -204,8 +204,8 @@@ static void cm_t35_panel_disable_lcd(st
  {
        lcd_enabled = 0;
  
-       gpio_set_value(lcd_bl_gpio, 0);
-       gpio_set_value(lcd_en_gpio, 0);
+       gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
+       gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
  }
  
  static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
                return -EINVAL;
        }
  
-       gpio_set_value(dvi_en_gpio, 0);
+       gpio_set_value(CM_T35_DVI_EN_GPIO, 0);
        dvi_enabled = 1;
  
        return 0;
  
  static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev)
  {
-       gpio_set_value(dvi_en_gpio, 1);
+       gpio_set_value(CM_T35_DVI_EN_GPIO, 1);
        dvi_enabled = 0;
  }
  
@@@ -421,62 -305,38 +305,38 @@@ static struct spi_board_info cm_t35_lcd
        },
  };
  
+ static struct gpio cm_t35_dss_gpios[] __initdata = {
+       { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,  "lcd enable"    },
+       { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW,  "lcd bl enable" },
+       { CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable"    },
+ };
  static void __init cm_t35_init_display(void)
  {
        int err;
  
-       lcd_en_gpio = CM_T35_LCD_EN_GPIO;
-       lcd_bl_gpio = CM_T35_LCD_BL_GPIO;
-       dvi_en_gpio = CM_T35_DVI_EN_GPIO;
        spi_register_board_info(cm_t35_lcd_spi_board_info,
                                ARRAY_SIZE(cm_t35_lcd_spi_board_info));
  
-       err = gpio_request(lcd_en_gpio, "LCD RST");
-       if (err) {
-               pr_err("CM-T35: failed to get LCD reset GPIO\n");
-               goto out;
-       }
-       err = gpio_request(lcd_bl_gpio, "LCD BL");
+       err = gpio_request_array(cm_t35_dss_gpios,
+                                ARRAY_SIZE(cm_t35_dss_gpios));
        if (err) {
-               pr_err("CM-T35: failed to get LCD backlight control GPIO\n");
-               goto err_lcd_bl;
-       }
-       err = gpio_request(dvi_en_gpio, "DVI EN");
-       if (err) {
-               pr_err("CM-T35: failed to get DVI reset GPIO\n");
-               goto err_dvi_en;
+               pr_err("CM-T35: failed to request DSS control GPIOs\n");
+               return;
        }
  
-       gpio_export(lcd_en_gpio, 0);
-       gpio_export(lcd_bl_gpio, 0);
-       gpio_export(dvi_en_gpio, 0);
-       gpio_direction_output(lcd_en_gpio, 0);
-       gpio_direction_output(lcd_bl_gpio, 0);
-       gpio_direction_output(dvi_en_gpio, 1);
+       gpio_export(CM_T35_LCD_EN_GPIO, 0);
+       gpio_export(CM_T35_LCD_BL_GPIO, 0);
+       gpio_export(CM_T35_DVI_EN_GPIO, 0);
  
        msleep(50);
-       gpio_set_value(lcd_en_gpio, 1);
+       gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
  
        err = omap_display_init(&cm_t35_dss_data);
        if (err) {
                pr_err("CM-T35: failed to register DSS device\n");
-               goto err_dev_reg;
+               gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
        }
-       return;
- err_dev_reg:
-       gpio_free(dvi_en_gpio);
- err_dvi_en:
-       gpio_free(lcd_bl_gpio);
- err_lcd_bl:
-       gpio_free(lcd_en_gpio);
- out:
-       return;
  }
  
  static struct regulator_consumer_supply cm_t35_vmmc1_supply = {
@@@ -609,10 -469,8 +469,8 @@@ static int cm_t35_twl_gpio_setup(struc
  {
        int wlan_rst = gpio + 2;
  
-       if ((gpio_request(wlan_rst, "WLAN RST") == 0) &&
-           (gpio_direction_output(wlan_rst, 1) == 0)) {
+       if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) {
                gpio_export(wlan_rst, 0);
                udelay(10);
                gpio_set_value(wlan_rst, 0);
                udelay(10);
@@@ -653,19 -511,9 +511,9 @@@ static struct twl4030_platform_data cm_
        .vpll2          = &cm_t35_vpll2,
  };
  
- static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("tps65930", 0x48),
-               .flags          = I2C_CLIENT_WAKE,
-               .irq            = INT_34XX_SYS_NIRQ,
-               .platform_data  = &cm_t35_twldata,
-       },
- };
  static void __init cm_t35_init_i2c(void)
  {
-       omap_register_i2c_bus(1, 2600, cm_t35_i2c_boardinfo,
-                             ARRAY_SIZE(cm_t35_i2c_boardinfo));
+       omap3_pmic_init("tps65930", &cm_t35_twldata);
  }
  
  static void __init cm_t35_init_early(void)
@@@ -775,12 -623,6 +623,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
  static struct omap_board_config_kernel cm_t35_config[] __initdata = {
  };
  
@@@ -792,12 -634,12 +634,12 @@@ static void __init cm_t35_init(void
        omap_serial_init();
        cm_t35_init_i2c();
        cm_t35_init_nand();
-       cm_t35_init_ads7846();
+       omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL);
        cm_t35_init_ethernet();
        cm_t35_init_led();
        cm_t35_init_display();
  
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
  }
  
index 1d1b56a29fb1cf89b2f506ede3304e953cdf64dc,3bd344a527e24940cb62bab4c6ac3b484b4bee80..cf520d7dd614a999879ebdb64ff1bda2c6d2ba44
  #include <plat/gpmc.h>
  #include <plat/nand.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  
  #include <plat/mcspi.h>
  #include <linux/input/matrix_keypad.h>
  #include <linux/spi/spi.h>
- #include <linux/spi/ads7846.h>
  #include <linux/dm9000.h>
  #include <linux/interrupt.h>
  
@@@ -60,6 -59,7 +59,7 @@@
  #include "mux.h"
  #include "hsmmc.h"
  #include "timer-gp.h"
+ #include "common-board-devices.h"
  
  #define NAND_BLOCK_SIZE               SZ_128K
  
@@@ -97,13 -97,6 +97,6 @@@ static struct mtd_partition devkit8000_
        },
  };
  
- static struct omap_nand_platform_data devkit8000_nand_data = {
-       .options        = NAND_BUSWIDTH_16,
-       .parts          = devkit8000_nand_partitions,
-       .nr_parts       = ARRAY_SIZE(devkit8000_nand_partitions),
-       .dma_channel    = -1,           /* disable DMA in OMAP NAND driver */
- };
  static struct omap2_hsmmc_info mmc[] = {
        {
                .mmc            = 1,
@@@ -249,7 -242,7 +242,7 @@@ static int devkit8000_twl_gpio_setup(st
        /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
        devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
        ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
-                       GPIOF_DIR_OUT | GPIOF_INIT_LOW, "LCD_PWREN");
+                              GPIOF_OUT_INIT_LOW, "LCD_PWREN");
        if (ret < 0) {
                devkit8000_lcd_device.reset_gpio = -EINVAL;
                printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
        /* gpio + 7 is "DVI_PD" (out, active low) */
        devkit8000_dvi_device.reset_gpio = gpio + 7;
        ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
-                       GPIOF_DIR_OUT | GPIOF_INIT_LOW, "DVI PowerDown");
+                              GPIOF_OUT_INIT_LOW, "DVI PowerDown");
        if (ret < 0) {
                devkit8000_dvi_device.reset_gpio = -EINVAL;
                printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
@@@ -366,19 -359,9 +359,9 @@@ static struct twl4030_platform_data dev
        .keypad         = &devkit8000_kp_data,
  };
  
- static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("tps65930", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &devkit8000_twldata,
-       },
- };
  static int __init devkit8000_i2c_init(void)
  {
-       omap_register_i2c_bus(1, 2600, devkit8000_i2c_boardinfo,
-                       ARRAY_SIZE(devkit8000_i2c_boardinfo));
+       omap3_pmic_init("tps65930", &devkit8000_twldata);
        /* Bus 3 is attached to the DVI port where devices like the pico DLP
         * projector don't work reliably with 400kHz */
        omap_register_i2c_bus(3, 400, NULL, 0);
@@@ -463,56 -446,6 +446,6 @@@ static void __init devkit8000_init_irq(
  #endif
  }
  
- static void __init devkit8000_ads7846_init(void)
- {
-       int gpio = OMAP3_DEVKIT_TS_GPIO;
-       int ret;
-       ret = gpio_request(gpio, "ads7846_pen_down");
-       if (ret < 0) {
-               printk(KERN_ERR "Failed to request GPIO %d for "
-                               "ads7846 pen down IRQ\n", gpio);
-               return;
-       }
-       gpio_direction_input(gpio);
- }
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(OMAP3_DEVKIT_TS_GPIO);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 5,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
-       .settle_delay_usecs     = 150,
- };
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
- static struct spi_board_info devkit8000_spi_board_info[] __initdata = {
-       {
-               .modalias               = "ads7846",
-               .bus_num                = 2,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &ads7846_mcspi_config,
-               .irq                    = OMAP_GPIO_IRQ(OMAP3_DEVKIT_TS_GPIO),
-               .platform_data          = &ads7846_config,
-       }
- };
  #define OMAP_DM9000_BASE      0x2c000000
  
  static struct resource omap_dm9000_resources[] = {
@@@ -550,14 -483,14 +483,14 @@@ static void __init omap_dm9000_init(voi
  {
        unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
        struct omap_die_id odi;
+       int ret;
  
-       if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
+       ret = gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq");
+       if (ret < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
                        OMAP_DM9000_GPIO_IRQ);
                return;
-               }
-       gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
+       }
  
        /* init the mac address using DIE id */
        omap_get_die_id(&odi);
@@@ -576,45 -509,6 +509,6 @@@ static struct platform_device *devkit80
        &omap_dm9000_dev,
  };
  
- static void __init devkit8000_flash_init(void)
- {
-       u8 cs = 0;
-       u8 nandcs = GPMC_CS_NUM + 1;
-       /* find out the chip-select on which NAND exists */
-       while (cs < GPMC_CS_NUM) {
-               u32 ret = 0;
-               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-               if ((ret & 0xC00) == 0x800) {
-                       printk(KERN_INFO "Found NAND on CS%d\n", cs);
-                       if (nandcs > GPMC_CS_NUM)
-                               nandcs = cs;
-               }
-               cs++;
-       }
-       if (nandcs > GPMC_CS_NUM) {
-               printk(KERN_INFO "NAND: Unable to find configuration "
-                                "in GPMC\n ");
-               return;
-       }
-       if (nandcs < GPMC_CS_NUM) {
-               devkit8000_nand_data.cs = nandcs;
-               printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
-               if (gpmc_nand_init(&devkit8000_nand_data) < 0)
-                       printk(KERN_ERR "Unable to register NAND device\n");
-       }
- }
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
  static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
  
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
@@@ -795,14 -689,13 +689,13 @@@ static void __init devkit8000_init(void
                        ARRAY_SIZE(devkit8000_devices));
  
        omap_display_init(&devkit8000_dss_data);
-       spi_register_board_info(devkit8000_spi_board_info,
-       ARRAY_SIZE(devkit8000_spi_board_info));
  
-       devkit8000_ads7846_init();
+       omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
  
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       devkit8000_flash_init();
+       omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
+                            ARRAY_SIZE(devkit8000_nand_partitions));
  
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index 3da64d361651a9077e84a990bcccbb4e1a297b3d,0d6d583e8b3cb0462cc0c900f1f664d0349c6d09..0c1bfca3f731cfdd4b8a9fa7aaa0793cca01e18b
  #include <plat/common.h>
  #include <plat/gpmc.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  #include <plat/onenand.h>
  
  #include "mux.h"
  #include "hsmmc.h"
  #include "sdram-numonyx-m65kxxxxam.h"
+ #include "common-board-devices.h"
  
  #define IGEP2_SMSC911X_CS       5
  #define IGEP2_SMSC911X_GPIO     176
  #define IGEP2_RC_GPIO_WIFI_NRESET  139
  #define IGEP2_RC_GPIO_BT_NRESET    137
  
+ #define IGEP3_GPIO_LED0_GREEN 54
+ #define IGEP3_GPIO_LED0_RED   53
+ #define IGEP3_GPIO_LED1_RED   16
+ #define IGEP3_GPIO_USBH_NRESET  183
  /*
   * IGEP2 Hardware Revision Table
   *
@@@ -68,6 -74,7 +74,7 @@@
  
  #define IGEP2_BOARD_HWREV_B   0
  #define IGEP2_BOARD_HWREV_C   1
+ #define IGEP3_BOARD_HWREV     2
  
  static u8 hwrev;
  
@@@ -75,24 -82,29 +82,29 @@@ static void __init igep2_get_revision(v
  {
        u8 ret;
  
+       if (machine_is_igep0030()) {
+               hwrev = IGEP3_BOARD_HWREV;
+               return;
+       }
        omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
  
-       if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_HW0_REV") == 0) &&
-           (gpio_direction_input(IGEP2_GPIO_LED1_RED) == 0)) {
-               ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
-               if (ret == 0) {
-                       pr_info("IGEP2: Hardware Revision C (B-NON compatible)\n");
-                       hwrev = IGEP2_BOARD_HWREV_C;
-               } else if (ret ==  1) {
-                       pr_info("IGEP2: Hardware Revision B/C (B compatible)\n");
-                       hwrev = IGEP2_BOARD_HWREV_B;
-               } else {
-                       pr_err("IGEP2: Unknown Hardware Revision\n");
-                       hwrev = -1;
-               }
-       } else {
+       if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
                pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV\n");
                pr_err("IGEP2: Unknown Hardware Revision\n");
+               return;
+       }
+       ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
+       if (ret == 0) {
+               pr_info("IGEP2: Hardware Revision C (B-NON compatible)\n");
+               hwrev = IGEP2_BOARD_HWREV_C;
+       } else if (ret ==  1) {
+               pr_info("IGEP2: Hardware Revision B/C (B compatible)\n");
+               hwrev = IGEP2_BOARD_HWREV_B;
+       } else {
+               pr_err("IGEP2: Unknown Hardware Revision\n");
+               hwrev = -1;
        }
  
        gpio_free(IGEP2_GPIO_LED1_RED);
   * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
   */
  
- static struct mtd_partition igep2_onenand_partitions[] = {
+ static struct mtd_partition igep_onenand_partitions[] = {
        {
                .name           = "X-Loader",
                .offset         = 0,
        },
  };
  
- static struct omap_onenand_platform_data igep2_onenand_data = {
-       .parts = igep2_onenand_partitions,
-       .nr_parts = ARRAY_SIZE(igep2_onenand_partitions),
+ static struct omap_onenand_platform_data igep_onenand_data = {
+       .parts = igep_onenand_partitions,
+       .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
        .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
  };
  
- static struct platform_device igep2_onenand_device = {
+ static struct platform_device igep_onenand_device = {
        .name           = "omap2-onenand",
        .id             = -1,
        .dev = {
-               .platform_data = &igep2_onenand_data,
+               .platform_data = &igep_onenand_data,
        },
  };
  
- static void __init igep2_flash_init(void)
+ static void __init igep_flash_init(void)
  {
        u8 cs = 0;
        u8 onenandcs = GPMC_CS_NUM + 1;
                /* Check if NAND/oneNAND is configured */
                if ((ret & 0xC00) == 0x800)
                        /* NAND found */
-                       pr_err("IGEP2: Unsupported NAND found\n");
+                       pr_err("IGEP: Unsupported NAND found\n");
                else {
                        ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
                        if ((ret & 0x3F) == (ONENAND_MAP >> 24))
        }
  
        if (onenandcs > GPMC_CS_NUM) {
-               pr_err("IGEP2: Unable to find configuration in GPMC\n");
+               pr_err("IGEP: Unable to find configuration in GPMC\n");
                return;
        }
  
-       igep2_onenand_data.cs = onenandcs;
+       igep_onenand_data.cs = onenandcs;
  
-       if (platform_device_register(&igep2_onenand_device) < 0)
-               pr_err("IGEP2: Unable to register OneNAND device\n");
+       if (platform_device_register(&igep_onenand_device) < 0)
+               pr_err("IGEP: Unable to register OneNAND device\n");
  }
  
  #else
- static void __init igep2_flash_init(void) {}
+ static void __init igep_flash_init(void) {}
  #endif
  
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  
  #include <linux/smsc911x.h>
+ #include <plat/gpmc-smsc911x.h>
  
- static struct smsc911x_platform_config igep2_smsc911x_config = {
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
-       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS  ,
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
- };
- static struct resource igep2_smsc911x_resources[] = {
-       {
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
-               .end    = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
-       },
- };
- static struct platform_device igep2_smsc911x_device = {
-       .name           = "smsc911x",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(igep2_smsc911x_resources),
-       .resource       = igep2_smsc911x_resources,
-       .dev            = {
-               .platform_data = &igep2_smsc911x_config,
-       },
+ static struct omap_smsc911x_platform_data smsc911x_cfg = {
+       .cs             = IGEP2_SMSC911X_CS,
+       .gpio_irq       = IGEP2_SMSC911X_GPIO,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  };
  
  static inline void __init igep2_init_smsc911x(void)
  {
-       unsigned long cs_mem_base;
-       if (gpmc_cs_request(IGEP2_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
-               pr_err("IGEP v2: Failed request for GPMC mem for smsc911x\n");
-               gpmc_cs_free(IGEP2_SMSC911X_CS);
-               return;
-       }
-       igep2_smsc911x_resources[0].start = cs_mem_base + 0x0;
-       igep2_smsc911x_resources[0].end   = cs_mem_base + 0xff;
-       if ((gpio_request(IGEP2_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
-           (gpio_direction_input(IGEP2_SMSC911X_GPIO) == 0)) {
-               gpio_export(IGEP2_SMSC911X_GPIO, 0);
-       } else {
-               pr_err("IGEP v2: Could not obtain gpio for for SMSC911X IRQ\n");
-               return;
-       }
-       platform_device_register(&igep2_smsc911x_device);
+       gpmc_smsc911x_init(&smsc911x_cfg);
  }
  
  #else
  static inline void __init igep2_init_smsc911x(void) { }
  #endif
  
- static struct regulator_consumer_supply igep2_vmmc1_supply =
+ static struct regulator_consumer_supply igep_vmmc1_supply =
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
  
  /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
- static struct regulator_init_data igep2_vmmc1 = {
+ static struct regulator_init_data igep_vmmc1 = {
        .constraints = {
                .min_uV                 = 1850000,
                .max_uV                 = 3150000,
                                        | REGULATOR_CHANGE_STATUS,
        },
        .num_consumer_supplies  = 1,
-       .consumer_supplies      = &igep2_vmmc1_supply,
+       .consumer_supplies      = &igep_vmmc1_supply,
  };
  
- static struct regulator_consumer_supply igep2_vio_supply =
+ static struct regulator_consumer_supply igep_vio_supply =
        REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
  
- static struct regulator_init_data igep2_vio = {
+ static struct regulator_init_data igep_vio = {
        .constraints = {
                .min_uV                 = 1800000,
                .max_uV                 = 1800000,
                                        | REGULATOR_CHANGE_STATUS,
        },
        .num_consumer_supplies  = 1,
-       .consumer_supplies      = &igep2_vio_supply,
+       .consumer_supplies      = &igep_vio_supply,
  };
  
- static struct regulator_consumer_supply igep2_vmmc2_supply =
+ static struct regulator_consumer_supply igep_vmmc2_supply =
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
  
- static struct regulator_init_data igep2_vmmc2 = {
+ static struct regulator_init_data igep_vmmc2 = {
        .constraints            = {
                .valid_modes_mask       = REGULATOR_MODE_NORMAL,
                .always_on              = 1,
        },
        .num_consumer_supplies  = 1,
-       .consumer_supplies      = &igep2_vmmc2_supply,
+       .consumer_supplies      = &igep_vmmc2_supply,
  };
  
- static struct fixed_voltage_config igep2_vwlan = {
+ static struct fixed_voltage_config igep_vwlan = {
        .supply_name            = "vwlan",
        .microvolts             = 3300000,
        .gpio                   = -EINVAL,
        .enabled_at_boot        = 1,
-       .init_data              = &igep2_vmmc2,
+       .init_data              = &igep_vmmc2,
  };
  
- static struct platform_device igep2_vwlan_device = {
+ static struct platform_device igep_vwlan_device = {
        .name           = "reg-fixed-voltage",
        .id             = 0,
        .dev = {
-               .platform_data  = &igep2_vwlan,
+               .platform_data  = &igep_vwlan,
        },
  };
  
@@@ -334,20 -307,17 +307,17 @@@ static struct omap2_hsmmc_info mmc[] = 
  #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  #include <linux/leds.h>
  
- static struct gpio_led igep2_gpio_leds[] = {
+ static struct gpio_led igep_gpio_leds[] = {
        [0] = {
                .name                   = "gpio-led:red:d0",
-               .gpio                   = IGEP2_GPIO_LED0_RED,
                .default_trigger        = "default-off"
        },
        [1] = {
                .name                   = "gpio-led:green:d0",
-               .gpio                   = IGEP2_GPIO_LED0_GREEN,
                .default_trigger        = "default-off",
        },
        [2] = {
                .name                   = "gpio-led:red:d1",
-               .gpio                   = IGEP2_GPIO_LED1_RED,
                .default_trigger        = "default-off",
        },
        [3] = {
        },
  };
  
- static struct gpio_led_platform_data igep2_led_pdata = {
-       .leds           = igep2_gpio_leds,
-       .num_leds       = ARRAY_SIZE(igep2_gpio_leds),
+ static struct gpio_led_platform_data igep_led_pdata = {
+       .leds           = igep_gpio_leds,
+       .num_leds       = ARRAY_SIZE(igep_gpio_leds),
  };
  
- static struct platform_device igep2_led_device = {
+ static struct platform_device igep_led_device = {
         .name   = "leds-gpio",
         .id     = -1,
         .dev    = {
-                .platform_data  =  &igep2_led_pdata,
+                .platform_data  =  &igep_led_pdata,
        },
  };
  
- static void __init igep2_leds_init(void)
+ static void __init igep_leds_init(void)
  {
-       platform_device_register(&igep2_led_device);
+       if (machine_is_igep0020()) {
+               igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
+               igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
+               igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
+       } else {
+               igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
+               igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
+               igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
+       }
+       platform_device_register(&igep_led_device);
  }
  
  #else
- static inline void igep2_leds_init(void)
+ static struct gpio igep_gpio_leds[] __initdata = {
+       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d0"   },
+       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
+       { -EINVAL,      GPIOF_OUT_INIT_LOW, "gpio-led:red:d1"   },
+ };
+ static inline void igep_leds_init(void)
  {
-       if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
-           (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0))
-               gpio_export(IGEP2_GPIO_LED0_RED, 0);
-       else
-               pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
+       int i;
  
-       if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
-           (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0))
-               gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
-       else
-               pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
+       if (machine_is_igep0020()) {
+               igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
+               igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
+               igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
+       } else {
+               igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
+               igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
+               igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
+       }
  
-       if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
-           (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0))
-               gpio_export(IGEP2_GPIO_LED1_RED, 0);
-       else
-               pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
+       if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
+               pr_warning("IGEP v2: Could not obtain leds gpios\n");
+               return;
+       }
  
+       for (i = 0; i < ARRAY_SIZE(igep_gpio_leds); i++)
+               gpio_export(igep_gpio_leds[i].gpio, 0);
  }
  #endif
  
- static int igep2_twl_gpio_setup(struct device *dev,
+ static struct gpio igep2_twl_gpios[] = {
+       { -EINVAL, GPIOF_IN,            "GPIO_EHCI_NOC"  },
+       { -EINVAL, GPIOF_OUT_INIT_LOW,  "GPIO_USBH_CPEN" },
+ };
+ static int igep_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
  {
+       int ret;
        /* gpio + 0 is "mmc0_cd" (input/IRQ) */
        mmc[0].gpio_cd = gpio + 0;
        omap2_hsmmc_init(mmc);
  
-       /*
-        * REVISIT: need ehci-omap hooks for external VBUS
-        * power switch and overcurrent detect
-        */
-       if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
-           (gpio_direction_input(gpio + 1) < 0))
-               pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
-       /*
-        * TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN
-        * (out, active low)
-        */
-       if ((gpio_request(gpio + TWL4030_GPIO_MAX, "GPIO_USBH_CPEN") < 0) ||
-           (gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0) < 0))
-               pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
        /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
  #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
-       if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
-           && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0))
+       ret = gpio_request_one(gpio + TWL4030_GPIO_MAX + 1, GPIOF_OUT_INIT_HIGH,
+                              "gpio-led:green:d1");
+       if (ret == 0)
                gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
        else
-               pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
+               pr_warning("IGEP: Could not obtain gpio GPIO_LED1_GREEN\n");
  #else
-       igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
+       igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
  #endif
  
+       if (machine_is_igep0030())
+               return 0;
+       /*
+        * REVISIT: need ehci-omap hooks for external VBUS
+        * power switch and overcurrent detect
+        */
+       igep2_twl_gpios[0].gpio = gpio + 1;
+       /* TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN (out, active low) */
+       igep2_twl_gpios[1].gpio = gpio + TWL4030_GPIO_MAX;
+       ret = gpio_request_array(igep2_twl_gpios, ARRAY_SIZE(igep2_twl_gpios));
+       if (ret < 0)
+               pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
        return 0;
  };
  
- static struct twl4030_gpio_platform_data igep2_twl4030_gpio_pdata = {
+ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
        .gpio_base      = OMAP_MAX_GPIO_LINES,
        .irq_base       = TWL4030_GPIO_IRQ_BASE,
        .irq_end        = TWL4030_GPIO_IRQ_END,
        .use_leds       = true,
-       .setup          = igep2_twl_gpio_setup,
+       .setup          = igep_twl_gpio_setup,
  };
  
- static struct twl4030_usb_data igep2_usb_data = {
+ static struct twl4030_usb_data igep_usb_data = {
        .usb_mode       = T2_USB_MODE_ULPI,
  };
  
@@@ -507,16 -502,17 +502,17 @@@ static struct regulator_init_data igep2
  
  static void __init igep2_display_init(void)
  {
-       if (gpio_request(IGEP2_GPIO_DVI_PUP, "GPIO_DVI_PUP") &&
-           gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1))
+       int err = gpio_request_one(IGEP2_GPIO_DVI_PUP, GPIOF_OUT_INIT_HIGH,
+                                  "GPIO_DVI_PUP");
+       if (err)
                pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
  }
  
- static struct platform_device *igep2_devices[] __initdata = {
-       &igep2_vwlan_device,
+ static struct platform_device *igep_devices[] __initdata = {
+       &igep_vwlan_device,
  };
  
- static void __init igep2_init_early(void)
+ static void __init igep_init_early(void)
  {
        omap2_init_common_infrastructure();
        omap2_init_common_devices(m65kxxxxam_sdrc_params,
@@@ -561,27 -557,15 +557,15 @@@ static struct twl4030_keypad_data igep2
        .rep            = 1,
  };
  
- static struct twl4030_platform_data igep2_twldata = {
+ static struct twl4030_platform_data igep_twldata = {
        .irq_base       = TWL4030_IRQ_BASE,
        .irq_end        = TWL4030_IRQ_END,
  
        /* platform_data for children goes here */
-       .usb            = &igep2_usb_data,
-       .codec          = &igep2_codec_data,
-       .gpio           = &igep2_twl4030_gpio_pdata,
-       .keypad         = &igep2_keypad_pdata,
-       .vmmc1          = &igep2_vmmc1,
-       .vpll2          = &igep2_vpll2,
-       .vio            = &igep2_vio,
- };
- static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl4030", 0x48),
-               .flags          = I2C_CLIENT_WAKE,
-               .irq            = INT_34XX_SYS_NIRQ,
-               .platform_data  = &igep2_twldata,
-       },
+       .usb            = &igep_usb_data,
+       .gpio           = &igep_twl4030_gpio_pdata,
+       .vmmc1          = &igep_vmmc1,
+       .vio            = &igep_vio,
  };
  
  static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
        },
  };
  
- static void __init igep2_i2c_init(void)
+ static void __init igep_i2c_init(void)
  {
        int ret;
  
-       ret = omap_register_i2c_bus(1, 2600, igep2_i2c1_boardinfo,
-               ARRAY_SIZE(igep2_i2c1_boardinfo));
-       if (ret)
-               pr_warning("IGEP2: Could not register I2C1 bus (%d)\n", ret);
+       if (machine_is_igep0020()) {
+               /*
+                * Bus 3 is attached to the DVI port where devices like the
+                * pico DLP projector don't work reliably with 400kHz
+                */
+               ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
+                                           ARRAY_SIZE(igep2_i2c3_boardinfo));
+               if (ret)
+                       pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
+               igep_twldata.codec      = &igep2_codec_data;
+               igep_twldata.keypad     = &igep2_keypad_pdata;
+               igep_twldata.vpll2      = &igep2_vpll2;
+       }
  
-       /*
-        * Bus 3 is attached to the DVI port where devices like the pico DLP
-        * projector don't work reliably with 400kHz
-        */
-       ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
-               ARRAY_SIZE(igep2_i2c3_boardinfo));
-       if (ret)
-               pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
+       omap3_pmic_init("twl4030", &igep_twldata);
  }
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
- static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
+ static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
        .reset_gpio_port[2] = -EINVAL,
  };
  
+ static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = {
+       .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
  static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
  #endif
  
  #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
+ static struct gpio igep_wlan_bt_gpios[] __initdata = {
+       { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NPD"    },
+       { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NRESET" },
+       { -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_BT_NRESET"   },
+ };
  
- static void __init igep2_wlan_bt_init(void)
+ static void __init igep_wlan_bt_init(void)
  {
-       unsigned npd, wreset, btreset;
+       int err;
  
        /* GPIO's for WLAN-BT combo depends on hardware revision */
        if (hwrev == IGEP2_BOARD_HWREV_B) {
-               npd = IGEP2_RB_GPIO_WIFI_NPD;
-               wreset = IGEP2_RB_GPIO_WIFI_NRESET;
-               btreset = IGEP2_RB_GPIO_BT_NRESET;
-       } else if (hwrev == IGEP2_BOARD_HWREV_C) {
-               npd = IGEP2_RC_GPIO_WIFI_NPD;
-               wreset = IGEP2_RC_GPIO_WIFI_NRESET;
-               btreset = IGEP2_RC_GPIO_BT_NRESET;
+               igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD;
+               igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET;
+               igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET;
+       } else if (hwrev == IGEP2_BOARD_HWREV_C || machine_is_igep0030()) {
+               igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD;
+               igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET;
+               igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET;
        } else
                return;
  
-       /* Set GPIO's for  WLAN-BT combo module */
-       if ((gpio_request(npd, "GPIO_WIFI_NPD") == 0) &&
-           (gpio_direction_output(npd, 1) == 0)) {
-               gpio_export(npd, 0);
-       } else
-               pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NPD\n");
-       if ((gpio_request(wreset, "GPIO_WIFI_NRESET") == 0) &&
-           (gpio_direction_output(wreset, 1) == 0)) {
-               gpio_export(wreset, 0);
-               gpio_set_value(wreset, 0);
-               udelay(10);
-               gpio_set_value(wreset, 1);
-       } else
-               pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NRESET\n");
+       err = gpio_request_array(igep_wlan_bt_gpios,
+                                ARRAY_SIZE(igep_wlan_bt_gpios));
+       if (err) {
+               pr_warning("IGEP2: Could not obtain WIFI/BT gpios\n");
+               return;
+       }
+       gpio_export(igep_wlan_bt_gpios[0].gpio, 0);
+       gpio_export(igep_wlan_bt_gpios[1].gpio, 0);
+       gpio_export(igep_wlan_bt_gpios[2].gpio, 0);
+       gpio_set_value(igep_wlan_bt_gpios[1].gpio, 0);
+       udelay(10);
+       gpio_set_value(igep_wlan_bt_gpios[1].gpio, 1);
  
-       if ((gpio_request(btreset, "GPIO_BT_NRESET") == 0) &&
-           (gpio_direction_output(btreset, 1) == 0)) {
-               gpio_export(btreset, 0);
-       } else
-               pr_warning("IGEP2: Could not obtain gpio GPIO_BT_NRESET\n");
  }
  #else
- static inline void __init igep2_wlan_bt_init(void) { }
+ static inline void __init igep_wlan_bt_init(void) { }
  #endif
  
- static void __init igep2_init(void)
+ static void __init igep_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  
        /* Get IGEP2 hardware revision */
        igep2_get_revision();
        /* Register I2C busses and drivers */
-       igep2_i2c_init();
-       platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
-       omap_display_init(&igep2_dss_data);
+       igep_i2c_init();
+       platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices));
        omap_serial_init();
-       usb_musb_init(&musb_board_data);
-       usbhs_init(&usbhs_bdata);
+       usb_musb_init(NULL);
  
-       igep2_flash_init();
-       igep2_leds_init();
-       igep2_display_init();
-       igep2_init_smsc911x();
+       igep_flash_init();
+       igep_leds_init();
  
        /*
         * WLAN-BT combo module from MuRata which has a Marvell WLAN
         * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface.
         */
-       igep2_wlan_bt_init();
+       igep_wlan_bt_init();
  
+       if (machine_is_igep0020()) {
+               omap_display_init(&igep2_dss_data);
+               igep2_display_init();
+               igep2_init_smsc911x();
+               usbhs_init(&igep2_usbhs_bdata);
+       } else {
+               usbhs_init(&igep3_usbhs_bdata);
+       }
  }
  
  MACHINE_START(IGEP0020, "IGEP v2 board")
        .boot_params    = 0x80000100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
-       .init_early     = igep2_init_early,
+       .init_early     = igep_init_early,
+       .init_irq       = omap_init_irq,
+       .init_machine   = igep_init,
+       .timer          = &omap_timer,
+ MACHINE_END
+ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
+       .boot_params    = 0x80000100,
+       .reserve        = omap_reserve,
+       .map_io         = omap3_map_io,
+       .init_early     = igep_init_early,
        .init_irq       = omap_init_irq,
-       .init_machine   = igep2_init,
+       .init_machine   = igep_init,
        .timer          = &omap_timer,
  MACHINE_END
index 97750d483a701e7a9cbdf0a78fe69f16aa9510c1,3ff3a2c4b86edf7de57c2b8347297f2370c0b70a..be71426359f2ecda9644f41a7e6cd6e64ab6e58b
@@@ -41,8 -41,8 +41,8 @@@
  
  #include <plat/board.h>
  #include <plat/common.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  #include <plat/gpmc.h>
  #include <plat/nand.h>
  #include <plat/usb.h>
@@@ -52,6 -52,7 +52,7 @@@
  #include "hsmmc.h"
  #include "timer-gp.h"
  #include "pm.h"
+ #include "common-board-devices.h"
  
  #define NAND_BLOCK_SIZE               SZ_128K
  
@@@ -79,6 -80,12 +80,12 @@@ static u8 omap3_beagle_get_rev(void
        return omap3_beagle_version;
  }
  
+ static struct gpio omap3_beagle_rev_gpios[] __initdata = {
+       { 171, GPIOF_IN, "rev_id_0"    },
+       { 172, GPIOF_IN, "rev_id_1" },
+       { 173, GPIOF_IN, "rev_id_2"    },
+ };
  static void __init omap3_beagle_init_rev(void)
  {
        int ret;
        omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP);
        omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP);
  
-       ret = gpio_request(171, "rev_id_0");
-       if (ret < 0)
-               goto fail0;
-       ret = gpio_request(172, "rev_id_1");
-       if (ret < 0)
-               goto fail1;
-       ret = gpio_request(173, "rev_id_2");
-       if (ret < 0)
-               goto fail2;
-       gpio_direction_input(171);
-       gpio_direction_input(172);
-       gpio_direction_input(173);
+       ret = gpio_request_array(omap3_beagle_rev_gpios,
+                                ARRAY_SIZE(omap3_beagle_rev_gpios));
+       if (ret < 0) {
+               printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
+               omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
+               return;
+       }
  
        beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1)
                        | (gpio_get_value(173) << 2);
                printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
                omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
        }
-       return;
- fail2:
-       gpio_free(172);
- fail1:
-       gpio_free(171);
- fail0:
-       printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
-       omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
-       return;
  }
  
  static struct mtd_partition omap3beagle_nand_partitions[] = {
        },
  };
  
- static struct omap_nand_platform_data omap3beagle_nand_data = {
-       .options        = NAND_BUSWIDTH_16,
-       .parts          = omap3beagle_nand_partitions,
-       .nr_parts       = ARRAY_SIZE(omap3beagle_nand_partitions),
-       .dma_channel    = -1,           /* disable DMA in OMAP NAND driver */
-       .nand_setup     = NULL,
-       .dev_ready      = NULL,
- };
  /* DSS */
  
  static int beagle_enable_dvi(struct omap_dss_device *dssdev)
@@@ -243,13 -221,10 +221,10 @@@ static void __init beagle_display_init(
  {
        int r;
  
-       r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
-       if (r < 0) {
+       r = gpio_request_one(beagle_dvi_device.reset_gpio, GPIOF_OUT_INIT_LOW,
+                            "DVI reset");
+       if (r < 0)
                printk(KERN_ERR "Unable to get DVI reset GPIO\n");
-               return;
-       }
-       gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
  }
  
  #include "sdram-micron-mt46h32m32lf-6.h"
@@@ -276,7 -251,7 +251,7 @@@ static struct gpio_led gpio_leds[]
  static int beagle_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
  {
-       int r;
+       int r, usb_pwr_level;
  
        if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
                mmc[0].gpio_wp = -EINVAL;
        beagle_vmmc1_supply.dev = mmc[0].dev;
        beagle_vsim_supply.dev = mmc[0].dev;
  
-       /* REVISIT: need ehci-omap hooks for external VBUS
-        * power switch and overcurrent detect
-        */
-       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
-               r = gpio_request(gpio + 1, "EHCI_nOC");
-               if (!r) {
-                       r = gpio_direction_input(gpio + 1);
-                       if (r)
-                               gpio_free(gpio + 1);
-               }
-               if (r)
-                       pr_err("%s: unable to configure EHCI_nOC\n", __func__);
-       }
        /*
         * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
         * high / others active low)
-        */
-       gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
-       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
-               gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
-       else
-               gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
-       /* DVI reset GPIO is different between beagle revisions */
-       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
-               beagle_dvi_device.reset_gpio = 129;
-       else
-               beagle_dvi_device.reset_gpio = 170;
-       /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
-       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
-       /*
-        * gpio + 1 on Xm controls the TFP410's enable line (active low)
-        * gpio + 2 control varies depending on the board rev as follows:
-        * P7/P8 revisions(prototype): Camera EN
-        * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
+        * DVI reset GPIO is different between beagle revisions
         */
        if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
-               r = gpio_request(gpio + 1, "nDVI_PWR_EN");
-               if (!r) {
-                       r = gpio_direction_output(gpio + 1, 0);
-                       if (r)
-                               gpio_free(gpio + 1);
-               }
+               usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+               beagle_dvi_device.reset_gpio = 129;
+               /*
+                * gpio + 1 on Xm controls the TFP410's enable line (active low)
+                * gpio + 2 control varies depending on the board rev as below:
+                * P7/P8 revisions(prototype): Camera EN
+                * A2+ revisions (production): LDO (DVI, serial, led blocks)
+                */
+               r = gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW,
+                                    "nDVI_PWR_EN");
                if (r)
                        pr_err("%s: unable to configure nDVI_PWR_EN\n",
                                __func__);
-               r = gpio_request(gpio + 2, "DVI_LDO_EN");
-               if (!r) {
-                       r = gpio_direction_output(gpio + 2, 1);
-                       if (r)
-                               gpio_free(gpio + 2);
-               }
+               r = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
+                                    "DVI_LDO_EN");
                if (r)
                        pr_err("%s: unable to configure DVI_LDO_EN\n",
                                __func__);
+       } else {
+               usb_pwr_level = GPIOF_OUT_INIT_LOW;
+               beagle_dvi_device.reset_gpio = 170;
+               /*
+                * REVISIT: need ehci-omap hooks for external VBUS
+                * power switch and overcurrent detect
+                */
+               if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"))
+                       pr_err("%s: unable to configure EHCI_nOC\n", __func__);
        }
  
+       gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
+       /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
        return 0;
  }
  
@@@ -453,15 -408,6 +408,6 @@@ static struct twl4030_platform_data bea
        .vpll2          = &beagle_vpll2,
  };
  
- static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl4030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &beagle_twldata,
-       },
- };
  static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
         {
                 I2C_BOARD_INFO("eeprom", 0x50),
  
  static int __init omap3_beagle_i2c_init(void)
  {
-       omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
-                       ARRAY_SIZE(beagle_i2c_boardinfo));
+       omap3_pmic_init("twl4030", &beagle_twldata);
        /* Bus 3 is attached to the DVI port where devices like the pico DLP
         * projector don't work reliably with 400kHz */
        omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
@@@ -551,39 -496,6 +496,6 @@@ static struct platform_device *omap3_be
        &keys_gpio,
  };
  
- static void __init omap3beagle_flash_init(void)
- {
-       u8 cs = 0;
-       u8 nandcs = GPMC_CS_NUM + 1;
-       /* find out the chip-select on which NAND exists */
-       while (cs < GPMC_CS_NUM) {
-               u32 ret = 0;
-               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-               if ((ret & 0xC00) == 0x800) {
-                       printk(KERN_INFO "Found NAND on CS%d\n", cs);
-                       if (nandcs > GPMC_CS_NUM)
-                               nandcs = cs;
-               }
-               cs++;
-       }
-       if (nandcs > GPMC_CS_NUM) {
-               printk(KERN_INFO "NAND: Unable to find configuration "
-                                "in GPMC\n ");
-               return;
-       }
-       if (nandcs < GPMC_CS_NUM) {
-               omap3beagle_nand_data.cs = nandcs;
-               printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
-               if (gpmc_nand_init(&omap3beagle_nand_data) < 0)
-                       printk(KERN_ERR "Unable to register NAND device\n");
-       }
- }
  static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
  
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
@@@ -602,12 -514,6 +514,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
  static void __init beagle_opp_init(void)
  {
        int r = 0;
@@@ -665,13 -571,13 +571,13 @@@ static void __init omap3_beagle_init(vo
        omap_serial_init();
  
        omap_mux_init_gpio(170, OMAP_PIN_INPUT);
-       gpio_request(170, "DVI_nPD");
        /* REVISIT leave DVI powered down until it's needed ... */
-       gpio_direction_output(170, true);
+       gpio_request_one(170, GPIOF_OUT_INIT_HIGH, "DVI_nPD");
  
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap3beagle_flash_init();
+       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
+                            ARRAY_SIZE(omap3beagle_nand_partitions));
  
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index 7f94cccdb07685a9826fc9467eaedba0c438998d,02e1ad29e1e8fbb43854d32bff7f61872dbfc7ef..b4d43464a303f43e5a6283c61dd09b55f657d624
  #include <plat/usb.h>
  #include <plat/common.h>
  #include <plat/mcspi.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
  #include "hsmmc.h"
+ #include "common-board-devices.h"
  
  #define OMAP3_EVM_TS_GPIO     175
  #define OMAP3_EVM_EHCI_VBUS   22
@@@ -101,49 -102,20 +102,20 @@@ static void __init omap3_evm_get_revisi
  }
  
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
- static struct resource omap3evm_smsc911x_resources[] = {
-       [0] =   {
-               .start  = OMAP3EVM_ETHR_START,
-               .end    = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] =   {
-               .start  = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
-               .end    = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
-               .flags  = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
-       },
- };
+ #include <plat/gpmc-smsc911x.h>
  
- static struct smsc911x_platform_config smsc911x_config = {
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
-       .flags          = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
- };
- static struct platform_device omap3evm_smsc911x_device = {
-       .name           = "smsc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(omap3evm_smsc911x_resources),
-       .resource       = &omap3evm_smsc911x_resources[0],
-       .dev            = {
-               .platform_data = &smsc911x_config,
-       },
+ static struct omap_smsc911x_platform_data smsc911x_cfg = {
+       .cs             = OMAP3EVM_SMSC911X_CS,
+       .gpio_irq       = OMAP3EVM_ETHR_GPIO_IRQ,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  };
  
  static inline void __init omap3evm_init_smsc911x(void)
  {
-       int eth_cs, eth_rst;
        struct clk *l3ck;
        unsigned int rate;
  
-       if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
-               eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
-       else
-               eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
-       eth_cs = OMAP3EVM_SMSC911X_CS;
        l3ck = clk_get(NULL, "l3_ck");
        if (IS_ERR(l3ck))
                rate = 100000000;
  
        /* Configure ethernet controller reset gpio */
        if (cpu_is_omap3430()) {
-               if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
-                       pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
-                                       eth_rst);
-                       return;
-               }
-               if (gpio_direction_output(eth_rst, 1) < 0) {
-                       pr_err(KERN_ERR "Failed to set direction of %d for" \
-                                       " smsc911x\n", eth_rst);
-                       return;
-               }
-               /* reset pulse to ethernet controller*/
-               usleep_range(150, 220);
-               gpio_set_value(eth_rst, 0);
-               usleep_range(150, 220);
-               gpio_set_value(eth_rst, 1);
-               usleep_range(1, 2);
-       }
-       if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
-               printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
-                       OMAP3EVM_ETHR_GPIO_IRQ);
-               return;
+               if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
+                       smsc911x_cfg.gpio_reset = OMAP3EVM_GEN1_ETHR_GPIO_RST;
+               else
+                       smsc911x_cfg.gpio_reset = OMAP3EVM_GEN2_ETHR_GPIO_RST;
        }
  
-       gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
-       platform_device_register(&omap3evm_smsc911x_device);
+       gpmc_smsc911x_init(&smsc911x_cfg);
  }
  
  #else
@@@ -197,6 -149,15 +149,15 @@@ static inline void __init omap3evm_init
  #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO       210
  #define OMAP3EVM_DVI_PANEL_EN_GPIO    199
  
+ static struct gpio omap3_evm_dss_gpios[] __initdata = {
+       { OMAP3EVM_LCD_PANEL_RESB,  GPIOF_OUT_INIT_HIGH, "lcd_panel_resb"  },
+       { OMAP3EVM_LCD_PANEL_INI,   GPIOF_OUT_INIT_HIGH, "lcd_panel_ini"   },
+       { OMAP3EVM_LCD_PANEL_QVGA,  GPIOF_OUT_INIT_LOW,  "lcd_panel_qvga"  },
+       { OMAP3EVM_LCD_PANEL_LR,    GPIOF_OUT_INIT_HIGH, "lcd_panel_lr"    },
+       { OMAP3EVM_LCD_PANEL_UD,    GPIOF_OUT_INIT_HIGH, "lcd_panel_ud"    },
+       { OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW,  "lcd_panel_envdd" },
+ };
  static int lcd_enabled;
  static int dvi_enabled;
  
@@@ -204,61 -165,10 +165,10 @@@ static void __init omap3_evm_display_in
  {
        int r;
  
-       r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_resb\n");
-               return;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1);
-       r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_ini\n");
-               goto err_1;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1);
-       r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_qvga\n");
-               goto err_2;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0);
-       r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_lr\n");
-               goto err_3;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1);
-       r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_ud\n");
-               goto err_4;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1);
-       r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd");
-       if (r) {
-               printk(KERN_ERR "failed to get lcd_panel_envdd\n");
-               goto err_5;
-       }
-       gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0);
-       return;
- err_5:
-       gpio_free(OMAP3EVM_LCD_PANEL_UD);
- err_4:
-       gpio_free(OMAP3EVM_LCD_PANEL_LR);
- err_3:
-       gpio_free(OMAP3EVM_LCD_PANEL_QVGA);
- err_2:
-       gpio_free(OMAP3EVM_LCD_PANEL_INI);
- err_1:
-       gpio_free(OMAP3EVM_LCD_PANEL_RESB);
+       r = gpio_request_array(omap3_evm_dss_gpios,
+                              ARRAY_SIZE(omap3_evm_dss_gpios));
+       if (r)
+               printk(KERN_ERR "failed to get lcd_panel_* gpios\n");
  }
  
  static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
@@@ -448,7 -358,7 +358,7 @@@ static struct platform_device leds_gpi
  static int omap3evm_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
  {
-       int r;
+       int r, lcd_bl_en;
  
        /* gpio + 0 is "mmc0_cd" (input/IRQ) */
        omap_mux_init_gpio(63, OMAP_PIN_INPUT);
         */
  
        /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
-       r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
-       if (!r)
-               r = gpio_direction_output(gpio + TWL4030_GPIO_MAX,
-                       (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0);
+       lcd_bl_en = get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2 ?
+               GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
+       r = gpio_request_one(gpio + TWL4030_GPIO_MAX, lcd_bl_en, "EN_LCD_BKL");
        if (r)
                printk(KERN_ERR "failed to get/set lcd_bkl gpio\n");
  
        /* gpio + 7 == DVI Enable */
-       gpio_request(gpio + 7, "EN_DVI");
-       gpio_direction_output(gpio + 7, 0);
+       gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
  
        /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
        gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@@ -652,78 -560,18 +560,18 @@@ static struct twl4030_platform_data oma
        .vdac           = &omap3_evm_vdac,
        .vpll2          = &omap3_evm_vpll2,
        .vio            = &omap3evm_vio,
- };
- static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl4030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &omap3evm_twldata,
-       },
+       .vmmc1          = &omap3evm_vmmc1,
+       .vsim           = &omap3evm_vsim,
  };
  
  static int __init omap3_evm_i2c_init(void)
  {
-       /*
-        * REVISIT: These entries can be set in omap3evm_twl_data
-        * after a merge with MFD tree
-        */
-       omap3evm_twldata.vmmc1 = &omap3evm_vmmc1;
-       omap3evm_twldata.vsim = &omap3evm_vsim;
-       omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
-                       ARRAY_SIZE(omap3evm_i2c_boardinfo));
+       omap3_pmic_init("twl4030", &omap3evm_twldata);
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
  }
  
- static void ads7846_dev_init(void)
- {
-       if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
-               printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
-       gpio_direction_input(OMAP3_EVM_TS_GPIO);
-       gpio_set_debounce(OMAP3_EVM_TS_GPIO, 310);
- }
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(OMAP3_EVM_TS_GPIO);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 3,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
-       .settle_delay_usecs     = 150,
-       .wakeup                         = true,
- };
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
- static struct spi_board_info omap3evm_spi_board_info[] = {
-       [0] = {
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &ads7846_mcspi_config,
-               .irq                    = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
-               .platform_data          = &ads7846_config,
-       },
- };
  static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
  };
  
@@@ -825,6 -673,11 +673,11 @@@ static struct omap_musb_board_data musb
        .power                  = 100,
  };
  
+ static struct gpio omap3_evm_ehci_gpios[] __initdata = {
+       { OMAP3_EVM_EHCI_VBUS,   GPIOF_OUT_INIT_HIGH,  "enable EHCI VBUS" },
+       { OMAP3_EVM_EHCI_SELECT, GPIOF_OUT_INIT_LOW,   "select EHCI port" },
+ };
  static void __init omap3_evm_init(void)
  {
        omap3_evm_get_revision();
  
        omap_display_init(&omap3_evm_dss_data);
  
-       spi_register_board_info(omap3evm_spi_board_info,
-                               ARRAY_SIZE(omap3evm_spi_board_info));
        omap_serial_init();
  
        /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
  
        if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
                /* enable EHCI VBUS using GPIO22 */
-               omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP);
-               gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS");
-               gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0);
-               gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1);
+               omap_mux_init_gpio(OMAP3_EVM_EHCI_VBUS, OMAP_PIN_INPUT_PULLUP);
                /* Select EHCI port on main board */
-               omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP);
-               gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port");
-               gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0);
-               gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0);
+               omap_mux_init_gpio(OMAP3_EVM_EHCI_SELECT,
+                                  OMAP_PIN_INPUT_PULLUP);
+               gpio_request_array(omap3_evm_ehci_gpios,
+                                  ARRAY_SIZE(omap3_evm_ehci_gpios));
  
                /* setup EHCI phy reset config */
                omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
        }
        usb_musb_init(&musb_board_data);
        usbhs_init(&usbhs_bdata);
-       ads7846_dev_init();
+       omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
        omap3evm_init_smsc911x();
        omap3_evm_display_init();
  
index 1db15492d82bca96dce8279da960736032309925,78dd2a7fe6e6e664609474d9bb8ec973c3651b5b..1d10736c6d3c1d358cbef88468294cb7d4f1834b
@@@ -22,7 -22,6 +22,6 @@@
  #include <linux/platform_device.h>
  
  #include <linux/spi/spi.h>
- #include <linux/spi/ads7846.h>
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
  #include <linux/wl12xx.h>
  #include <mach/hardware.h>
  #include <plat/mcspi.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 +#include <video/omapdss.h>
  #include <plat/nand.h>
  
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
  #include "hsmmc.h"
+ #include "common-board-devices.h"
  
  #define PANDORA_WIFI_IRQ_GPIO         21
  #define PANDORA_WIFI_NRESET_GPIO      23
@@@ -305,24 -305,13 +305,13 @@@ static int omap3pandora_twl_gpio_setup(
  
        /* gpio + 13 drives 32kHz buffer for wifi module */
        gpio_32khz = gpio + 13;
-       ret = gpio_request(gpio_32khz, "wifi 32kHz");
+       ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz");
        if (ret < 0) {
                pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret);
-               goto fail;
-       }
-       ret = gpio_direction_output(gpio_32khz, 1);
-       if (ret < 0) {
-               pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret);
-               goto fail_direction;
+               return -ENODEV;
        }
  
        return 0;
- fail_direction:
-       gpio_free(gpio_32khz);
- fail:
-       return -ENODEV;
  }
  
  static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
@@@ -544,15 -533,6 +533,6 @@@ static struct twl4030_platform_data oma
        .bci            = &pandora_bci_data,
  };
  
- static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("tps65950", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &omap3pandora_twldata,
-       },
- };
  static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
        {
                I2C_BOARD_INFO("bq27500", 0x55),
  
  static int __init omap3pandora_i2c_init(void)
  {
-       omap_register_i2c_bus(1, 2600, omap3pandora_i2c_boardinfo,
-                       ARRAY_SIZE(omap3pandora_i2c_boardinfo));
+       omap3_pmic_init("tps65950", &omap3pandora_twldata);
        /* i2c2 pins are not connected */
        omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo,
                        ARRAY_SIZE(omap3pandora_i2c3_boardinfo));
        return 0;
  }
  
- static void __init omap3pandora_ads7846_init(void)
- {
-       int gpio = OMAP3_PANDORA_TS_GPIO;
-       int ret;
-       ret = gpio_request(gpio, "ads7846_pen_down");
-       if (ret < 0) {
-               printk(KERN_ERR "Failed to request GPIO %d for "
-                               "ads7846 pen down IRQ\n", gpio);
-               return;
-       }
-       gpio_direction_input(gpio);
- }
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(OMAP3_PANDORA_TS_GPIO);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 3,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
- };
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
  static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
        {
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &ads7846_mcspi_config,
-               .irq                    = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO),
-               .platform_data          = &ads7846_config,
-       }, {
                .modalias               = "tpo_td043mtea1_panel_spi",
                .bus_num                = 1,
                .chip_select            = 1,
@@@ -639,14 -573,10 +573,10 @@@ static void __init pandora_wl1251_init(
  
        memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
  
-       ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq");
+       ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
        if (ret < 0)
                goto fail;
  
-       ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO);
-       if (ret < 0)
-               goto fail_irq;
        pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
        if (pandora_wl1251_pdata.irq < 0)
                goto fail_irq;
@@@ -688,12 -618,6 +618,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
- };
  static void __init omap3pandora_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
        spi_register_board_info(omap3pandora_spi_board_info,
                        ARRAY_SIZE(omap3pandora_spi_board_info));
-       omap3pandora_ads7846_init();
+       omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
        usbhs_init(&usbhs_bdata);
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        gpmc_nand_init(&pandora_nand_data);
  
        /* Ensure SDRC pins are mux'd for self-refresh */
index a72c90a08c8a940c8f0ffa6d4b628f6507b54e01,085c60a7c47ca63570cb23a9779625437d5a3866..0c108a212ea2190904bb6e66ee11aad696f40c15
  #include <plat/gpmc.h>
  #include <plat/nand.h>
  #include <plat/usb.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  
  #include <plat/mcspi.h>
  #include <linux/input/matrix_keypad.h>
  #include <linux/spi/spi.h>
- #include <linux/spi/ads7846.h>
  #include <linux/interrupt.h>
  #include <linux/smsc911x.h>
  #include <linux/i2c/at24.h>
  #include "mux.h"
  #include "hsmmc.h"
  #include "timer-gp.h"
+ #include "common-board-devices.h"
  
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+ #include <plat/gpmc-smsc911x.h>
  #define OMAP3STALKER_ETHR_START       0x2c000000
  #define OMAP3STALKER_ETHR_SIZE        1024
  #define OMAP3STALKER_ETHR_GPIO_IRQ    19
  #define OMAP3STALKER_SMC911X_CS       5
  
- static struct resource omap3stalker_smsc911x_resources[] = {
-       [0] = {
-              .start   = OMAP3STALKER_ETHR_START,
-              .end     =
-              (OMAP3STALKER_ETHR_START + OMAP3STALKER_ETHR_SIZE - 1),
-              .flags   = IORESOURCE_MEM,
-       },
-       [1] = {
-              .start   = OMAP_GPIO_IRQ(OMAP3STALKER_ETHR_GPIO_IRQ),
-              .end     = OMAP_GPIO_IRQ(OMAP3STALKER_ETHR_GPIO_IRQ),
-              .flags   = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
-       },
- };
- static struct smsc911x_platform_config smsc911x_config = {
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+ static struct omap_smsc911x_platform_data smsc911x_cfg = {
+       .cs             = OMAP3STALKER_SMC911X_CS,
+       .gpio_irq       = OMAP3STALKER_ETHR_GPIO_IRQ,
+       .gpio_reset     = -EINVAL,
        .flags          = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
  };
  
- static struct platform_device omap3stalker_smsc911x_device = {
-       .name           = "smsc911x",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(omap3stalker_smsc911x_resources),
-       .resource       = &omap3stalker_smsc911x_resources[0],
-       .dev            = {
-               .platform_data  = &smsc911x_config,
-       },
- };
  static inline void __init omap3stalker_init_eth(void)
  {
-       int eth_cs;
        struct clk *l3ck;
        unsigned int rate;
  
-       eth_cs = OMAP3STALKER_SMC911X_CS;
        l3ck = clk_get(NULL, "l3_ck");
        if (IS_ERR(l3ck))
                rate = 100000000;
                rate = clk_get_rate(l3ck);
  
        omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP);
-       if (gpio_request(OMAP3STALKER_ETHR_GPIO_IRQ, "SMC911x irq") < 0) {
-               printk(KERN_ERR
-                      "Failed to request GPIO%d for smc911x IRQ\n",
-                      OMAP3STALKER_ETHR_GPIO_IRQ);
-               return;
-       }
-       gpio_direction_input(OMAP3STALKER_ETHR_GPIO_IRQ);
-       platform_device_register(&omap3stalker_smsc911x_device);
+       gpmc_smsc911x_init(&smsc911x_cfg);
  }
  
  #else
@@@ -365,12 -331,11 +331,11 @@@ omap3stalker_twl_gpio_setup(struct devi
         */
  
        /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
-       gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
-       gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+       gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW,
+                        "EN_LCD_BKL");
  
        /* gpio + 7 == DVI Enable */
-       gpio_request(gpio + 7, "EN_DVI");
-       gpio_direction_output(gpio + 7, 0);
+       gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
  
        /* TWL4030_GPIO_MAX + 1 == ledB (out, mmc0) */
        gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@@ -489,15 -454,8 +454,8 @@@ static struct twl4030_platform_data oma
        .codec          = &omap3stalker_codec_data,
        .vdac           = &omap3_stalker_vdac,
        .vpll2          = &omap3_stalker_vpll2,
- };
- static struct i2c_board_info __initdata omap3stalker_i2c_boardinfo[] = {
-       {
-        I2C_BOARD_INFO("twl4030", 0x48),
-        .flags         = I2C_CLIENT_WAKE,
-        .irq           = INT_34XX_SYS_NIRQ,
-        .platform_data = &omap3stalker_twldata,
-        },
+       .vmmc1          = &omap3stalker_vmmc1,
+       .vsim           = &omap3stalker_vsim,
  };
  
  static struct at24_platform_data fram_info = {
@@@ -516,15 -474,7 +474,7 @@@ static struct i2c_board_info __initdat
  
  static int __init omap3_stalker_i2c_init(void)
  {
-       /*
-        * REVISIT: These entries can be set in omap3evm_twl_data
-        * after a merge with MFD tree
-        */
-       omap3stalker_twldata.vmmc1 = &omap3stalker_vmmc1;
-       omap3stalker_twldata.vsim = &omap3stalker_vsim;
-       omap_register_i2c_bus(1, 2600, omap3stalker_i2c_boardinfo,
-                             ARRAY_SIZE(omap3stalker_i2c_boardinfo));
+       omap3_pmic_init("twl4030", &omap3stalker_twldata);
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, omap3stalker_i2c_boardinfo3,
                              ARRAY_SIZE(omap3stalker_i2c_boardinfo3));
  }
  
  #define OMAP3_STALKER_TS_GPIO 175
- static void ads7846_dev_init(void)
- {
-       if (gpio_request(OMAP3_STALKER_TS_GPIO, "ADS7846 pendown") < 0)
-               printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
-       gpio_direction_input(OMAP3_STALKER_TS_GPIO);
-       gpio_set_debounce(OMAP3_STALKER_TS_GPIO, 310);
- }
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(OMAP3_STALKER_TS_GPIO);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 3,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
-       .settle_delay_usecs     = 150,
- };
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode             = 0,
-       .single_channel         = 1,    /* 0: slave, 1: master */
- };
- static struct spi_board_info omap3stalker_spi_board_info[] = {
-       [0] = {
-              .modalias        = "ads7846",
-              .bus_num         = 1,
-              .chip_select     = 0,
-              .max_speed_hz    = 1500000,
-              .controller_data = &ads7846_mcspi_config,
-              .irq             = OMAP_GPIO_IRQ(OMAP3_STALKER_TS_GPIO),
-              .platform_data   = &ads7846_config,
-       },
- };
  
  static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
  };
@@@ -618,12 -525,6 +525,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type = MUSB_INTERFACE_ULPI,
-       .mode           = MUSB_OTG,
-       .power          = 100,
- };
  static void __init omap3_stalker_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
                             ARRAY_SIZE(omap3_stalker_devices));
  
        omap_display_init(&omap3_stalker_dss_data);
-       spi_register_board_info(omap3stalker_spi_board_info,
-                               ARRAY_SIZE(omap3stalker_spi_board_info));
  
        omap_serial_init();
-       usb_musb_init(&musb_board_data);
+       usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       ads7846_dev_init();
+       omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
  
        omap_mux_init_gpio(21, OMAP_PIN_OUTPUT);
        omap_mux_init_gpio(18, OMAP_PIN_INPUT_PULLUP);
index e4973ac77cbc8d3d18a27cb94bffab0204194588,5d7c0a313dc750bccec8ef948af3dcfce211691b..90485fced973db9ee265465eac4c474a1adf3848
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
 -#include <plat/display.h>
 +#include <video/omapdss.h>
  
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/usb.h>
  #include <plat/mmc.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omap-panel-generic-dpi.h>
  #include "timer-gp.h"
  
  #include "hsmmc.h"
  #include "control.h"
  #include "mux.h"
+ #include "common-board-devices.h"
  
  #define GPIO_HUB_POWER                1
  #define GPIO_HUB_NRESET               62
@@@ -111,6 -112,11 +112,11 @@@ static const struct usbhs_omap_board_da
        .reset_gpio_port[2]  = -EINVAL
  };
  
+ static struct gpio panda_ehci_gpios[] __initdata = {
+       { GPIO_HUB_POWER,       GPIOF_OUT_INIT_LOW,  "hub_power"  },
+       { GPIO_HUB_NRESET,      GPIOF_OUT_INIT_LOW,  "hub_nreset" },
+ };
  static void __init omap4_ehci_init(void)
  {
        int ret;
        phy_ref_clk = clk_get(NULL, "auxclk3_ck");
        if (IS_ERR(phy_ref_clk)) {
                pr_err("Cannot request auxclk3\n");
-               goto error1;
+               return;
        }
        clk_set_rate(phy_ref_clk, 19200000);
        clk_enable(phy_ref_clk);
  
-       /* disable the power to the usb hub prior to init */
-       ret = gpio_request(GPIO_HUB_POWER, "hub_power");
+       /* disable the power to the usb hub prior to init and reset phy+hub */
+       ret = gpio_request_array(panda_ehci_gpios,
+                                ARRAY_SIZE(panda_ehci_gpios));
        if (ret) {
-               pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER);
-               goto error1;
+               pr_err("Unable to initialize EHCI power/reset\n");
+               return;
        }
-       gpio_export(GPIO_HUB_POWER, 0);
-       gpio_direction_output(GPIO_HUB_POWER, 0);
-       gpio_set_value(GPIO_HUB_POWER, 0);
  
-       /* reset phy+hub */
-       ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
-       if (ret) {
-               pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET);
-               goto error2;
-       }
+       gpio_export(GPIO_HUB_POWER, 0);
        gpio_export(GPIO_HUB_NRESET, 0);
-       gpio_direction_output(GPIO_HUB_NRESET, 0);
-       gpio_set_value(GPIO_HUB_NRESET, 0);
        gpio_set_value(GPIO_HUB_NRESET, 1);
  
        usbhs_init(&usbhs_bdata);
  
        /* enable power to hub */
        gpio_set_value(GPIO_HUB_POWER, 1);
-       return;
- error2:
-       gpio_free(GPIO_HUB_POWER);
- error1:
-       pr_err("Unable to initialize EHCI power/reset\n");
-       return;
  }
  
  static struct omap_musb_board_data musb_board_data = {
@@@ -408,15 -397,6 +397,6 @@@ static struct twl4030_platform_data oma
        .usb            = &omap4_usbphy_data,
  };
  
- static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("twl6030", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = OMAP44XX_IRQ_SYS_1N,
-               .platform_data = &omap4_panda_twldata,
-       },
- };
  /*
   * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
   * is connected as I2C slave device, and can be accessed at address 0x50
@@@ -429,12 -409,7 +409,7 @@@ static struct i2c_board_info __initdat
  
  static int __init omap4_panda_i2c_init(void)
  {
-       /*
-        * Phoenix Audio IC needs I2C1 to
-        * start with 400 KHz or less
-        */
-       omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
-                       ARRAY_SIZE(omap4_panda_i2c_boardinfo));
+       omap4_pmic_init("twl6030", &omap4_panda_twldata);
        omap_register_i2c_bus(2, 400, NULL, 0);
        /*
         * Bus 3 is attached to the DVI port where devices like the pico DLP
@@@ -651,27 -626,19 +626,19 @@@ static void omap4_panda_hdmi_mux_init(v
                        OMAP_PIN_INPUT_PULLUP);
  }
  
+ static struct gpio panda_hdmi_gpios[] = {
+       { HDMI_GPIO_HPD,        GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd"   },
+       { HDMI_GPIO_LS_OE,      GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
+ };
  static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
  {
        int status;
  
-       status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
-                                                       "hdmi_gpio_hpd");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
-               return status;
-       }
-       status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
-                                                       "hdmi_gpio_ls_oe");
-       if (status) {
-               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
-               goto error1;
-       }
-       return 0;
- error1:
-       gpio_free(HDMI_GPIO_HPD);
+       status = gpio_request_array(panda_hdmi_gpios,
+                                   ARRAY_SIZE(panda_hdmi_gpios));
+       if (status)
+               pr_err("Cannot request HDMI GPIOs\n");
  
        return status;
  }
index 9d192ff3b9ac113307c4de5e42f98abd2b60cefa,c03f92b14f9cfd00868540e4bacba3297dc725a6..1555918e3ffa05c0a79e501e24cf6041b4cca30c
@@@ -43,8 -43,8 +43,8 @@@
  
  #include <plat/board.h>
  #include <plat/common.h>
 -#include <plat/display.h>
 -#include <plat/panel-generic-dpi.h>
 +#include <video/omapdss.h>
 +#include <video/omap-panel-generic-dpi.h>
  #include <mach/gpio.h>
  #include <plat/gpmc.h>
  #include <mach/hardware.h>
@@@ -56,6 -56,7 +56,7 @@@
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
  #include "hsmmc.h"
+ #include "common-board-devices.h"
  
  #define OVERO_GPIO_BT_XGATE   15
  #define OVERO_GPIO_W2W_NRESET 16
  #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
        defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
  
- #include <linux/spi/ads7846.h>
- static struct omap2_mcspi_device_config ads7846_mcspi_config = {
-       .turbo_mode     = 0,
-       .single_channel = 1,    /* 0: slave, 1: master */
- };
- static int ads7846_get_pendown_state(void)
- {
-       return !gpio_get_value(OVERO_GPIO_PENDOWN);
- }
- static struct ads7846_platform_data ads7846_config = {
-       .x_max                  = 0x0fff,
-       .y_max                  = 0x0fff,
-       .x_plate_ohms           = 180,
-       .pressure_max           = 255,
-       .debounce_max           = 10,
-       .debounce_tol           = 3,
-       .debounce_rep           = 1,
-       .get_pendown_state      = ads7846_get_pendown_state,
-       .keep_vref_on           = 1,
- };
  /* fixed regulator for ads7846 */
  static struct regulator_consumer_supply ads7846_supply =
        REGULATOR_SUPPLY("vcc", "spi1.0");
@@@ -128,14 -105,7 +105,7 @@@ static struct platform_device vads7846_
  
  static void __init overo_ads7846_init(void)
  {
-       if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
-           (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) {
-               gpio_export(OVERO_GPIO_PENDOWN, 0);
-       } else {
-               printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
-               return;
-       }
+       omap_ads7846_init(1, OVERO_GPIO_PENDOWN, 0, NULL);
        platform_device_register(&vads7846_device);
  }
  
@@@ -146,106 -116,28 +116,28 @@@ static inline void __init overo_ads7846
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  
  #include <linux/smsc911x.h>
+ #include <plat/gpmc-smsc911x.h>
  
- static struct resource overo_smsc911x_resources[] = {
-       {
-               .name   = "smsc911x-memory",
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
-       },
- };
- static struct resource overo_smsc911x2_resources[] = {
-       {
-               .name   = "smsc911x2-memory",
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
-       },
- };
- static struct smsc911x_platform_config overo_smsc911x_config = {
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
-       .flags          = SMSC911X_USE_32BIT ,
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
- };
- static struct platform_device overo_smsc911x_device = {
-       .name           = "smsc911x",
+ static struct omap_smsc911x_platform_data smsc911x_cfg = {
        .id             = 0,
-       .num_resources  = ARRAY_SIZE(overo_smsc911x_resources),
-       .resource       = overo_smsc911x_resources,
-       .dev            = {
-               .platform_data = &overo_smsc911x_config,
-       },
+       .cs             = OVERO_SMSC911X_CS,
+       .gpio_irq       = OVERO_SMSC911X_GPIO,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT,
  };
  
- static struct platform_device overo_smsc911x2_device = {
-       .name           = "smsc911x",
+ static struct omap_smsc911x_platform_data smsc911x2_cfg = {
        .id             = 1,
-       .num_resources  = ARRAY_SIZE(overo_smsc911x2_resources),
-       .resource       = overo_smsc911x2_resources,
-       .dev            = {
-               .platform_data = &overo_smsc911x_config,
-       },
+       .cs             = OVERO_SMSC911X2_CS,
+       .gpio_irq       = OVERO_SMSC911X2_GPIO,
+       .gpio_reset     = -EINVAL,
+       .flags          = SMSC911X_USE_32BIT,
  };
  
- static struct platform_device *smsc911x_devices[] = {
-       &overo_smsc911x_device,
-       &overo_smsc911x2_device,
- };
- static inline void __init overo_init_smsc911x(void)
+ static void __init overo_init_smsc911x(void)
  {
-       unsigned long cs_mem_base, cs_mem_base2;
-       /* set up first smsc911x chip */
-       if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
-               printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
-               return;
-       }
-       overo_smsc911x_resources[0].start = cs_mem_base + 0x0;
-       overo_smsc911x_resources[0].end   = cs_mem_base + 0xff;
-       if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
-           (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) {
-               gpio_export(OVERO_SMSC911X_GPIO, 0);
-       } else {
-               printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n");
-               return;
-       }
-       overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
-       overo_smsc911x_resources[1].end   = 0;
-       /* set up second smsc911x chip */
-       if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
-               printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
-               return;
-       }
-       overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
-       overo_smsc911x2_resources[0].end   = cs_mem_base2 + 0xff;
-       if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
-           (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
-               gpio_export(OVERO_SMSC911X2_GPIO, 0);
-       } else {
-               printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
-               return;
-       }
-       overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
-       overo_smsc911x2_resources[1].end   = 0;
-       platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
+       gpmc_smsc911x_init(&smsc911x_cfg);
+       gpmc_smsc911x_init(&smsc911x2_cfg);
  }
  
  #else
@@@ -259,21 -151,20 +151,20 @@@ static int dvi_enabled
  #define OVERO_GPIO_LCD_EN 144
  #define OVERO_GPIO_LCD_BL 145
  
+ static struct gpio overo_dss_gpios[] __initdata = {
+       { OVERO_GPIO_LCD_EN, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_EN" },
+       { OVERO_GPIO_LCD_BL, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_BL" },
+ };
  static void __init overo_display_init(void)
  {
-       if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
-               gpio_export(OVERO_GPIO_LCD_EN, 0);
-       else
-               printk(KERN_ERR "could not obtain gpio for "
-                                       "OVERO_GPIO_LCD_EN\n");
+       if (gpio_request_array(overo_dss_gpios, ARRAY_SIZE(overo_dss_gpios))) {
+               printk(KERN_ERR "could not obtain DSS control GPIOs\n");
+               return;
+       }
  
-       if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
-               gpio_export(OVERO_GPIO_LCD_BL, 0);
-       else
-               printk(KERN_ERR "could not obtain gpio for "
-                                       "OVERO_GPIO_LCD_BL\n");
+       gpio_export(OVERO_GPIO_LCD_EN, 0);
+       gpio_export(OVERO_GPIO_LCD_BL, 0);
  }
  
  static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
@@@ -412,45 -303,6 +303,6 @@@ static struct mtd_partition overo_nand_
        },
  };
  
- static struct omap_nand_platform_data overo_nand_data = {
-       .parts = overo_nand_partitions,
-       .nr_parts = ARRAY_SIZE(overo_nand_partitions),
-       .dma_channel = -1,      /* disable DMA in OMAP NAND driver */
- };
- static void __init overo_flash_init(void)
- {
-       u8 cs = 0;
-       u8 nandcs = GPMC_CS_NUM + 1;
-       /* find out the chip-select on which NAND exists */
-       while (cs < GPMC_CS_NUM) {
-               u32 ret = 0;
-               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-               if ((ret & 0xC00) == 0x800) {
-                       printk(KERN_INFO "Found NAND on CS%d\n", cs);
-                       if (nandcs > GPMC_CS_NUM)
-                               nandcs = cs;
-               }
-               cs++;
-       }
-       if (nandcs > GPMC_CS_NUM) {
-               printk(KERN_INFO "NAND: Unable to find configuration "
-                                "in GPMC\n ");
-               return;
-       }
-       if (nandcs < GPMC_CS_NUM) {
-               overo_nand_data.cs = nandcs;
-               printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
-               if (gpmc_nand_init(&overo_nand_data) < 0)
-                       printk(KERN_ERR "Unable to register NAND device\n");
-       }
- }
  static struct omap2_hsmmc_info mmc[] = {
        {
                .mmc            = 1,
@@@ -648,37 -500,15 +500,15 @@@ static struct twl4030_platform_data ove
        .vpll2          = &overo_vpll2,
  };
  
- static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
-       {
-               I2C_BOARD_INFO("tps65950", 0x48),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_34XX_SYS_NIRQ,
-               .platform_data = &overo_twldata,
-       },
- };
  static int __init overo_i2c_init(void)
  {
-       omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo,
-                       ARRAY_SIZE(overo_i2c_boardinfo));
+       omap3_pmic_init("tps65950", &overo_twldata);
        /* i2c2 pins are used for gpio */
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
  }
  
  static struct spi_board_info overo_spi_board_info[] __initdata = {
- #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
-       defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-       {
-               .modalias               = "ads7846",
-               .bus_num                = 1,
-               .chip_select            = 0,
-               .max_speed_hz           = 1500000,
-               .controller_data        = &ads7846_mcspi_config,
-               .irq                    = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
-               .platform_data          = &ads7846_config,
-       },
- #endif
  #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
        defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
        {
@@@ -722,20 -552,22 +552,22 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
- static struct omap_musb_board_data musb_board_data = {
-       .interface_type         = MUSB_INTERFACE_ULPI,
-       .mode                   = MUSB_OTG,
-       .power                  = 100,
+ static struct gpio overo_bt_gpios[] __initdata = {
+       { OVERO_GPIO_BT_XGATE,  GPIOF_OUT_INIT_LOW,     "lcd enable"    },
+       { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH,    "lcd bl enable" },
  };
  
  static void __init overo_init(void)
  {
+       int ret;
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        overo_i2c_init();
        omap_display_init(&overo_dss_data);
        omap_serial_init();
-       overo_flash_init();
-       usb_musb_init(&musb_board_data);
+       omap_nand_flash_init(0, overo_nand_partitions,
+                            ARRAY_SIZE(overo_nand_partitions));
+       usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
        overo_ads7846_init();
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  
-       if ((gpio_request(OVERO_GPIO_W2W_NRESET,
-                         "OVERO_GPIO_W2W_NRESET") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_W2W_NRESET, 1) == 0)) {
+       ret = gpio_request_one(OVERO_GPIO_W2W_NRESET, GPIOF_OUT_INIT_HIGH,
+                              "OVERO_GPIO_W2W_NRESET");
+       if (ret == 0) {
                gpio_export(OVERO_GPIO_W2W_NRESET, 0);
                gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
                udelay(10);
                                        "OVERO_GPIO_W2W_NRESET\n");
        }
  
-       if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0))
+       ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios));
+       if (ret) {
+               pr_err("%s: could not obtain BT gpios\n", __func__);
+       } else {
                gpio_export(OVERO_GPIO_BT_XGATE, 0);
-       else
-               printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n");
-       if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) {
                gpio_export(OVERO_GPIO_BT_NRESET, 0);
                gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
                mdelay(6);
                gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
-       } else {
-               printk(KERN_ERR "could not obtain gpio for "
-                                       "OVERO_GPIO_BT_NRESET\n");
        }
  
-       if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) &&
-           (gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0))
+       ret = gpio_request_one(OVERO_GPIO_USBH_CPEN, GPIOF_OUT_INIT_HIGH,
+                              "OVERO_GPIO_USBH_CPEN");
+       if (ret == 0)
                gpio_export(OVERO_GPIO_USBH_CPEN, 0);
        else
                printk(KERN_ERR "could not obtain gpio for "
index 2df10b6a5940ae74786112d61a2bd7e2edb3a7ff,19777333aef8d788023e6f648f962b2f4eadeb77..2c1289bd5e6ad7a2ee30d736d5bb3a14bf6591f0
@@@ -15,7 -15,7 +15,7 @@@
  #include <linux/spi/spi.h>
  #include <linux/mm.h>
  #include <asm/mach-types.h>
 -#include <plat/display.h>
 +#include <video/omapdss.h>
  #include <plat/vram.h>
  #include <plat/mcspi.h>
  
@@@ -76,13 -76,12 +76,12 @@@ static int __init rx51_video_init(void
                return 0;
        }
  
-       if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) {
+       if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
+                            "LCD ACX565AKM reset")) {
                pr_err("%s failed to get LCD Reset GPIO\n", __func__);
                return 0;
        }
  
-       gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
        omap_display_init(&rx51_dss_board_info);
        return 0;
  }
index 60e8645db59da15c6342d5537e50000140095514,ce53e82ba1369f2fa09683935bc8c29fdd630eac..c7c6beb1ec24743737c5b9abe99a85909d5e310b
  #include <linux/i2c/twl.h>
  #include <linux/spi/spi.h>
  #include <plat/mcspi.h>
 -#include <plat/display.h>
 +#include <video/omapdss.h>
  
  #define LCD_PANEL_RESET_GPIO_PROD     96
  #define LCD_PANEL_RESET_GPIO_PILOT    55
  #define LCD_PANEL_QVGA_GPIO           56
  
+ static struct gpio zoom_lcd_gpios[] __initdata = {
+       { -EINVAL,              GPIOF_OUT_INIT_HIGH, "lcd reset" },
+       { LCD_PANEL_QVGA_GPIO,  GPIOF_OUT_INIT_HIGH, "lcd qvga"  },
+ };
  static void zoom_lcd_panel_init(void)
  {
-       int ret;
-       unsigned char lcd_panel_reset_gpio;
-       lcd_panel_reset_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
+       zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
                        LCD_PANEL_RESET_GPIO_PROD :
                        LCD_PANEL_RESET_GPIO_PILOT;
  
-       ret = gpio_request(lcd_panel_reset_gpio, "lcd reset");
-       if (ret) {
-               pr_err("Failed to get LCD reset GPIO (gpio%d).\n",
-                       lcd_panel_reset_gpio);
-               return;
-       }
-       gpio_direction_output(lcd_panel_reset_gpio, 1);
-       ret = gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga");
-       if (ret) {
-               pr_err("Failed to get LCD_PANEL_QVGA_GPIO (gpio%d).\n",
-                       LCD_PANEL_QVGA_GPIO);
-               goto err0;
-       }
-       gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
-       return;
- err0:
-       gpio_free(lcd_panel_reset_gpio);
+       if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
+               pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
  }
  
  static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
index 565d2664f5a739adc503bca1d86751b4e997d2c7,2b576f1ab6473252b2f844d334dc64bd206e0942..ac4b60d9aa299c86208e66cdbe00df1432b6a650
@@@ -27,8 -27,8 +27,8 @@@
  
  #define MDR1_MODE_MASK                        0x07
  
 -static volatile u8 *uart_base;
 -static int uart_shift;
 +volatile u8 *uart_base;
 +int uart_shift;
  
  /*
   * Store the DEBUG_LL uart number into memory.
@@@ -129,7 -129,6 +129,6 @@@ static inline void __arch_decomp_setup(
                DEBUG_LL_OMAP1(3, sx1);
  
                /* omap2 based boards using UART1 */
-               DEBUG_LL_OMAP2(1, omap2evm);
                DEBUG_LL_OMAP2(1, omap_2430sdp);
                DEBUG_LL_OMAP2(1, omap_apollon);
                DEBUG_LL_OMAP2(1, omap_h4);
This page took 0.200698 seconds and 4 git commands to generate.