arm: tegra: cardhu: add support for PM315
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu.c
index d9e4a7d..b7d28db 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu.c
  *
- * Copyright (c) 2011-2012, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA CORPORATION.  All rights reserved.
  *
  * 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
 #include <linux/input.h>
 #include <linux/platform_data/tegra_usb.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/rm31080a_ts.h>
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/tegra_uart.h>
 #include <linux/memblock.h>
 #include <linux/spi-tegra.h>
 #include <linux/nfc/pn544.h>
+#include <linux/rfkill-gpio.h>
+#include <linux/of_platform.h>
 
 #include <sound/wm8903.h>
 #include <sound/max98095.h>
 
 #include <asm/hardware/gic.h>
 
+#include <mach/edp.h>
 #include <mach/clk.h>
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/pinmux.h>
 #include <mach/iomap.h>
+#include <mach/io_dpd.h>
 #include <mach/io.h>
 #include <mach/i2s.h>
 #include <mach/tegra_asoc_pdata.h>
+#include <mach/tegra_rt5640_pdata.h>
 #include <mach/tegra_wm8903_pdata.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/usb_phy.h>
-#include <mach/thermal.h>
 #include <mach/pci.h>
 #include <mach/gpio-tegra.h>
+#include <mach/tegra_fiq_debugger.h>
+
+#include <asm/hardware/gic.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
 
 #include "board.h"
+#include "board-common.h"
 #include "clock.h"
 #include "board-cardhu.h"
+#include "board-touch-raydium.h"
 #include "devices.h"
 #include "gpio-names.h"
 #include "fuse.h"
 #include "pm.h"
 #include "baseband-xmm-power.h"
 #include "wdt-recovery.h"
+#include "common.h"
 
-/* All units are in millicelsius */
-static struct tegra_thermal_data thermal_data = {
-       .temp_throttle = 85000,
-       .temp_shutdown = 90000,
-       .temp_offset = TDIODE_OFFSET, /* temps based on tdiode */
-#ifdef CONFIG_TEGRA_EDP_LIMITS
-       .edp_offset = TDIODE_OFFSET,  /* edp based on tdiode */
-       .hysteresis_edp = 3000,
-#endif
-#ifdef CONFIG_TEGRA_THERMAL_SYSFS
-       .tc1 = 0,
-       .tc2 = 1,
-       .passive_delay = 2000,
-#else
-       .hysteresis_throttle = 1000,
-#endif
-};
-
-/* !!!TODO: Change for cardhu (Taken from Ventana) */
-static struct tegra_utmip_config utmi_phy_config[] = {
-       [0] = {
-                       .hssync_start_delay = 0,
-                       .idle_wait_delay = 17,
-                       .elastic_limit = 16,
-                       .term_range_adj = 6,
-                       .xcvr_setup = 15,
-                       .xcvr_setup_offset = 0,
-                       .xcvr_use_fuses = 1,
-                       .xcvr_lsfslew = 2,
-                       .xcvr_lsrslew = 2,
-       },
-       [1] = {
-                       .hssync_start_delay = 0,
-                       .idle_wait_delay = 17,
-                       .elastic_limit = 16,
-                       .term_range_adj = 6,
-                       .xcvr_setup = 15,
-                       .xcvr_setup_offset = 0,
-                       .xcvr_use_fuses = 1,
-                       .xcvr_lsfslew = 2,
-                       .xcvr_lsrslew = 2,
-       },
-       [2] = {
-                       .hssync_start_delay = 0,
-                       .idle_wait_delay = 17,
-                       .elastic_limit = 16,
-                       .term_range_adj = 6,
-                       .xcvr_setup = 8,
-                       .xcvr_setup_offset = 0,
-                       .xcvr_use_fuses = 1,
-                       .xcvr_lsfslew = 2,
-                       .xcvr_lsrslew = 2,
-       },
-};
-
-static struct resource cardhu_bcm4329_rfkill_resources[] = {
+static struct rfkill_gpio_platform_data cardhu_bt_rfkill_pdata[] = {
        {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PU0,
-               .end    = TEGRA_GPIO_PU0,
-               .flags  = IORESOURCE_IO,
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PU0,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
        },
 };
 
-static struct platform_device cardhu_bcm4329_rfkill_device = {
-       .name = "bcm4329_rfkill",
+static struct platform_device cardhu_bt_rfkill_device = {
+       .name = "rfkill_gpio",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(cardhu_bcm4329_rfkill_resources),
-       .resource       = cardhu_bcm4329_rfkill_resources,
+       .dev = {
+               .platform_data = &cardhu_bt_rfkill_pdata,
+       },
 };
 
 static struct resource cardhu_bluesleep_resources[] = {
@@ -158,8 +115,6 @@ static struct resource cardhu_bluesleep_resources[] = {
        },
        [2] = {
                .name = "host_wake",
-                       .start  = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PU6),
-                       .end    = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PU6),
                        .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        },
 };
@@ -173,9 +128,10 @@ static struct platform_device cardhu_bluesleep_device = {
 
 static noinline void __init cardhu_setup_bluesleep(void)
 {
+       cardhu_bluesleep_resources[2].start =
+               cardhu_bluesleep_resources[2].end =
+                       gpio_to_irq(TEGRA_GPIO_PU6);
        platform_device_register(&cardhu_bluesleep_device);
-       tegra_gpio_enable(TEGRA_GPIO_PU6);
-       tegra_gpio_enable(TEGRA_GPIO_PU1);
        return;
 }
 
@@ -202,6 +158,7 @@ static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = {
        { "i2c3",       "pll_p",        3200000,        false},
        { "i2c4",       "pll_p",        3200000,        false},
        { "i2c5",       "pll_p",        3200000,        false},
+       { "vi",         "pll_p",        0,              false},
        { NULL,         NULL,           0,              0},
 };
 
@@ -215,7 +172,6 @@ static struct i2c_board_info __initdata cardhu_i2c_bus3_board_info[] = {
        {
                I2C_BOARD_INFO("pn544", 0x28),
                .platform_data = &nfc_pdata,
-               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PX0),
        },
 };
 static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = {
@@ -230,7 +186,7 @@ static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = {
 static struct tegra_i2c_platform_data cardhu_i2c2_platform_data = {
        .adapter_nr     = 1,
        .bus_count      = 1,
-       .bus_clk_rate   = { 100000, 0 },
+       .bus_clk_rate   = { 400000, 0 },
        .is_clkon_always = true,
        .scl_gpio               = {TEGRA_GPIO_PT5, 0},
        .sda_gpio               = {TEGRA_GPIO_PT6, 0},
@@ -249,7 +205,7 @@ static struct tegra_i2c_platform_data cardhu_i2c3_platform_data = {
 static struct tegra_i2c_platform_data cardhu_i2c4_platform_data = {
        .adapter_nr     = 3,
        .bus_count      = 1,
-       .bus_clk_rate   = { 100000, 0 },
+       .bus_clk_rate   = { 10000, 0 },
        .scl_gpio               = {TEGRA_GPIO_PV4, 0},
        .sda_gpio               = {TEGRA_GPIO_PV5, 0},
        .arb_recovery = arb_lost_recovery,
@@ -381,23 +337,29 @@ static struct max98095_pdata cardhu_max98095_pdata = {
 
 static struct i2c_board_info __initdata cardhu_codec_wm8903_info = {
        I2C_BOARD_INFO("wm8903", 0x1a),
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
        .platform_data = &cardhu_wm8903_pdata,
 };
 
 static struct i2c_board_info __initdata cardhu_codec_aic326x_info = {
        I2C_BOARD_INFO("aic3262-codec", 0x18),
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
 };
 
 static struct i2c_board_info __initdata cardhu_codec_max98095_info = {
        I2C_BOARD_INFO("max98095", 0x10),
-       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
        .platform_data = &cardhu_max98095_pdata,
 };
 
+static struct i2c_board_info __initdata rt5640_board_info = {
+       I2C_BOARD_INFO("rt5640", 0x1c),
+};
+
+
 static void cardhu_i2c_init(void)
 {
+       struct board_info board_info;
+
+               tegra_get_board_info(&board_info);
+
        tegra_i2c_device1.dev.platform_data = &cardhu_i2c1_platform_data;
        tegra_i2c_device2.dev.platform_data = &cardhu_i2c2_platform_data;
        tegra_i2c_device3.dev.platform_data = &cardhu_i2c3_platform_data;
@@ -410,10 +372,17 @@ static void cardhu_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device1);
 
-       i2c_register_board_info(4, &cardhu_codec_wm8903_info, 1);
+       cardhu_codec_wm8903_info.irq = cardhu_codec_max98095_info.irq =
+               cardhu_codec_aic326x_info.irq = gpio_to_irq(TEGRA_GPIO_CDC_IRQ);
+
+       if (board_info.board_id == BOARD_PM315)
+               i2c_register_board_info(4, &rt5640_board_info, 1);
+       else
+               i2c_register_board_info(4, &cardhu_codec_wm8903_info, 1);
        i2c_register_board_info(4, &cardhu_codec_max98095_info, 1);
        i2c_register_board_info(4, &cardhu_codec_aic326x_info, 1);
 
+       cardhu_i2c_bus3_board_info[0].irq = gpio_to_irq(TEGRA_GPIO_PX0);
        i2c_register_board_info(2, cardhu_i2c_bus3_board_info, 1);
 }
 
@@ -435,90 +404,50 @@ static struct uart_clk_parent uart_parent_clk[] = {
 static struct tegra_uart_platform_data cardhu_uart_pdata;
 static struct tegra_uart_platform_data cardhu_loopback_uart_pdata;
 
-static void __init uart_debug_init(void)
+static int __init uart_debug_init(void)
 {
        struct board_info board_info;
        int debug_port_id;
+       int default_debug_port = 0;
 
        tegra_get_board_info(&board_info);
 
-       debug_port_id = get_tegra_uart_debug_port_id();
-       if (debug_port_id < 0) {
-               debug_port_id = 0;
-                       /* UARTB is debug port
-                        *       for SLT - E1186/E1187/PM269
-                        *       for E1256/E1257
-                        */
-               if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
-                       ((board_info.board_id == BOARD_E1186) ||
-                       (board_info.board_id == BOARD_E1187) ||
-                       (board_info.board_id == BOARD_PM269))) ||
-                       (board_info.board_id == BOARD_E1256) ||
-                       (board_info.board_id == BOARD_E1257))
-                               debug_port_id = 1;
-       }
-
-       switch (debug_port_id) {
-       case 0:
-               /* UARTA is the debug port. */
-               pr_info("Selecting UARTA as the debug console\n");
-               cardhu_uart_devices[0] = &debug_uarta_device;
-               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uarta_device.dev.platform_data))->mapbase;
-               break;
-
-       case 1:
-               /* UARTB is the debug port. */
-               pr_info("Selecting UARTB as the debug console\n");
-               cardhu_uart_devices[1] = &debug_uartb_device;
-               debug_uart_clk =  clk_get_sys("serial8250.0", "uartb");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uartb_device.dev.platform_data))->mapbase;
-               break;
-
-       case 2:
-               /* UARTC is the debug port. */
-               pr_info("Selecting UARTC as the debug console\n");
-               cardhu_uart_devices[2] = &debug_uartc_device;
-               debug_uart_clk =  clk_get_sys("serial8250.0", "uartc");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uartc_device.dev.platform_data))->mapbase;
-               break;
-
-       case 3:
-               /* UARTD is the debug port. */
-               pr_info("Selecting UARTD as the debug console\n");
-               cardhu_uart_devices[3] = &debug_uartd_device;
-               debug_uart_clk =  clk_get_sys("serial8250.0", "uartd");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uartd_device.dev.platform_data))->mapbase;
-               break;
-
-       case 4:
-               /* UARTE is the debug port. */
-               pr_info("Selecting UARTE as the debug console\n");
-               cardhu_uart_devices[4] = &debug_uarte_device;
-               debug_uart_clk =  clk_get_sys("serial8250.0", "uarte");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uarte_device.dev.platform_data))->mapbase;
-               break;
-
-       default:
-               pr_info("The debug console id %d is invalid, Assuming UARTA", debug_port_id);
-               cardhu_uart_devices[0] = &debug_uarta_device;
-               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
-               debug_uart_port_base = ((struct plat_serial8250_port *)(
-                       debug_uarta_device.dev.platform_data))->mapbase;
-               break;
+       /* UARTB is debug port
+        *       for SLT - E1186/E1187/PM269
+        *       for E1256/E1257
+        */
+       if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
+               ((board_info.board_id == BOARD_E1186) ||
+               (board_info.board_id == BOARD_E1187) ||
+               (board_info.board_id == BOARD_PM269))) ||
+               (board_info.board_id == BOARD_E1256) ||
+               (board_info.board_id == BOARD_E1257))
+                       default_debug_port = 1;
+
+       debug_port_id = uart_console_debug_init(default_debug_port);
+       if (debug_port_id < 0)
+               return debug_port_id;
+
+#ifdef CONFIG_TEGRA_IRDA
+       if ((board_info.board_id == BOARD_E1186) ||
+               (board_info.board_id == BOARD_E1198)) {
+               if (debug_port_id == 1) {
+                       cardhu_irda_pdata.is_irda = false;
+                       pr_err("UARTB is not available for IrDA\n");
+               }
        }
-       return;
+#endif
+       cardhu_uart_devices[debug_port_id] = uart_console_debug_device;
+       return debug_port_id;
 }
 
 static void __init cardhu_uart_init(void)
 {
        struct clk *c;
        int i;
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
 
        for (i = 0; i < ARRAY_SIZE(uart_parent_clk); ++i) {
                c = tegra_get_clock_by_name(uart_parent_clk[i].name);
@@ -544,25 +473,20 @@ static void __init cardhu_uart_init(void)
        tegra_uarte_device.dev.platform_data = &cardhu_loopback_uart_pdata;
 
        /* Register low speed only if it is selected */
-       if (!is_tegra_debug_uartport_hs()) {
+       if (!is_tegra_debug_uartport_hs())
                uart_debug_init();
-               /* Clock enable for the debug channel */
-               if (!IS_ERR_OR_NULL(debug_uart_clk)) {
-                       pr_info("The debug console clock name is %s\n",
-                                               debug_uart_clk->name);
-                       c = tegra_get_clock_by_name("pll_p");
-                       if (IS_ERR_OR_NULL(c))
-                               pr_err("Not getting the parent clock pll_p\n");
-                       else
-                               clk_set_parent(debug_uart_clk, c);
-
-                       clk_enable(debug_uart_clk);
-                       clk_set_rate(debug_uart_clk, clk_get_rate(c));
-               } else {
-                       pr_err("Not getting the clock %s for debug console\n",
-                                       debug_uart_clk->name);
-               }
+
+#ifdef CONFIG_TEGRA_IRDA
+       if (((board_info.board_id == BOARD_E1186) ||
+               (board_info.board_id == BOARD_E1198)) &&
+                       cardhu_irda_pdata.is_irda) {
+               cardhu_irda_pdata.parent_clk_list = uart_parent_clk;
+               cardhu_irda_pdata.parent_clk_count =
+                                       ARRAY_SIZE(uart_parent_clk);
+
+               tegra_uartb_device.dev.platform_data = &cardhu_irda_pdata;
        }
+#endif
 
        platform_add_devices(cardhu_uart_devices,
                                ARRAY_SIZE(cardhu_uart_devices));
@@ -577,6 +501,19 @@ static struct platform_device *cardhu_spi_devices[] __initdata = {
        &tegra_spi_device4,
 };
 
+/*-----------------------------------------------------*/
+/* Force Cardhu Direct Touch:
+       Valid Choices:
+       0 : Do not force Direct Touch
+       2 : RM_PLATFORM_C210 : Cardhu 10" J-Touch Panel
+       4 : RM_PLATFORM_P005 ; Pluto 5" J-Touch Panel
+*/
+#define CARDHU_DT_PLATFORM     0 /* RM_PLATFORM_C210 */
+
+static struct platform_device *touch_spi_device[] __initdata = {
+       &tegra_spi_device1,
+};
+
 struct spi_clk_parent spi_parent_clk[] = {
        [0] = {.name = "pll_p"},
 #ifndef CONFIG_TEGRA_PLLM_RESTRICTED
@@ -598,9 +535,10 @@ static void __init cardhu_spi_init(void)
 {
        int i;
        struct clk *c;
-       struct board_info board_info;
+       struct board_info board_info, display_board_info;
 
        tegra_get_board_info(&board_info);
+       tegra_get_display_board_info(&display_board_info);
 
        for (i = 0; i < ARRAY_SIZE(spi_parent_clk); ++i) {
                c = tegra_get_clock_by_name(spi_parent_clk[i].name);
@@ -618,6 +556,12 @@ static void __init cardhu_spi_init(void)
        platform_add_devices(cardhu_spi_devices,
                                ARRAY_SIZE(cardhu_spi_devices));
 
+       if ((display_board_info.board_id == BOARD_DISPLAY_PM313)
+                                               || CARDHU_DT_PLATFORM) {
+               platform_add_devices(touch_spi_device,
+                               ARRAY_SIZE(touch_spi_device));
+       }
+
        if (board_info.board_id == BOARD_E1198) {
                tegra_spi_device2.dev.platform_data = &cardhu_spi_pdata;
                platform_device_register(&tegra_spi_device2);
@@ -656,12 +600,25 @@ static struct platform_device tegra_rtc_device = {
        .num_resources = ARRAY_SIZE(tegra_rtc_resources),
 };
 
-static struct tegra_wm8903_platform_data cardhu_audio_wm8903_pdata = {
+static struct tegra_asoc_platform_data cardhu_audio_wm8903_pdata = {
        .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
        .gpio_hp_det            = TEGRA_GPIO_HP_DET,
        .gpio_hp_mute           = -1,
        .gpio_int_mic_en        = -1,
        .gpio_ext_mic_en        = -1,
+       .i2s_param[HIFI_CODEC]  = {
+               .audio_port_id  = 0,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_I2S,
+       },
+       .i2s_param[BASEBAND]    = {
+               .audio_port_id  = -1,
+       },
+       .i2s_param[BT_SCO]      = {
+               .audio_port_id  = 3,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_DSP_A,
+       },
 };
 
 static struct tegra_asoc_platform_data cardhu_audio_max98095_pdata = {
@@ -670,6 +627,19 @@ static struct tegra_asoc_platform_data cardhu_audio_max98095_pdata = {
        .gpio_hp_mute           = -1,
        .gpio_int_mic_en        = -1,
        .gpio_ext_mic_en        = -1,
+       .i2s_param[HIFI_CODEC]  = {
+               .audio_port_id  = 0,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_I2S,
+       },
+       .i2s_param[BASEBAND]    = {
+               .audio_port_id  = -1,
+       },
+       .i2s_param[BT_SCO]      = {
+               .audio_port_id  = 3,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_DSP_A,
+       },
 };
 
 static struct platform_device cardhu_audio_wm8903_device = {
@@ -694,6 +664,19 @@ static struct tegra_asoc_platform_data cardhu_audio_aic326x_pdata = {
        .gpio_hp_mute           = -1,
        .gpio_int_mic_en        = -1,
        .gpio_ext_mic_en        = -1,
+       /*defaults for Verbier-Cardhu board with TI AIC326X codec*/
+       .i2s_param[HIFI_CODEC]  = {
+               .audio_port_id  = 0,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_I2S,
+               .sample_size    = 16,
+       },
+       .i2s_param[BT_SCO]      = {
+               .sample_size    = 16,
+               .audio_port_id  = 3,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_DSP_A,
+       },
 };
 
 static struct platform_device cardhu_audio_aic326x_device = {
@@ -704,14 +687,45 @@ static struct platform_device cardhu_audio_aic326x_device = {
        },
 };
 
+static struct tegra_asoc_platform_data beaver_audio_rt5640_pdata = {
+       .codec_name = "rt5640.4-001c",
+       .codec_dai_name = "rt5640-aif1",
+       .gpio_spkr_en           = TEGRA_GPIO_RTL_SPKR_EN,
+       .gpio_hp_det            = TEGRA_GPIO_RTL_HP_DET,
+       .gpio_hp_mute           = -1,
+       .gpio_int_mic_en        = TEGRA_GPIO_RTL_INT_MIC_EN,
+       .gpio_ext_mic_en        = -1,   /* TEGRA_GPIO_EXT_MIC_EN,*/
+               .i2s_param[HIFI_CODEC]  = {
+               .audio_port_id  = 0,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_I2S,
+       },
+       .i2s_param[BASEBAND]    = {
+               .audio_port_id  = -1,
+       },
+       .i2s_param[BT_SCO]      = {
+               .audio_port_id  = 3,
+               .is_i2s_master  = 1,
+               .i2s_mode       = TEGRA_DAIFMT_DSP_A,
+       },
+};
+
+static struct platform_device beaver_audio_rt5640_device = {
+       .name   = "tegra-snd-rt5640",
+       .id     = 0,
+       .dev    = {
+               .platform_data = &beaver_audio_rt5640_pdata,
+       },
+};
+
+
 static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_pmu_device,
        &tegra_rtc_device,
        &tegra_udc_device,
-#if defined(CONFIG_TEGRA_IOVMM_SMMU) ||  defined(CONFIG_TEGRA_IOMMU_SMMU)
-       &tegra_smmu_device,
-#endif
-       &tegra_wdt_device,
+       &tegra_wdt0_device,
+       &tegra_wdt1_device,
+       &tegra_wdt2_device,
 #if defined(CONFIG_TEGRA_AVP)
        &tegra_avp_device,
 #endif
@@ -730,246 +744,418 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &spdif_dit_device,
        &bluetooth_dit_device,
        &baseband_dit_device,
-       &cardhu_bcm4329_rfkill_device,
+       &cardhu_bt_rfkill_device,
        &tegra_pcm_device,
-       &cardhu_audio_wm8903_device,
        &cardhu_audio_max98095_device,
        &cardhu_audio_aic326x_device,
        &tegra_hda_device,
+       &tegra_cec_device,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
        &tegra_aes_device,
 #endif
 };
 
-#define MXT_CONFIG_CRC  0xD62DE8
-static const u8 config[] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0xFF, 0xFF, 0x32, 0x0A, 0x00, 0x14, 0x14, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x00, 0x00,
-       0x1B, 0x2A, 0x00, 0x20, 0x3C, 0x04, 0x05, 0x00,
-       0x02, 0x01, 0x00, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF,
-       0x02, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
-       0x00, 0x00, 0x00, 0x05, 0x0A, 0x15, 0x1E, 0x00,
-       0x00, 0x04, 0xFF, 0x03, 0x3F, 0x64, 0x64, 0x01,
-       0x0A, 0x14, 0x28, 0x4B, 0x00, 0x02, 0x00, 0x64,
-       0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x08, 0x10, 0x3C, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+static u8 read_chg(void)
+{
+       return gpio_get_value(TEGRA_GPIO_PH4);
+}
+
+static struct platform_device *cardhu_audio_devices[] __initdata = {
+               &cardhu_audio_wm8903_device,
+
 };
 
-#define MXT_CONFIG_CRC_SKU2000  0xA24D9A
-static const u8 config_sku2000[] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0xFF, 0xFF, 0x32, 0x0A, 0x00, 0x14, 0x14, 0x19,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x00, 0x00,
-       0x1B, 0x2A, 0x00, 0x20, 0x3A, 0x04, 0x05, 0x00,  //23=thr  2 di
-       0x04, 0x04, 0x41, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF,
-       0x02, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,  //0A=limit
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
-       0x00, 0x00, 0x00, 0x05, 0x0A, 0x15, 0x1E, 0x00,
-       0x00, 0x04, 0x00, 0x03, 0x3F, 0x64, 0x64, 0x01,
-       0x0A, 0x14, 0x28, 0x4B, 0x00, 0x02, 0x00, 0x64,
-       0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x08, 0x10, 0x3C, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+static struct platform_device *beaver_audio_devices[] __initdata = {
+               &beaver_audio_rt5640_device,
+
 };
 
+#define MXT_CFG_NAME            "Android_Cardhu_2012-01-31.cfg"
+
 static struct mxt_platform_data atmel_mxt_info = {
-       .x_line         = 27,
-       .y_line         = 42,
-       .x_size         = 768,
-       .y_size         = 1366,
-       .blen           = 0x20,
-       .threshold      = 0x3C,
-       .voltage        = 3300000,              /* 3.3V */
-       .orient         = 5,
-       .config         = config,
-       .config_length  = 157,
-       .config_crc     = MXT_CONFIG_CRC,
        .irqflags       = IRQF_TRIGGER_FALLING,
-/*     .read_chg       = &read_chg, */
-       .read_chg       = NULL,
+       .read_chg       = &read_chg,
+       .mxt_cfg_name   = MXT_CFG_NAME,
 };
 
 static struct i2c_board_info __initdata atmel_i2c_info[] = {
        {
-               I2C_BOARD_INFO("atmel_mxt_ts", 0x5A),
-               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PH4),
+               I2C_BOARD_INFO("atmel_mxt_ts", MXT1386_I2C_ADDR3),
+               .flags = I2C_CLIENT_WAKE,
                .platform_data = &atmel_mxt_info,
        }
 };
 
-static int __init cardhu_touch_init(void)
-{
-       struct board_info BoardInfo;
-
-       tegra_gpio_enable(TEGRA_GPIO_PH4);
-       tegra_gpio_enable(TEGRA_GPIO_PH6);
-
-       gpio_request(TEGRA_GPIO_PH4, "atmel-irq");
-       gpio_direction_input(TEGRA_GPIO_PH4);
-
-       gpio_request(TEGRA_GPIO_PH6, "atmel-reset");
-       gpio_direction_output(TEGRA_GPIO_PH6, 0);
-       msleep(1);
-       gpio_set_value(TEGRA_GPIO_PH6, 1);
-       msleep(100);
-
-       tegra_get_board_info(&BoardInfo);
-       if ((BoardInfo.sku & SKU_TOUCH_MASK) == SKU_TOUCH_2000) {
-               atmel_mxt_info.config = config_sku2000;
-               atmel_mxt_info.config_crc = MXT_CONFIG_CRC_SKU2000;
+static struct i2c_board_info __initdata e1506_atmel_i2c_info[] = {
+       {
+               I2C_BOARD_INFO("atmel_mxt_ts", MXT224_I2C_ADDR1),
+               .flags = I2C_CLIENT_WAKE,
+               .platform_data = &atmel_mxt_info,
        }
-
-       i2c_register_board_info(1, atmel_i2c_info, 1);
-
-       return 0;
-}
-
-static struct tegra_uhsic_config uhsic_phy_config = {
-       .enable_gpio = EN_HSIC_GPIO,
-       .reset_gpio = -1,
-       .sync_start_delay = 9,
-       .idle_wait_delay = 17,
-       .term_range_adj = 0,
-       .elastic_underrun_limit = 16,
-       .elastic_overrun_limit = 16,
 };
 
-static struct tegra_ehci_platform_data tegra_ehci_uhsic_pdata = {
-       .phy_type = TEGRA_USB_PHY_TYPE_HSIC,
-       .phy_config = &uhsic_phy_config,
-       .operating_mode = TEGRA_USB_HOST,
-       .power_down_on_bus_suspend = 1,
-       .default_enable = true,
+/* Raydium touchscreen                     Driver data */
+static __initdata struct tegra_clk_init_table spi_clk_init_table[] = {
+       /* name         parent          rate            enabled */
+       { "sbc1",       "pll_p",        52000000,       true},
+       { NULL,         NULL,           0,              0},
 };
 
-static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
-       [0] = {
-                       .phy_config = &utmi_phy_config[0],
-                       .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
-                       .default_enable = true,
-       },
-       [1] = {
-                       .phy_config = &utmi_phy_config[1],
-                       .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
-                       .default_enable = true,
-       },
-       [2] = {
-                       .phy_config = &utmi_phy_config[2],
-                       .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
-                       .hotplug = 1,
-                       .default_enable = true,
-       },
+static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
+       /* name         parent          rate            enabled */
+       { "extern3",    "pll_p",        41000000,       true},
+       { "clk_out_3",  "extern3",      40800000,       true},
+       { NULL,         NULL,           0,              0},
 };
 
-static struct tegra_otg_platform_data tegra_otg_pdata = {
-       .ehci_device = &tegra_ehci1_device,
-       .ehci_pdata = &tegra_ehci_pdata[0],
+struct rm_spi_ts_platform_data rm31080ts_cardhu_data = {
+       .gpio_reset = 0,
+       .config = 0,
 };
 
-#ifdef CONFIG_USB_SUPPORT
-static struct usb_phy_plat_data tegra_usb_phy_pdata[] = {
-       [0] = {
-                       .instance = 0,
-                       .vbus_gpio = -1,
-                       .vbus_reg_supply = "vdd_vbus_micro_usb",
-       },
-       [1] = {
-                       .instance = 1,
-                       .vbus_gpio = -1,
-       },
-       [2] = {
-                       .instance = 2,
-                       .vbus_gpio = -1,
-                       .vbus_reg_supply = "vdd_vbus_typea_usb",
-       },
+struct spi_board_info rm31080a_cardhu_spi_board[1] = {
+       {
+        .modalias = "rm_ts_spidev",
+        .bus_num = 0,
+        .chip_select = 0,
+        .max_speed_hz = 13 * 1000 * 1000,
+        .mode = SPI_MODE_0,
+        .platform_data = &rm31080ts_cardhu_data,
+        },
 };
 
-static int cardhu_usb_hsic_postsupend(void)
+static int __init cardhu_touch_init(void)
+{
+       struct board_info BoardInfo, DisplayBoardInfo;
+       int ret;
+
+       tegra_get_board_info(&BoardInfo);
+       tegra_get_display_board_info(&DisplayBoardInfo);
+       if ((DisplayBoardInfo.board_id == BOARD_DISPLAY_PM313)
+                                               || CARDHU_DT_PLATFORM) {
+               tegra_clk_init_from_table(spi_clk_init_table);
+               tegra_clk_init_from_table(touch_clk_init_table);
+               clk_enable(tegra_get_clock_by_name("clk_out_3"));
+               rm31080ts_cardhu_data.platform_id = CARDHU_DT_PLATFORM;
+               rm31080a_cardhu_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
+               touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
+                                       TOUCH_GPIO_RST_RAYDIUM_SPI,
+                                       &rm31080ts_cardhu_data,
+                                       &rm31080a_cardhu_spi_board[0],
+                                       ARRAY_SIZE(rm31080a_cardhu_spi_board));
+       } else {
+               ret = gpio_request(TEGRA_GPIO_PH4, "atmel-irq");
+               if (ret < 0) {
+                       pr_err("%s() Error in gpio_request() for gpio %d\n",
+                                       __func__, ret);
+               }
+               ret = gpio_direction_input(TEGRA_GPIO_PH4);
+               if (ret < 0) {
+                       pr_err("%s() Error in setting gpio %d to in/out\n",
+                                        __func__, ret);
+                       gpio_free(TEGRA_GPIO_PH4);
+               }
+               ret = gpio_request(TEGRA_GPIO_PH6, "atmel-reset");
+               if (ret < 0) {
+                       pr_err("%s() Error in gpio_request() for gpio %d\n",
+                                       __func__, ret);
+               }
+               ret = gpio_direction_output(TEGRA_GPIO_PH6, 0);
+               if (ret < 0) {
+                       pr_err("%s() Error in setting gpio %d to in/out\n",
+                                        __func__, ret);
+                       gpio_free(TEGRA_GPIO_PH6);
+               }
+               msleep(1);
+               gpio_set_value(TEGRA_GPIO_PH6, 1);
+               msleep(100);
+
+               tegra_get_board_info(&BoardInfo);
+               if ((BoardInfo.sku & SKU_TOUCH_MASK) == SKU_TOUCH_2000)
+                       strncpy(atmel_mxt_info.mxt_cfg_name,
+                               "Android_Cardhu_SKU2000_2012-01-31.cfg",
+                               CFG_NAME_SIZE);
+
+               if (DisplayBoardInfo.board_id == BOARD_DISPLAY_E1506) {
+                       strncpy(atmel_mxt_info.mxt_cfg_name,
+                       "Android_Cardhu_Verbier_E1506_2012-06-06.cfg",
+                       CFG_NAME_SIZE);
+                       e1506_atmel_i2c_info[0].irq = gpio_to_irq(TEGRA_GPIO_PH4);
+                       i2c_register_board_info(1, e1506_atmel_i2c_info, 1);
+               } else {
+                       atmel_i2c_info[0].irq = gpio_to_irq(TEGRA_GPIO_PH4);
+                       i2c_register_board_info(1, atmel_i2c_info, 1);
+               }
+       }
+
+       return 0;
+}
+
+#if defined(CONFIG_USB_SUPPORT)
+
+static void cardu_usb_hsic_postsupend(void)
 {
 #ifdef CONFIG_TEGRA_BB_XMM_POWER
        baseband_xmm_set_power_status(BBXMM_PS_L2);
 #endif
-       return 0;
 }
 
-static int cardhu_usb_hsic_preresume(void)
+static void cardu_usb_hsic_preresume(void)
 {
 #ifdef CONFIG_TEGRA_BB_XMM_POWER
        baseband_xmm_set_power_status(BBXMM_PS_L2TOL0);
 #endif
-       return 0;
 }
 
-static int cardhu_usb_hsic_phy_ready(void)
+static void cardu_usb_hsic_phy_ready(void)
 {
 #ifdef CONFIG_TEGRA_BB_XMM_POWER
        baseband_xmm_set_power_status(BBXMM_PS_L0);
 #endif
-       return 0;
 }
 
-static int cardhu_usb_hsic_phy_off(void)
+static void cardu_usb_hsic_phy_off(void)
 {
 #ifdef CONFIG_TEGRA_BB_XMM_POWER
        baseband_xmm_set_power_status(BBXMM_PS_L3);
 #endif
-       return 0;
 }
 
+static struct tegra_usb_phy_platform_ops hsic_xmm_plat_ops = {
+       .post_suspend = cardu_usb_hsic_postsupend,
+       .pre_resume = cardu_usb_hsic_preresume,
+       .port_power = cardu_usb_hsic_phy_ready,
+       .post_phy_off = cardu_usb_hsic_phy_off,
+};
+
+static struct tegra_usb_platform_data tegra_ehci2_hsic_xmm_pdata = {
+       .port_otg = false,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .hot_plug = false,
+               .remote_wakeup_supported = false,
+               .power_off_on_suspend = false,
+       },
+       .ops = &hsic_xmm_plat_ops,
+};
+#endif
+
+static int hsic_enable_gpio = -1;
+static int hsic_reset_gpio = -1;
+
+void hsic_platform_open(void)
+{
+       int reset_gpio = -1, enable_gpio = -1;
+
+       if (hsic_enable_gpio != -1)
+               enable_gpio = gpio_request(hsic_enable_gpio, "uhsic_enable");
+       if (hsic_reset_gpio != -1)
+               reset_gpio = gpio_request(hsic_reset_gpio, "uhsic_reset");
+       /* hsic enable signal deasserted, hsic reset asserted */
+       if (!enable_gpio)
+               gpio_direction_output(hsic_enable_gpio, 0 /* deasserted */);
+       if (!reset_gpio)
+               gpio_direction_output(hsic_reset_gpio, 0 /* asserted */);
+       /* keep hsic reset asserted for 1 ms */
+       udelay(1000);
+       /* enable (power on) hsic */
+       if (!enable_gpio)
+               gpio_set_value_cansleep(hsic_enable_gpio, 1);
+       udelay(1000);
+       /* deassert reset */
+       if (!reset_gpio)
+               gpio_set_value_cansleep(hsic_reset_gpio, 1);
+
+}
+
+void hsic_platform_close(void)
+{
+       if (hsic_enable_gpio != -1) {
+               gpio_set_value(hsic_enable_gpio, 0);
+               gpio_free(hsic_enable_gpio);
+       }
+       if (hsic_reset_gpio != -1) {
+               gpio_set_value(hsic_reset_gpio, 0);
+               gpio_free(hsic_reset_gpio);
+       }
+}
+
+void hsic_power_on(void)
+{
+       if (hsic_enable_gpio != -1) {
+               gpio_set_value_cansleep(hsic_enable_gpio, 1);
+               udelay(1000);
+       }
+}
+
+void hsic_power_off(void)
+{
+       if (hsic_enable_gpio != -1) {
+               gpio_set_value_cansleep(hsic_enable_gpio, 0);
+               udelay(1000);
+       }
+}
+
+#if defined(CONFIG_USB_SUPPORT)
+static struct tegra_usb_phy_platform_ops hsic_plat_ops = {
+       .open = hsic_platform_open,
+       .close = hsic_platform_close,
+       .pre_phy_on = hsic_power_on,
+       .post_phy_off = hsic_power_off,
+};
+
+static struct tegra_usb_platform_data tegra_ehci2_hsic_pdata = {
+       .port_otg = false,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_HSIC,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .hot_plug = false,
+               .remote_wakeup_supported = false,
+               .power_off_on_suspend = false,
+       },
+       .ops = &hsic_plat_ops,
+};
+
+static struct tegra_usb_platform_data tegra_udc_pdata = {
+       .port_otg = true,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode = TEGRA_USB_OPMODE_DEVICE,
+       .u_data.dev = {
+               .vbus_pmu_irq = 0,
+               .vbus_gpio = -1,
+               .charging_supported = false,
+               .remote_wakeup_supported = false,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
+       .port_otg = false,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .hot_plug = false,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 15,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
+       .port_otg = false,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .hot_plug = true,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
+       .port_otg = true,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .hot_plug = true,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 15,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_otg_data tegra_otg_pdata = {
+       .ehci_device = &tegra_ehci1_device,
+       .ehci_pdata = &tegra_ehci1_utmi_pdata,
+};
+#endif
+
+#if defined(CONFIG_USB_SUPPORT)
 static void cardhu_usb_init(void)
 {
        struct board_info bi;
 
        tegra_get_board_info(&bi);
 
-       tegra_usb_phy_init(tegra_usb_phy_pdata,
-                       ARRAY_SIZE(tegra_usb_phy_pdata));
-
+       /* OTG should be the first to be registered */
        tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
        platform_device_register(&tegra_otg_device);
+
+       /* setup the udc platform data */
+       tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+
        if (bi.board_id == BOARD_PM267) {
-               uhsic_phy_config.reset_gpio =
-                       PM267_SMSC4640_HSIC_HUB_RESET_GPIO;
-               tegra_ehci2_device.dev.platform_data = &tegra_ehci_uhsic_pdata;
+               hsic_enable_gpio = EN_HSIC_GPIO;
+               hsic_reset_gpio = PM267_SMSC4640_HSIC_HUB_RESET_GPIO;
+               tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_pdata;
                platform_device_register(&tegra_ehci2_device);
        } else if (bi.board_id == BOARD_E1256) {
-               tegra_ehci2_device.dev.platform_data = &tegra_ehci_uhsic_pdata;
+               hsic_enable_gpio = EN_HSIC_GPIO;
+               tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_pdata;
                platform_device_register(&tegra_ehci2_device);
        } else if (bi.board_id == BOARD_E1186) {
-               /* for baseband devices do not switch off phy during suspend */
-               tegra_ehci_uhsic_pdata.power_down_on_bus_suspend = 0;
-               uhsic_phy_config.postsuspend = cardhu_usb_hsic_postsupend;
-               uhsic_phy_config.preresume = cardhu_usb_hsic_preresume;
-               uhsic_phy_config.usb_phy_ready = cardhu_usb_hsic_phy_ready;
-               uhsic_phy_config.post_phy_off = cardhu_usb_hsic_phy_off;
-               tegra_ehci2_device.dev.platform_data = &tegra_ehci_uhsic_pdata;
-               /* baseband registration happens in baseband-xmm-power  */
+               tegra_ehci2_device.dev.platform_data =
+                                               &tegra_ehci2_hsic_xmm_pdata;
+               /* ehci2 registration happens in baseband-xmm-power  */
        } else {
-               tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1];
+               tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata;
                platform_device_register(&tegra_ehci2_device);
        }
 
-       tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2];
+       tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata;
        platform_device_register(&tegra_ehci3_device);
 
 }
@@ -977,19 +1163,6 @@ static void cardhu_usb_init(void)
 static void cardhu_usb_init(void) { }
 #endif
 
-static void cardhu_gps_init(void)
-{
-       tegra_gpio_enable(TEGRA_GPIO_PU2);
-       tegra_gpio_enable(TEGRA_GPIO_PU3);
-}
-
-static void cardhu_nfc_init(void)
-{
-       tegra_gpio_enable(TEGRA_GPIO_PX0);
-       tegra_gpio_enable(TEGRA_GPIO_PP3);
-       tegra_gpio_enable(TEGRA_GPIO_PO7);
-}
-
 static struct baseband_power_platform_data tegra_baseband_power_data = {
        .baseband_type = BASEBAND_XMM,
        .modem = {
@@ -1041,9 +1214,20 @@ static void cardhu_pci_init(void)
                cardhu_pci_platform_data.port_status[2] = 1;
                cardhu_pci_platform_data.use_dock_detect = 1;
                cardhu_pci_platform_data.gpio = DOCK_DETECT_GPIO;
+       } else if (board_info.board_id == BOARD_PM315) {
+               cardhu_pci_platform_data.port_status[0] = 1;
+               cardhu_pci_platform_data.port_status[1] = 0;
+               cardhu_pci_platform_data.port_status[2] = 1;
+               cardhu_pci_platform_data.use_dock_detect = 0;
+               cardhu_pci_platform_data.gpio = 0;
+       }
+       if ((board_info.board_id == BOARD_E1186) ||
+                       (board_info.board_id == BOARD_E1187) ||
+                       (board_info.board_id == BOARD_E1291) ||
+                       (board_info.board_id == BOARD_PM315)) {
+               tegra_pci_device.dev.platform_data = &cardhu_pci_platform_data;
+               platform_device_register(&tegra_pci_device);
        }
-       tegra_pci_device.dev.platform_data = &cardhu_pci_platform_data;
-       platform_device_register(&tegra_pci_device);
 }
 
 static void cardhu_modem_init(void)
@@ -1063,7 +1247,7 @@ static void cardhu_modem_init(void)
                } else {
                        w_disable_gpio = TEGRA_GPIO_PDD5;
                }
-               tegra_gpio_enable(w_disable_gpio);
+
                ret = gpio_request(w_disable_gpio, "w_disable_gpio");
                if (ret < 0)
                        pr_err("%s: gpio_request failed for gpio %d\n",
@@ -1083,22 +1267,9 @@ static void cardhu_modem_init(void)
                                break;
                        }
                        gpio_direction_output(TEGRA_GPIO_PH7, 1);
-                       tegra_gpio_enable(TEGRA_GPIO_PH7);
                }
                break;
        case BOARD_E1186:
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.bb_rst);
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.bb_on);
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.ipc_bb_wake);
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.ipc_ap_wake);
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.ipc_hsic_active);
-               tegra_gpio_enable(
-                       tegra_baseband_power_data.modem.xmm.ipc_hsic_sus_req);
                platform_device_register(&tegra_baseband_power_device);
                platform_device_register(&tegra_baseband_power2_device);
                break;
@@ -1119,9 +1290,15 @@ static void cardhu_sata_init(void) { }
 
 static void __init tegra_cardhu_init(void)
 {
-       tegra_thermal_init(&thermal_data);
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
        tegra_clk_init_from_table(cardhu_clk_init_table);
+       tegra_enable_pinmux();
+       tegra_smmu_init();
+       tegra_soc_device_init("cardhu");
        cardhu_pinmux_init();
+       cardhu_gpio_init();
        cardhu_i2c_init();
        cardhu_spi_init();
        cardhu_usb_init();
@@ -1130,13 +1307,24 @@ static void __init tegra_cardhu_init(void)
 #endif
        cardhu_uart_init();
        platform_add_devices(cardhu_devices, ARRAY_SIZE(cardhu_devices));
+       switch (board_info.board_id) {
+       case BOARD_PM315:
+               platform_add_devices(beaver_audio_devices,
+                               ARRAY_SIZE(beaver_audio_devices));
+               break;
+       default:
+               platform_add_devices(cardhu_audio_devices,
+                               ARRAY_SIZE(cardhu_audio_devices));
+
+               break;
+       }
        tegra_ram_console_debug_init();
+       tegra_io_dpd_init();
        cardhu_sdhci_init();
        cardhu_regulator_init();
        cardhu_dtv_init();
        cardhu_suspend_init();
        cardhu_touch_init();
-       cardhu_gps_init();
        cardhu_modem_init();
        cardhu_kbc_init();
        cardhu_scroll_init();
@@ -1146,36 +1334,50 @@ static void __init tegra_cardhu_init(void)
        cardhu_sensors_init();
        cardhu_setup_bluesleep();
        cardhu_sata_init();
-       //audio_wired_jack_init();
        cardhu_pins_state_init();
        cardhu_emc_init();
        tegra_release_bootloader_fb();
-       cardhu_nfc_init();
        cardhu_pci_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
 #endif
+       tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
+       tegra_vibrator_init();
+}
+
+static void __init tegra_cardhu_dt_init(void)
+{
+       tegra_cardhu_init();
+
+       of_platform_populate(NULL,
+               of_default_bus_match_table, NULL, NULL);
 }
 
 static void __init tegra_cardhu_reserve(void)
 {
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
        /* support 1920X1200 with 24bpp */
-       tegra_reserve(0, SZ_8M + SZ_1M, SZ_8M + SZ_1M);
+       tegra_reserve(0, SZ_8M + SZ_1M, SZ_16M);
 #else
-       tegra_reserve(SZ_128M, SZ_8M, SZ_8M);
+       tegra_reserve(SZ_128M, SZ_8M, SZ_16M);
 #endif
-       tegra_ram_console_debug_reserve(SZ_1M);
 }
 
+static const char *cardhu_dt_board_compat[] = {
+       "nvidia,cardhu",
+       NULL
+};
+
 MACHINE_START(CARDHU, "cardhu")
        .atag_offset    = 0x100,
+       .soc            = &tegra_soc_desc,
        .map_io         = tegra_map_common_io,
        .reserve        = tegra_cardhu_reserve,
        .init_early     = tegra30_init_early,
        .init_irq       = tegra_init_irq,
        .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
-       .init_machine   = tegra_cardhu_init,
+       .init_machine   = tegra_cardhu_dt_init,
        .restart        = tegra_assert_system_reset,
+       .dt_compat      = cardhu_dt_board_compat,
 MACHINE_END