Blackfin: bf537-stamp: add example AD7416 IIO resources
[safe/jmp/linux-2.6] / arch / blackfin / mach-bf537 / boards / stamp.c
index 9b67006..4aec6c0 100644 (file)
@@ -1,36 +1,15 @@
 /*
- * File:         arch/blackfin/mach-bf537/boards/stamp.c
- * Based on:     arch/blackfin/mach-bf533/boards/ezkit.c
- * Author:       Aidan Williams <aidan@nicta.com.au>
+ * Copyright 2004-2009 Analog Devices Inc.
+ *                2005 National ICT Australia (NICTA)
+ *                      Aidan Williams <aidan@nicta.com.au>
  *
- * Created:
- * Description:
- *
- * Modified:
- *               Copyright 2005 National ICT Australia (NICTA)
- *               Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs:         Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * Licensed under the GPL-2 or later.
  */
 
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
+#include <linux/i2c.h>
+#include <linux/i2c/adp5588.h>
+#include <linux/etherdevice.h>
 #include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/i2c.h>
 #include <linux/usb/sl811.h>
 #include <linux/spi/mmc_spi.h>
+#include <linux/leds.h>
+#include <linux/input.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/reboot.h>
 #include <asm/portmux.h>
 #include <asm/dpmc.h>
+#ifdef CONFIG_REGULATOR_ADP_SWITCH
+#include <linux/regulator/adp_switch.h>
+#endif
+#ifdef CONFIG_REGULATOR_AD5398
+#include <linux/regulator/ad5398.h>
+#endif
+#include <linux/regulator/consumer.h>
+#include <linux/regulator/userspace-consumer.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
@@ -87,7 +78,7 @@ static struct isp1760_platform_data isp1760_priv = {
 };
 
 static struct platform_device bfin_isp1760_device = {
-       .name           = "isp1760-hcd",
+       .name           = "isp1760",
        .id             = 0,
        .dev = {
                .platform_data = &isp1760_priv,
@@ -98,7 +89,6 @@ static struct platform_device bfin_isp1760_device = {
 #endif
 
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
-#include <linux/input.h>
 #include <linux/gpio_keys.h>
 
 static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -121,19 +111,6 @@ static struct platform_device bfin_device_gpiokeys = {
 };
 #endif
 
-static struct resource bfin_gpios_resources = {
-       .start = 0,
-       .end   = MAX_BLACKFIN_GPIOS - 1,
-       .flags = IORESOURCE_IRQ,
-};
-
-static struct platform_device bfin_gpios_device = {
-       .name = "simple-gpio",
-       .id = -1,
-       .num_resources = 1,
-       .resource = &bfin_gpios_resources,
-};
-
 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
 static struct resource bfin_pcmcia_cf_resources[] = {
        {
@@ -230,28 +207,6 @@ static struct platform_device dm9000_device = {
 };
 #endif
 
-#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
-static struct resource ax88180_resources[] = {
-       [0] = {
-               .start  = 0x20300000,
-               .end    = 0x20300000 + 0x8000,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_PF7,
-               .end    = IRQ_PF7,
-               .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
-       },
-};
-
-static struct platform_device ax88180_device = {
-       .name           = "ax88180",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(ax88180_resources),
-       .resource       = ax88180_resources,
-};
-#endif
-
 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
 static struct resource sl811_hcd_resources[] = {
        {
@@ -263,8 +218,8 @@ static struct resource sl811_hcd_resources[] = {
                .end = 0x20340004,
                .flags = IORESOURCE_MEM,
        }, {
-               .start = CONFIG_USB_SL811_BFIN_IRQ,
-               .end = CONFIG_USB_SL811_BFIN_IRQ,
+               .start = IRQ_PF4,
+               .end = IRQ_PF4,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        },
 };
@@ -307,8 +262,8 @@ static struct resource isp1362_hcd_resources[] = {
                .end = 0x20360004,
                .flags = IORESOURCE_MEM,
        }, {
-               .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
-               .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
+               .start = IRQ_PF3,
+               .end = IRQ_PF3,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        },
 };
@@ -335,6 +290,44 @@ static struct platform_device isp1362_hcd_device = {
 };
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+unsigned short bfin_can_peripherals[] = {
+       P_CAN0_RX, P_CAN0_TX, 0
+};
+
+static struct resource bfin_can_resources[] = {
+       {
+               .start = 0xFFC02A00,
+               .end = 0xFFC02FFF,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_CAN_RX,
+               .end = IRQ_CAN_RX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_TX,
+               .end = IRQ_CAN_TX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_ERROR,
+               .end = IRQ_CAN_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_can_device = {
+       .name = "bfin_can",
+       .num_resources = ARRAY_SIZE(bfin_can_resources),
+       .resource = bfin_can_resources,
+       .dev = {
+               .platform_data = &bfin_can_peripherals, /* Passed to driver */
+       },
+};
+#endif
+
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 static struct platform_device bfin_mii_bus = {
        .name = "bfin_mii_bus",
@@ -471,6 +464,9 @@ static struct physmap_flash_data stamp_flash_data = {
        .width      = 2,
        .parts      = stamp_partitions,
        .nr_parts   = ARRAY_SIZE(stamp_partitions),
+#ifdef CONFIG_ROMKERNEL
+       .probe_type = "map_rom",
+#endif
 };
 
 static struct resource stamp_flash_resource = {
@@ -532,39 +528,30 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_SND_BLACKFIN_AD1836) \
-       || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
+       || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
        .enable_dma = 0,
        .bits_per_word = 16,
 };
 #endif
 
-#if defined(CONFIG_SND_BF5XX_SOC_AD1938) \
-       || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
+#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
+       || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
 static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
        .enable_dma = 0,
        .bits_per_word = 8,
-       .cs_gpio = GPIO_PF5,
 };
 #endif
 
-#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
-static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
-       .enable_dma = 0,
-       .bits_per_word = 16,
-};
-#endif
-
-#if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
-#include <linux/input.h>
+#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
 #include <linux/input/ad714x.h>
 static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
        .enable_dma = 0,
        .bits_per_word = 16,
 };
 
-static struct ad714x_slider_plat slider_plat[] = {
+static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
        {
                .start_stage = 0,
                .end_stage = 7,
@@ -572,7 +559,7 @@ static struct ad714x_slider_plat slider_plat[] = {
        },
 };
 
-static struct ad714x_button_plat button_plat[] = {
+static struct ad714x_button_plat ad7147_spi_button_plat[] = {
        {
                .keycode = BTN_FORWARD,
                .l_mask = 0,
@@ -599,11 +586,11 @@ static struct ad714x_button_plat button_plat[] = {
                .h_mask = 0x400,
        },
 };
-static struct ad714x_platform_data ad7147_platfrom_data = {
+static struct ad714x_platform_data ad7147_spi_platform_data = {
        .slider_num = 1,
        .button_num = 5,
-       .slider = slider_plat,
-       .button = button_plat,
+       .slider = ad7147_spi_slider_plat,
+       .button = ad7147_spi_button_plat,
        .stage_cfg_reg =  {
                {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
                {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
@@ -622,10 +609,9 @@ static struct ad714x_platform_data ad7147_platfrom_data = {
 };
 #endif
 
-#if defined(CONFIG_INPUT_EVAL_AD7142EB)
-#include <linux/input.h>
+#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
 #include <linux/input/ad714x.h>
-static struct ad714x_button_plat button_plat[] = {
+static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
        {
                .keycode = BTN_1,
                .l_mask = 0,
@@ -647,9 +633,9 @@ static struct ad714x_button_plat button_plat[] = {
                .h_mask = 0x8,
        },
 };
-static struct ad714x_platform_data ad7142_platfrom_data = {
+static struct ad714x_platform_data ad7142_i2c_platform_data = {
        .button_num = 4,
-       .button = button_plat,
+       .button = ad7142_i2c_button_plat,
        .stage_cfg_reg =  {
                /* fixme: figure out right setting for all comoponent according
                 * to hardware feature of EVAL-AD7142EB board */
@@ -670,6 +656,25 @@ static struct ad714x_platform_data ad7142_platfrom_data = {
 };
 #endif
 
+#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
+static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
+unsigned short ad2s120x_platform_data[] = {
+       /* used as SAMPLE and RDVEL */
+       GPIO_PF5, GPIO_PF6, 0
+};
+
+static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
+
 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
 
@@ -698,15 +703,6 @@ static struct bfin5xx_spi_chip  mmc_spi_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_PBX)
-static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
-       .ctl_reg        = 0x4, /* send zero */
-       .enable_dma     = 0,
-       .bits_per_word  = 8,
-       .cs_change_per_word = 1,
-};
-#endif
-
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
 #include <linux/spi/ad7877.h>
 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
@@ -741,14 +737,13 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
        .median                 = 2,    /* do 8 measurements */
        .averaging              = 1,    /* take the average of 4 middle samples */
        .pen_down_acc_interval  = 255,  /* 9.4 ms */
-       .gpio_output            = 1,    /* configure AUX/VBAT/GPIO as GPIO output */
-       .gpio_default           = 1,    /* During initialization set GPIO = HIGH */
+       .gpio_export            = 1,    /* Export GPIO to gpiolib */
+       .gpio_base              = -1,   /* Dynamic allocation */
 };
 #endif
 
 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
-#include <linux/input.h>
-#include <linux/spi/adxl34x.h>
+#include <linux/input/adxl34x.h>
 static const struct adxl34x_platform_data adxl34x_info = {
        .x_axis_offset = 0,
        .y_axis_offset = 0,
@@ -772,9 +767,7 @@ static const struct adxl34x_platform_data adxl34x_info = {
        .ev_code_y = ABS_Y,             /* EV_REL */
        .ev_code_z = ABS_Z,             /* EV_REL */
 
-       .ev_code_tap_x = BTN_TOUCH,             /* EV_KEY */
-       .ev_code_tap_y = BTN_TOUCH,             /* EV_KEY */
-       .ev_code_tap_z = BTN_TOUCH,             /* EV_KEY */
+       .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
 
 /*     .ev_code_ff = KEY_F,*/          /* EV_KEY */
 /*     .ev_code_act_inactivity = KEY_A,*/      /* EV_KEY */
@@ -812,6 +805,76 @@ static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
+static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
+       .bits_per_word = 16,
+       .cs_gpio = GPIO_PF10,
+};
+
+#include <linux/spi/adf702x.h>
+#define TXREG 0x0160A470
+static const u32 adf7021_regs[] = {
+       0x09608FA0,
+       0x00575011,
+       0x00A7F092,
+       0x2B141563,
+       0x81F29E94,
+       0x00003155,
+       0x050A4F66,
+       0x00000007,
+       0x00000008,
+       0x000231E9,
+       0x3296354A,
+       0x891A2B3B,
+       0x00000D9C,
+       0x0000000D,
+       0x0000000E,
+       0x0000000F,
+};
+
+static struct adf702x_platform_data adf7021_platform_data = {
+       .regs_base = (void *)SPORT1_TCR1,
+       .dma_ch_rx = CH_SPORT1_RX,
+       .dma_ch_tx = CH_SPORT1_TX,
+       .irq_sport_err = IRQ_SPORT1_ERROR,
+       .gpio_int_rfs = GPIO_PF8,
+       .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
+                       P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
+       .adf702x_model = MODEL_ADF7021,
+       .adf702x_regs = adf7021_regs,
+       .tx_reg = TXREG,
+};
+static inline void adf702x_mac_init(void)
+{
+       random_ether_addr(adf7021_platform_data.mac_addr);
+}
+#else
+static inline void adf702x_mac_init(void) {}
+#endif
+
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+#include <linux/spi/ads7846.h>
+static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
+       .bits_per_word  = 8,
+};
+
+static int ads7873_get_pendown_state(void)
+{
+       return gpio_get_value(GPIO_PF6);
+}
+
+static struct ads7846_platform_data __initdata ad7873_pdata = {
+       .model          = 7873,         /* AD7873 */
+       .x_max          = 0xfff,
+       .y_max          = 0xfff,
+       .x_plate_ohms   = 620,
+       .debounce_max   = 1,
+       .debounce_rep   = 0,
+       .debounce_tol   = (~0),
+       .get_pendown_state = ads7873_get_pendown_state,
+};
+#endif
+
 #if defined(CONFIG_MTD_DATAFLASH) \
        || defined(CONFIG_MTD_DATAFLASH_MODULE)
 
@@ -845,6 +908,13 @@ static struct bfin5xx_spi_chip data_flash_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
+static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
+       .enable_dma = 0,         /* use dma transfer with this chip*/
+       .bits_per_word = 8,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
@@ -883,39 +953,31 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
        },
 #endif
 
-#if defined(CONFIG_SND_BLACKFIN_AD1836) \
-       || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
+       || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
        {
-               .modalias = "ad1836-spi",
+               .modalias = "ad183x",
                .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
-               .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
+               .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
+               .platform_data = "ad1836", /* only includes chip name for the moment */
                .controller_data = &ad1836_spi_chip_info,
+               .mode = SPI_MODE_3,
        },
 #endif
 
-#if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
+#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
        {
-               .modalias = "ad1938-spi",
+               .modalias = "ad193x",
                .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
-               .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
+               .chip_select = 5,
                .controller_data = &ad1938_spi_chip_info,
                .mode = SPI_MODE_3,
        },
 #endif
 
-#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
-       {
-               .modalias = "ad9960-spi",
-               .max_speed_hz = 10000000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = 1,
-               .controller_data = &ad9960_spi_chip_info,
-       },
-#endif
-
-#if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
+#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
        {
                .modalias = "ad714x_captouch",
                .max_speed_hz = 1000000,     /* max spi clock (SCK) speed in HZ */
@@ -923,37 +985,39 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .bus_num = 0,
                .chip_select = 5,
                .mode = SPI_MODE_3,
-               .platform_data = &ad7147_platfrom_data,
+               .platform_data = &ad7147_spi_platform_data,
                .controller_data = &ad7147_spi_chip_info,
        },
 #endif
 
-#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
+#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
        {
-               .modalias = "mmc_spi",
-               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
+               .modalias = "ad2s90",
                .bus_num = 0,
-               .chip_select = 4,
-               .platform_data = &bfin_mmc_spi_pdata,
-               .controller_data = &mmc_spi_chip_info,
-               .mode = SPI_MODE_3,
+               .chip_select = 3,            /* change it for your board */
+               .platform_data = NULL,
+               .controller_data = &ad2s90_spi_chip_info,
        },
 #endif
-#if defined(CONFIG_PBX)
+
+#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
        {
-               .modalias = "fxs-spi",
-               .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
+               .modalias = "ad2s120x",
                .bus_num = 0,
-               .chip_select = 8 - CONFIG_J11_JUMPER,
-               .controller_data = &spi_si3xxx_chip_info,
-               .mode = SPI_MODE_3,
+               .chip_select = 4,            /* CS, change it for your board */
+               .platform_data = ad2s120x_platform_data,
+               .controller_data = &ad2s120x_spi_chip_info,
        },
+#endif
+
+#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
        {
-               .modalias = "fxo-spi",
-               .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
+               .modalias = "mmc_spi",
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
-               .chip_select = 8 - CONFIG_J19_JUMPER,
-               .controller_data = &spi_si3xxx_chip_info,
+               .chip_select = 4,
+               .platform_data = &bfin_mmc_spi_pdata,
+               .controller_data = &mmc_spi_chip_info,
                .mode = SPI_MODE_3,
        },
 #endif
@@ -1010,6 +1074,41 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .mode = SPI_MODE_0,
        },
 #endif
+#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
+       {
+               .modalias       = "adxl34x",
+               .platform_data  = &adxl34x_info,
+               .irq            = IRQ_PF6,
+               .max_speed_hz   = 5000000,    /* max spi clock (SCK) speed in HZ */
+               .bus_num        = 0,
+               .chip_select    = 2,
+               .controller_data = &spi_adxl34x_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
+       {
+               .modalias = "adf702x",
+               .max_speed_hz = 16000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 0,       /* GPIO controlled SSEL */
+               .controller_data = &adf7021_spi_chip_info,
+               .platform_data = &adf7021_platform_data,
+               .mode = SPI_MODE_0,
+       },
+#endif
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+       {
+               .modalias = "ads7846",
+               .max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .irq = IRQ_PF6,
+               .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
+               .controller_data = &ad7873_spi_chip_info,
+               .platform_data = &ad7873_pdata,
+               .mode = SPI_MODE_0,
+       },
+#endif
 };
 
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -1121,19 +1220,14 @@ static struct platform_device bfin_fb_device = {
 };
 #endif
 
-#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
-static struct platform_device bfin_fb_adv7393_device = {
-       .name = "bfin-adv7393",
-};
-#endif
-
 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
 #include <asm/bfin-lq035q1.h>
 
 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
-       .mode =         LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
-       .use_bl =       0,      /* let something else control the LCD Blacklight */
-       .gpio_bl =      GPIO_PF7,
+       .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
+       .ppi_mode = USE_RGB565_16_BIT_PPI,
+       .use_bl = 0,    /* let something else control the LCD Blacklight */
+       .gpio_bl = GPIO_PF7,
 };
 
 static struct resource bfin_lq035q1_resources[] = {
@@ -1147,8 +1241,8 @@ static struct resource bfin_lq035q1_resources[] = {
 static struct platform_device bfin_lq035q1_device = {
        .name           = "bfin-lq035q1",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(bfin_lq035q1_resources),
-       .resource       = bfin_lq035q1_resources,
+       .num_resources  = ARRAY_SIZE(bfin_lq035q1_resources),
+       .resource       = bfin_lq035q1_resources,
        .dev            = {
                .platform_data = &bfin_lq035q1_data,
        },
@@ -1156,30 +1250,105 @@ static struct platform_device bfin_lq035q1_device = {
 #endif
 
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
-static struct resource bfin_uart_resources[] = {
 #ifdef CONFIG_SERIAL_BFIN_UART0
+static struct resource bfin_uart0_resources[] = {
        {
-               .start = 0xFFC00400,
-               .end = 0xFFC004FF,
+               .start = UART0_THR,
+               .end = UART0_GCTL+2,
                .flags = IORESOURCE_MEM,
        },
+       {
+               .start = IRQ_UART0_RX,
+               .end = IRQ_UART0_RX+1,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_UART0_ERROR,
+               .end = IRQ_UART0_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = CH_UART0_TX,
+               .end = CH_UART0_TX,
+               .flags = IORESOURCE_DMA,
+       },
+       {
+               .start = CH_UART0_RX,
+               .end = CH_UART0_RX,
+               .flags = IORESOURCE_DMA,
+       },
+#ifdef CONFIG_BFIN_UART0_CTSRTS
+       {       /* CTS pin */
+               .start = GPIO_PG7,
+               .end = GPIO_PG7,
+               .flags = IORESOURCE_IO,
+       },
+       {       /* RTS pin */
+               .start = GPIO_PG6,
+               .end = GPIO_PG6,
+               .flags = IORESOURCE_IO,
+       },
+#endif
+};
+
+unsigned short bfin_uart0_peripherals[] = {
+       P_UART0_TX, P_UART0_RX, 0
+};
+
+static struct platform_device bfin_uart0_device = {
+       .name = "bfin-uart",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_uart0_resources),
+       .resource = bfin_uart0_resources,
+       .dev = {
+               .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
+       },
+};
 #endif
 #ifdef CONFIG_SERIAL_BFIN_UART1
+static struct resource bfin_uart1_resources[] = {
        {
-               .start = 0xFFC02000,
-               .end = 0xFFC020FF,
+               .start = UART1_THR,
+               .end = UART1_GCTL+2,
                .flags = IORESOURCE_MEM,
        },
-#endif
+       {
+               .start = IRQ_UART1_RX,
+               .end = IRQ_UART1_RX+1,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_UART1_ERROR,
+               .end = IRQ_UART1_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = CH_UART1_TX,
+               .end = CH_UART1_TX,
+               .flags = IORESOURCE_DMA,
+       },
+       {
+               .start = CH_UART1_RX,
+               .end = CH_UART1_RX,
+               .flags = IORESOURCE_DMA,
+       },
+};
+
+unsigned short bfin_uart1_peripherals[] = {
+       P_UART1_TX, P_UART1_RX, 0
 };
 
-static struct platform_device bfin_uart_device = {
+static struct platform_device bfin_uart1_device = {
        .name = "bfin-uart",
        .id = 1,
-       .num_resources = ARRAY_SIZE(bfin_uart_resources),
-       .resource = bfin_uart_resources,
+       .num_resources = ARRAY_SIZE(bfin_uart1_resources),
+       .resource = bfin_uart1_resources,
+       .dev = {
+               .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
+       },
 };
 #endif
+#endif
 
 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
 #ifdef CONFIG_BFIN_SIR0
@@ -1259,8 +1428,6 @@ static struct platform_device i2c_bfin_twi_device = {
 #endif
 
 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
-#include <linux/input.h>
-#include <linux/i2c/adp5588.h>
 static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
        [0]      = KEY_GRAVE,
        [1]      = KEY_1,
@@ -1352,35 +1519,33 @@ static struct adp5588_kpad_platform_data adp5588_kpad_data = {
         *  ADP5520/5501 Backlight Data
         */
 
-static struct adp5520_backlight_platfrom_data adp5520_backlight_data = {
-       .fade_in                = FADE_T_1200ms,
-       .fade_out               = FADE_T_1200ms,
-       .fade_led_law           = BL_LAW_LINEAR,
-       .en_ambl_sens           = 1,
-       .abml_filt              = BL_AMBL_FILT_640ms,
-       .l1_daylight_max        = BL_CUR_mA(15),
-       .l1_daylight_dim        = BL_CUR_mA(0),
-       .l2_office_max          = BL_CUR_mA(7),
-       .l2_office_dim          = BL_CUR_mA(0),
-       .l3_dark_max            = BL_CUR_mA(3),
-       .l3_dark_dim            = BL_CUR_mA(0),
-       .l2_trip                = L2_COMP_CURR_uA(700),
-       .l2_hyst                = L2_COMP_CURR_uA(50),
-       .l3_trip                = L3_COMP_CURR_uA(80),
-       .l3_hyst                = L3_COMP_CURR_uA(20),
+static struct adp5520_backlight_platform_data adp5520_backlight_data = {
+       .fade_in                = ADP5520_FADE_T_1200ms,
+       .fade_out               = ADP5520_FADE_T_1200ms,
+       .fade_led_law           = ADP5520_BL_LAW_LINEAR,
+       .en_ambl_sens           = 1,
+       .abml_filt              = ADP5520_BL_AMBL_FILT_640ms,
+       .l1_daylight_max        = ADP5520_BL_CUR_mA(15),
+       .l1_daylight_dim        = ADP5520_BL_CUR_mA(0),
+       .l2_office_max          = ADP5520_BL_CUR_mA(7),
+       .l2_office_dim          = ADP5520_BL_CUR_mA(0),
+       .l3_dark_max            = ADP5520_BL_CUR_mA(3),
+       .l3_dark_dim            = ADP5520_BL_CUR_mA(0),
+       .l2_trip                = ADP5520_L2_COMP_CURR_uA(700),
+       .l2_hyst                = ADP5520_L2_COMP_CURR_uA(50),
+       .l3_trip                = ADP5520_L3_COMP_CURR_uA(80),
+       .l3_hyst                = ADP5520_L3_COMP_CURR_uA(20),
 };
 
        /*
         *  ADP5520/5501 LEDs Data
         */
 
-#include <linux/leds.h>
-
 static struct led_info adp5520_leds[] = {
        {
                .name = "adp5520-led1",
                .default_trigger = "none",
-               .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms,
+               .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
        },
 #ifdef ADP5520_EN_ALL_LEDS
        {
@@ -1396,51 +1561,50 @@ static struct led_info adp5520_leds[] = {
 #endif
 };
 
-static struct adp5520_leds_platfrom_data adp5520_leds_data = {
+static struct adp5520_leds_platform_data adp5520_leds_data = {
        .num_leds = ARRAY_SIZE(adp5520_leds),
        .leds = adp5520_leds,
-       .fade_in = FADE_T_600ms,
-       .fade_out = FADE_T_600ms,
-       .led_on_time = LED_ONT_600ms,
+       .fade_in = ADP5520_FADE_T_600ms,
+       .fade_out = ADP5520_FADE_T_600ms,
+       .led_on_time = ADP5520_LED_ONT_600ms,
 };
 
        /*
         *  ADP5520 GPIO Data
         */
 
-static struct adp5520_gpio_platfrom_data adp5520_gpio_data = {
+static struct adp5520_gpio_platform_data adp5520_gpio_data = {
        .gpio_start = 50,
-       .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
-       .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
+       .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
+       .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
 };
 
        /*
         *  ADP5520 Keypad Data
         */
 
-#include <linux/input.h>
 static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
-       [KEY(0, 0)]     = KEY_GRAVE,
-       [KEY(0, 1)]     = KEY_1,
-       [KEY(0, 2)]     = KEY_2,
-       [KEY(0, 3)]     = KEY_3,
-       [KEY(1, 0)]     = KEY_4,
-       [KEY(1, 1)]     = KEY_5,
-       [KEY(1, 2)]     = KEY_6,
-       [KEY(1, 3)]     = KEY_7,
-       [KEY(2, 0)]     = KEY_8,
-       [KEY(2, 1)]     = KEY_9,
-       [KEY(2, 2)]     = KEY_0,
-       [KEY(2, 3)]     = KEY_MINUS,
-       [KEY(3, 0)]     = KEY_EQUAL,
-       [KEY(3, 1)]     = KEY_BACKSLASH,
-       [KEY(3, 2)]     = KEY_BACKSPACE,
-       [KEY(3, 3)]     = KEY_ENTER,
-};
-
-static struct adp5520_keys_platfrom_data adp5520_keys_data = {
-       .rows_en_mask   = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0,
-       .cols_en_mask   = COL_C3 | COL_C2 | COL_C1 | COL_C0,
+       [ADP5520_KEY(0, 0)]     = KEY_GRAVE,
+       [ADP5520_KEY(0, 1)]     = KEY_1,
+       [ADP5520_KEY(0, 2)]     = KEY_2,
+       [ADP5520_KEY(0, 3)]     = KEY_3,
+       [ADP5520_KEY(1, 0)]     = KEY_4,
+       [ADP5520_KEY(1, 1)]     = KEY_5,
+       [ADP5520_KEY(1, 2)]     = KEY_6,
+       [ADP5520_KEY(1, 3)]     = KEY_7,
+       [ADP5520_KEY(2, 0)]     = KEY_8,
+       [ADP5520_KEY(2, 1)]     = KEY_9,
+       [ADP5520_KEY(2, 2)]     = KEY_0,
+       [ADP5520_KEY(2, 3)]     = KEY_MINUS,
+       [ADP5520_KEY(3, 0)]     = KEY_EQUAL,
+       [ADP5520_KEY(3, 1)]     = KEY_BACKSLASH,
+       [ADP5520_KEY(3, 2)]     = KEY_BACKSPACE,
+       [ADP5520_KEY(3, 3)]     = KEY_ENTER,
+};
+
+static struct adp5520_keys_platform_data adp5520_keys_data = {
+       .rows_en_mask   = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
+       .cols_en_mask   = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
        .keymap         = adp5520_keymap,
        .keymapsize     = ARRAY_SIZE(adp5520_keymap),
        .repeat         = 0,
@@ -1450,44 +1614,223 @@ static struct adp5520_keys_platfrom_data adp5520_keys_data = {
         *  ADP5520/5501 Multifuction Device Init Data
         */
 
-static struct adp5520_subdev_info adp5520_subdevs[] = {
+static struct adp5520_platform_data adp5520_pdev_data = {
+       .backlight = &adp5520_backlight_data,
+       .leds = &adp5520_leds_data,
+       .gpio = &adp5520_gpio_data,
+       .keys = &adp5520_keys_data,
+};
+
+#endif
+
+#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
+static struct adp5588_gpio_platform_data adp5588_gpio_data = {
+       .gpio_start = 50,
+       .pullup_dis_mask = 0,
+};
+#endif
+
+#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
+#include <linux/i2c/adp8870.h>
+static struct led_info adp8870_leds[] = {
        {
-               .name = "adp5520-backlight",
-               .id = ID_ADP5520,
-               .platform_data = &adp5520_backlight_data,
+               .name = "adp8870-led7",
+               .default_trigger = "none",
+               .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
        },
+};
+
+
+static struct adp8870_backlight_platform_data adp8870_pdata = {
+       .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
+                        ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
+       .pwm_assign = 0,                                /* 1 = Enables PWM mode */
+
+       .bl_fade_in = ADP8870_FADE_T_1200ms,            /* Backlight Fade-In Timer */
+       .bl_fade_out = ADP8870_FADE_T_1200ms,           /* Backlight Fade-Out Timer */
+       .bl_fade_law = ADP8870_FADE_LAW_CUBIC1,         /* fade-on/fade-off transfer characteristic */
+
+       .en_ambl_sens = 1,                              /* 1 = enable ambient light sensor */
+       .abml_filt = ADP8870_BL_AMBL_FILT_320ms,        /* Light sensor filter time */
+
+       .l1_daylight_max = ADP8870_BL_CUR_mA(20),       /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l1_daylight_dim = ADP8870_BL_CUR_mA(0),        /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l2_bright_max = ADP8870_BL_CUR_mA(14),         /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l2_bright_dim = ADP8870_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l3_office_max = ADP8870_BL_CUR_mA(6),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l3_office_dim = ADP8870_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l4_indoor_max = ADP8870_BL_CUR_mA(3),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l4_indor_dim = ADP8870_BL_CUR_mA(0),           /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l5_dark_max = ADP8870_BL_CUR_mA(2),            /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l5_dark_dim = ADP8870_BL_CUR_mA(0),            /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+
+       .l2_trip = ADP8870_L2_COMP_CURR_uA(710),        /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
+       .l2_hyst = ADP8870_L2_COMP_CURR_uA(73),         /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
+       .l3_trip = ADP8870_L3_COMP_CURR_uA(389),        /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
+       .l3_hyst = ADP8870_L3_COMP_CURR_uA(54),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
+       .l4_trip = ADP8870_L4_COMP_CURR_uA(167),        /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
+       .l4_hyst = ADP8870_L4_COMP_CURR_uA(16),         /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
+       .l5_trip = ADP8870_L5_COMP_CURR_uA(43),         /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
+       .l5_hyst = ADP8870_L5_COMP_CURR_uA(11),         /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
+
+       .leds = adp8870_leds,
+       .num_leds = ARRAY_SIZE(adp8870_leds),
+       .led_fade_law = ADP8870_FADE_LAW_SQUARE,        /* fade-on/fade-off transfer characteristic */
+       .led_fade_in = ADP8870_FADE_T_600ms,
+       .led_fade_out = ADP8870_FADE_T_600ms,
+       .led_on_time = ADP8870_LED_ONT_200ms,
+};
+#endif
+
+#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
+#include <linux/i2c/adp8860.h>
+static struct led_info adp8860_leds[] = {
        {
-               .name = "adp5520-led",
-               .id = ID_ADP5520,
-               .platform_data = &adp5520_leds_data,
+               .name = "adp8860-led7",
+               .default_trigger = "none",
+               .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
        },
-       {
-               .name = "adp5520-gpio",
-               .id = ID_ADP5520,
-               .platform_data = &adp5520_gpio_data,
+};
+
+static struct adp8860_backlight_platform_data adp8860_pdata = {
+       .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
+                        ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
+
+       .bl_fade_in = ADP8860_FADE_T_1200ms,            /* Backlight Fade-In Timer */
+       .bl_fade_out = ADP8860_FADE_T_1200ms,           /* Backlight Fade-Out Timer */
+       .bl_fade_law = ADP8860_FADE_LAW_CUBIC1,         /* fade-on/fade-off transfer characteristic */
+
+       .en_ambl_sens = 1,                              /* 1 = enable ambient light sensor */
+       .abml_filt = ADP8860_BL_AMBL_FILT_320ms,        /* Light sensor filter time */
+
+       .l1_daylight_max = ADP8860_BL_CUR_mA(20),       /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l1_daylight_dim = ADP8860_BL_CUR_mA(0),        /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l2_office_max = ADP8860_BL_CUR_mA(6),          /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l2_office_dim = ADP8860_BL_CUR_mA(0),          /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l3_dark_max = ADP8860_BL_CUR_mA(2),            /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
+       .l3_dark_dim = ADP8860_BL_CUR_mA(0),            /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
+
+       .l2_trip = ADP8860_L2_COMP_CURR_uA(710),        /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
+       .l2_hyst = ADP8860_L2_COMP_CURR_uA(73),         /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
+       .l3_trip = ADP8860_L3_COMP_CURR_uA(43),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
+       .l3_hyst = ADP8860_L3_COMP_CURR_uA(11),         /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
+
+       .leds = adp8860_leds,
+       .num_leds = ARRAY_SIZE(adp8860_leds),
+       .led_fade_law = ADP8860_FADE_LAW_SQUARE,        /* fade-on/fade-off transfer characteristic */
+       .led_fade_in = ADP8860_FADE_T_600ms,
+       .led_fade_out = ADP8860_FADE_T_600ms,
+       .led_on_time = ADP8860_LED_ONT_200ms,
+};
+#endif
+
+#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
+static struct regulator_consumer_supply ad5398_consumer = {
+       .supply = "current",
+};
+
+static struct regulator_init_data ad5398_regulator_data = {
+       .constraints = {
+               .name = "current range",
+               .max_uA = 120000,
+               .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
        },
-       {
-               .name = "adp5520-keys",
-               .id = ID_ADP5520,
-               .platform_data = &adp5520_keys_data,
+       .num_consumer_supplies = 1,
+       .consumer_supplies     = &ad5398_consumer,
+};
+
+static struct ad5398_platform_data ad5398_i2c_platform_data = {
+       .current_bits = 10,
+       .current_offset = 4,
+       .regulator_data = &ad5398_regulator_data,
+};
+
+#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
+       defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
+static struct platform_device ad5398_virt_consumer_device = {
+       .name = "reg-virt-consumer",
+       .id = 0,
+       .dev = {
+               .platform_data = "current", /* Passed to driver */
        },
 };
+#endif
+#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
+       defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
+static struct regulator_bulk_data ad5398_bulk_data = {
+       .supply = "current",
+};
 
-static struct adp5520_platform_data adp5520_pdev_data = {
-       .num_subdevs = ARRAY_SIZE(adp5520_subdevs),
-       .subdevs = adp5520_subdevs,
+static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
+       .name = "ad5398",
+       .num_supplies = 1,
+       .supplies = &ad5398_bulk_data,
 };
 
+static struct platform_device ad5398_userspace_consumer_device = {
+       .name = "reg-userspace-consumer",
+       .id = 0,
+       .dev = {
+               .platform_data = &ad5398_userspace_comsumer_data,
+       },
+};
+#endif
 #endif
 
 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
-#if defined(CONFIG_INPUT_EVAL_AD7142EB)
+#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
        {
                I2C_BOARD_INFO("ad7142_captouch", 0x2C),
                .irq = IRQ_PG5,
-               .platform_data = (void *)&ad7142_platfrom_data,
+               .platform_data = (void *)&ad7142_i2c_platform_data,
+       },
+#endif
+
+#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
+       {
+               I2C_BOARD_INFO("ad7150", 0x48),
+               .irq = IRQ_PG5, /* fixme: use real interrupt number */
+       },
+#endif
+
+#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
+       {
+               I2C_BOARD_INFO("ad7152", 0x48),
+       },
+#endif
+
+#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
+       {
+               I2C_BOARD_INFO("ad774x", 0x48),
+       },
+#endif
+
+#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
+       {
+               I2C_BOARD_INFO("ad7414", 0x9),
+               .irq = IRQ_PG5,
+               /*
+                * platform_data pointer is borrwoed by the driver to
+                * store custimer defined IRQ ALART level mode.
+                * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
+                */
+               .platform_data = (void *)IRQF_TRIGGER_LOW,
+       },
+#endif
+
+#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
+       {
+               I2C_BOARD_INFO("ad7417", 0xb),
+               .irq = IRQ_PG5,
+               /*
+                * platform_data pointer is borrwoed by the driver to
+                * store custimer defined IRQ ALART level mode.
+                * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
+                */
+               .platform_data = (void *)IRQF_TRIGGER_LOW,
        },
 #endif
+
 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
        {
                I2C_BOARD_INFO("pcf8574_lcd", 0x22),
@@ -1527,19 +1870,137 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
                .platform_data = (void *)&adxl34x_info,
        },
 #endif
+#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
+       {
+               I2C_BOARD_INFO("adp5588-gpio", 0x34),
+               .platform_data = (void *)&adp5588_gpio_data,
+       },
+#endif
+#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
+       {
+               I2C_BOARD_INFO("bfin-adv7393", 0x2B),
+       },
+#endif
+#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
+       {
+               I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
+       },
+#endif
+#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
+       {
+               I2C_BOARD_INFO("adp8870", 0x2B),
+               .platform_data = (void *)&adp8870_pdata,
+       },
+#endif
+#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
+       {
+               I2C_BOARD_INFO("adau1371", 0x1A),
+       },
+#endif
+#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
+       {
+               I2C_BOARD_INFO("adau1761", 0x38),
+       },
+#endif
+#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
+       {
+               I2C_BOARD_INFO("adau1361", 0x38),
+       },
+#endif
+#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
+       {
+               I2C_BOARD_INFO("ad5258", 0x18),
+       },
+#endif
+#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
+       {
+               I2C_BOARD_INFO("ssm2602", 0x1b),
+       },
+#endif
+#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
+       {
+               I2C_BOARD_INFO("ad5398", 0xC),
+               .platform_data = (void *)&ad5398_i2c_platform_data,
+       },
+#endif
+#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
+       {
+               I2C_BOARD_INFO("adp8860", 0x2A),
+               .platform_data = (void *)&adp8860_pdata,
+       },
+#endif
 };
 
 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
+static struct resource bfin_sport0_uart_resources[] = {
+       {
+               .start = SPORT0_TCR1,
+               .end = SPORT0_MRCS3+4,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_SPORT0_RX,
+               .end = IRQ_SPORT0_RX+1,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_SPORT0_ERROR,
+               .end = IRQ_SPORT0_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+unsigned short bfin_sport0_peripherals[] = {
+       P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
+       P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
+};
+
 static struct platform_device bfin_sport0_uart_device = {
        .name = "bfin-sport-uart",
        .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
+       .resource = bfin_sport0_uart_resources,
+       .dev = {
+               .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
+       },
+};
+#endif
+#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
+static struct resource bfin_sport1_uart_resources[] = {
+       {
+               .start = SPORT1_TCR1,
+               .end = SPORT1_MRCS3+4,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_SPORT1_RX,
+               .end = IRQ_SPORT1_RX+1,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_SPORT1_ERROR,
+               .end = IRQ_SPORT1_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+unsigned short bfin_sport1_peripherals[] = {
+       P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
+       P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
 };
 
 static struct platform_device bfin_sport1_uart_device = {
        .name = "bfin-sport-uart",
        .id = 1,
+       .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
+       .resource = bfin_sport1_uart_resources,
+       .dev = {
+               .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
+       },
 };
 #endif
+#endif
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
@@ -1628,6 +2089,121 @@ static struct platform_device bfin_dpmc = {
        },
 };
 
+#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+static struct platform_device bfin_i2s = {
+       .name = "bfin-i2s",
+       .id = CONFIG_SND_BF5XX_SPORT_NUM,
+       /* TODO: add platform data here */
+};
+#endif
+
+#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
+static struct platform_device bfin_tdm = {
+       .name = "bfin-tdm",
+       .id = CONFIG_SND_BF5XX_SPORT_NUM,
+       /* TODO: add platform data here */
+};
+#endif
+
+#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
+static struct platform_device bfin_ac97 = {
+       .name = "bfin-ac97",
+       .id = CONFIG_SND_BF5XX_SPORT_NUM,
+       /* TODO: add platform data here */
+};
+#endif
+
+#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
+#define REGULATOR_ADP122        "adp122"
+#define REGULATOR_ADP150        "adp150"
+
+static struct regulator_consumer_supply adp122_consumers = {
+               .supply = REGULATOR_ADP122,
+};
+
+static struct regulator_consumer_supply adp150_consumers = {
+               .supply = REGULATOR_ADP150,
+};
+
+static struct regulator_init_data adp_switch_regulator_data[] = {
+       {
+               .constraints = {
+                       .name = REGULATOR_ADP122,
+                       .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+                       .min_uA = 0,
+                       .max_uA = 300000,
+               },
+               .num_consumer_supplies = 1,     /* only 1 */
+               .consumer_supplies     = &adp122_consumers,
+               .driver_data           = (void *)GPIO_PF2, /* gpio port only */
+       },
+       {
+               .constraints = {
+                       .name = REGULATOR_ADP150,
+                       .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+                       .min_uA = 0,
+                       .max_uA = 150000,
+               },
+               .num_consumer_supplies = 1,     /* only 1 */
+               .consumer_supplies     = &adp150_consumers,
+               .driver_data           = (void *)GPIO_PF3, /* gpio port only */
+       },
+};
+
+static struct adp_switch_platform_data adp_switch_pdata = {
+       .regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
+       .regulator_data = adp_switch_regulator_data,
+};
+
+static struct platform_device adp_switch_device = {
+       .name = "adp_switch",
+       .id = 0,
+       .dev = {
+               .platform_data = &adp_switch_pdata,
+       },
+};
+
+#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
+       defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
+static struct regulator_bulk_data adp122_bulk_data = {
+       .supply = REGULATOR_ADP122,
+};
+
+static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
+       .name = REGULATOR_ADP122,
+       .num_supplies = 1,
+       .supplies = &adp122_bulk_data,
+};
+
+static struct platform_device adp122_userspace_consumer_device = {
+       .name = "reg-userspace-consumer",
+       .id = 0,
+       .dev = {
+               .platform_data = &adp122_userspace_comsumer_data,
+       },
+};
+
+static struct regulator_bulk_data adp150_bulk_data = {
+       .supply = REGULATOR_ADP150,
+};
+
+static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
+       .name = REGULATOR_ADP150,
+       .num_supplies = 1,
+       .supplies = &adp150_bulk_data,
+};
+
+static struct platform_device adp150_userspace_consumer_device = {
+       .name = "reg-userspace-consumer",
+       .id = 1,
+       .dev = {
+               .platform_data = &adp150_userspace_comsumer_data,
+       },
+};
+#endif
+#endif
+
+
 static struct platform_device *stamp_devices[] __initdata = {
 
        &bfin_dpmc,
@@ -1660,8 +2236,8 @@ static struct platform_device *stamp_devices[] __initdata = {
        &dm9000_device,
 #endif
 
-#if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
-       &ax88180_device,
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+       &bfin_can_device,
 #endif
 
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
@@ -1690,12 +2266,13 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_lq035q1_device,
 #endif
 
-#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
-       &bfin_fb_adv7393_device,
-#endif
-
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
-       &bfin_uart_device,
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       &bfin_uart0_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_UART1
+       &bfin_uart1_device,
+#endif
 #endif
 
 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
@@ -1712,9 +2289,13 @@ static struct platform_device *stamp_devices[] __initdata = {
 #endif
 
 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
        &bfin_sport0_uart_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
        &bfin_sport1_uart_device,
 #endif
+#endif
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        &bfin_pata_device,
@@ -1724,8 +2305,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_device_gpiokeys,
 #endif
 
-       &bfin_gpios_device,
-
 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
        &bfin_async_nand_device,
 #endif
@@ -1733,15 +2312,47 @@ static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
        &stamp_flash_device,
 #endif
+
+#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
+       &bfin_i2s,
+#endif
+
+#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
+       &bfin_tdm,
+#endif
+
+#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
+       &bfin_ac97,
+#endif
+#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
+#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
+       defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
+       &ad5398_virt_consumer_device,
+#endif
+#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
+       defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
+       &ad5398_userspace_consumer_device,
+#endif
+#endif
+
+#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
+       &adp_switch_device,
+#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
+       defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
+       &adp122_userspace_consumer_device,
+       &adp150_userspace_consumer_device,
+#endif
+#endif
 };
 
 static int __init stamp_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
-       i2c_register_board_info(0, bfin_i2c_board_info,
-                               ARRAY_SIZE(bfin_i2c_board_info));
        bfin_plat_nand_init();
+       adf702x_mac_init();
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+       i2c_register_board_info(0, bfin_i2c_board_info,
+                               ARRAY_SIZE(bfin_i2c_board_info));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
        return 0;
@@ -1749,6 +2360,34 @@ static int __init stamp_init(void)
 
 arch_initcall(stamp_init);
 
+
+static struct platform_device *stamp_early_devices[] __initdata = {
+#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
+#ifdef CONFIG_SERIAL_BFIN_UART0
+       &bfin_uart0_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_UART1
+       &bfin_uart1_device,
+#endif
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
+#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
+       &bfin_sport0_uart_device,
+#endif
+#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
+       &bfin_sport1_uart_device,
+#endif
+#endif
+};
+
+void __init native_machine_early_platform_add_devices(void)
+{
+       printk(KERN_INFO "register early platform devices\n");
+       early_platform_add_devices(stamp_early_devices,
+               ARRAY_SIZE(stamp_early_devices));
+}
+
 void native_machine_restart(char *cmd)
 {
        /* workaround reboot hang when booting from SPI */