ARM: tegra: integration of slave mode support.
[linux-2.6.git] / arch / arm / mach-tegra / board-ventana.c
index 1ed2a56..4e01850 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * arch/arm/mach-tegra/board-ventana.c
  *
- * Copyright (c) 2010, NVIDIA Corporation.
+ * Copyright (c) 2010-2011 NVIDIA Corporation.
+ * Copyright (c) 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/mfd/tps6586x.h>
 #include <linux/memblock.h>
 #include <linux/i2c/atmel_mxt_ts.h>
+#include <linux/tegra_uart.h>
+#include <linux/rfkill-gpio.h>
+
+#include <sound/wm8903.h>
 
 #include <mach/clk.h>
 #include <mach/iomap.h>
@@ -44,6 +49,8 @@
 #include <mach/pinmux.h>
 #include <mach/iomap.h>
 #include <mach/io.h>
+#include <mach/i2s.h>
+#include <mach/tegra_asoc_pdata.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include "board-ventana.h"
 #include "devices.h"
 #include "gpio-names.h"
+#include "fuse.h"
 #include "wakeups-t2.h"
+#include "pm.h"
+
 
-static struct plat_serial8250_port debug_uart_platform_data[] = {
+static struct rfkill_gpio_platform_data ventana_bt_rfkill_pdata[] = {
        {
-               .membase        = IO_ADDRESS(TEGRA_UARTD_BASE),
-               .mapbase        = TEGRA_UARTD_BASE,
-               .irq            = INT_UARTD,
-               .flags          = UPF_BOOT_AUTOCONF,
-               .iotype         = UPIO_MEM,
-               .regshift       = 2,
-               .uartclk        = 216000000,
-       }, {
-               .flags          = 0,
-       }
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PU0,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
+       },
 };
 
-static struct platform_device debug_uart = {
-       .name = "serial8250",
-       .id = PLAT8250_DEV_PLATFORM,
+static struct platform_device ventana_bt_rfkill_device = {
+       .name = "rfkill_gpio",
+       .id             = -1,
        .dev = {
-               .platform_data = debug_uart_platform_data,
+               .platform_data  = ventana_bt_rfkill_pdata,
        },
 };
 
-static struct tegra_utmip_config utmi_phy_config[] = {
+static void __init ventana_bt_rfkill(void)
+{
+       /*Add Clock Resource*/
+       clk_add_alias("bcm4329_32k_clk", ventana_bt_rfkill_device.name, \
+                               "blink", NULL);
+       return;
+}
+
+static struct resource ventana_bluesleep_resources[] = {
        [0] = {
-                       .hssync_start_delay = 9,
-                       .idle_wait_delay = 17,
-                       .elastic_limit = 16,
-                       .term_range_adj = 6,
-                       .xcvr_setup = 15,
-                       .xcvr_lsfslew = 2,
-                       .xcvr_lsrslew = 2,
+               .name = "gpio_host_wake",
+                       .start  = TEGRA_GPIO_PU6,
+                       .end    = TEGRA_GPIO_PU6,
+                       .flags  = IORESOURCE_IO,
        },
        [1] = {
-                       .hssync_start_delay = 9,
-                       .idle_wait_delay = 17,
-                       .elastic_limit = 16,
-                       .term_range_adj = 6,
-                       .xcvr_setup = 8,
-                       .xcvr_lsfslew = 2,
-                       .xcvr_lsrslew = 2,
+               .name = "gpio_ext_wake",
+                       .start  = TEGRA_GPIO_PU1,
+                       .end    = TEGRA_GPIO_PU1,
+                       .flags  = IORESOURCE_IO,
        },
-};
-
-static struct tegra_ulpi_config ulpi_phy_config = {
-       .reset_gpio = TEGRA_GPIO_PG2,
-       .clk = "cdev2",
-};
-
-#ifdef CONFIG_BCM4329_RFKILL
-
-static struct resource ventana_bcm4329_rfkill_resources[] = {
-       {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PU0,
-               .end    = TEGRA_GPIO_PU0,
-               .flags  = IORESOURCE_IO,
+       [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,
        },
 };
 
-static struct platform_device ventana_bcm4329_rfkill_device = {
-       .name = "bcm4329_rfkill",
+static struct platform_device ventana_bluesleep_device = {
+       .name           = "bluesleep",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(ventana_bcm4329_rfkill_resources),
-       .resource       = ventana_bcm4329_rfkill_resources,
+       .num_resources  = ARRAY_SIZE(ventana_bluesleep_resources),
+       .resource       = ventana_bluesleep_resources,
 };
 
-static noinline void __init ventana_bt_rfkill(void)
+static void __init ventana_setup_bluesleep(void)
 {
-       /*Add Clock Resource*/
-       clk_add_alias("bcm4329_32k_clk", ventana_bcm4329_rfkill_device.name, \
-                               "blink", NULL);
-
-       platform_device_register(&ventana_bcm4329_rfkill_device);
-
+       platform_device_register(&ventana_bluesleep_device);
        return;
 }
-#else
-static inline void ventana_bt_rfkill(void) { }
-#endif
 
 static __initdata struct tegra_clk_init_table ventana_clk_init_table[] = {
        /* name         parent          rate            enabled */
-       { "uartd",      "pll_p",        216000000,      true},
-       { "uartc",      "pll_m",        600000000,      false},
        { "blink",      "clk_32k",      32768,          false},
        { "pll_p_out4", "pll_p",        24000000,       true },
        { "pwm",        "clk_32k",      32768,          false},
-       { "kbc",        "clk_32k",      32768,          true},
+       { "i2s1",       "pll_a_out0",   0,              false},
+       { "i2s2",       "pll_a_out0",   0,              false},
+       { "spdif_out",  "pll_a_out0",   0,              false},
        { NULL,         NULL,           0,              0},
 };
 
-static struct tegra_ulpi_config ventana_ehci2_ulpi_phy_config = {
-       .reset_gpio = TEGRA_GPIO_PV1,
-       .clk = "cdev2",
-};
-
-static struct tegra_ehci_platform_data ventana_ehci2_ulpi_platform_data = {
-       .operating_mode = TEGRA_USB_HOST,
-       .power_down_on_bus_suspend = 1,
-       .phy_config = &ventana_ehci2_ulpi_phy_config,
-       .phy_type = TEGRA_USB_PHY_TYPE_LINK_ULPI,
-};
-
 static struct tegra_i2c_platform_data ventana_i2c1_platform_data = {
        .adapter_nr     = 0,
        .bus_count      = 1,
        .bus_clk_rate   = { 400000, 0 },
        .slave_addr = 0x00FC,
+       .scl_gpio               = {TEGRA_GPIO_PC4, 0},
+       .sda_gpio               = {TEGRA_GPIO_PC5, 0},
+       .arb_recovery = arb_lost_recovery,
 };
 
 static const struct tegra_pingroup_config i2c2_ddc = {
@@ -179,10 +159,13 @@ static const struct tegra_pingroup_config i2c2_gen2 = {
 static struct tegra_i2c_platform_data ventana_i2c2_platform_data = {
        .adapter_nr     = 1,
        .bus_count      = 2,
-       .bus_clk_rate   = { 100000, 10000 },
+       .bus_clk_rate   = { 10000, 10000 },
        .bus_mux        = { &i2c2_ddc, &i2c2_gen2 },
        .bus_mux_len    = { 1, 1 },
        .slave_addr = 0x00FC,
+       .scl_gpio               = {0, TEGRA_GPIO_PT5},
+       .sda_gpio               = {0, TEGRA_GPIO_PT6},
+       .arb_recovery = arb_lost_recovery,
 };
 
 static struct tegra_i2c_platform_data ventana_i2c3_platform_data = {
@@ -190,6 +173,9 @@ static struct tegra_i2c_platform_data ventana_i2c3_platform_data = {
        .bus_count      = 1,
        .bus_clk_rate   = { 400000, 0 },
        .slave_addr = 0x00FC,
+       .scl_gpio               = {TEGRA_GPIO_PBB2, 0},
+       .sda_gpio               = {TEGRA_GPIO_PBB3, 0},
+       .arb_recovery = arb_lost_recovery,
 };
 
 static struct tegra_i2c_platform_data ventana_dvc_platform_data = {
@@ -197,6 +183,30 @@ static struct tegra_i2c_platform_data ventana_dvc_platform_data = {
        .bus_count      = 1,
        .bus_clk_rate   = { 400000, 0 },
        .is_dvc         = true,
+       .scl_gpio               = {TEGRA_GPIO_PZ6, 0},
+       .sda_gpio               = {TEGRA_GPIO_PZ7, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+static struct wm8903_platform_data ventana_wm8903_pdata = {
+       .irq_active_low = 0,
+       .micdet_cfg = 0,
+       .micdet_delay = 100,
+       .gpio_base = WM8903_GPIO_BASE,
+       .gpio_cfg = {
+               (WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT << WM8903_GP1_FN_SHIFT),
+               (WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT << WM8903_GP2_FN_SHIFT) |
+                       WM8903_GP2_DIR,
+               0,
+               WM8903_GPIO_NO_CONFIG,
+               WM8903_GPIO_NO_CONFIG,
+       },
+};
+
+static struct i2c_board_info __initdata wm8903_board_info = {
+       I2C_BOARD_INFO("wm8903", 0x1a),
+       .platform_data = &ventana_wm8903_pdata,
+       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
 };
 
 static void ventana_i2c_init(void)
@@ -210,8 +220,83 @@ static void ventana_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device3);
        platform_device_register(&tegra_i2c_device4);
+
+       i2c_register_board_info(0, &wm8903_board_info, 1);
 }
+static struct platform_device *ventana_uart_devices[] __initdata = {
+       &tegra_uartb_device,
+       &tegra_uartc_device,
+       &tegra_uartd_device,
+};
 
+static struct uart_clk_parent uart_parent_clk[] = {
+       [0] = {.name = "pll_p"},
+       [1] = {.name = "pll_m"},
+       [2] = {.name = "clk_m"},
+};
+
+static struct tegra_uart_platform_data ventana_uart_pdata;
+
+static void __init uart_debug_init(void)
+{
+       unsigned long rate;
+       struct clk *c;
+
+       /* UARTD is the debug port. */
+       pr_info("Selecting UARTD as the debug console\n");
+       ventana_uart_devices[2] = &debug_uartd_device;
+       debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartd_device.dev.platform_data))->mapbase;
+       debug_uart_clk = clk_get_sys("serial8250.0", "uartd");
+
+       /* Clock enable for the debug channel */
+       if (!IS_ERR_OR_NULL(debug_uart_clk)) {
+               rate = ((struct plat_serial8250_port *)(
+                       debug_uartd_device.dev.platform_data))->uartclk;
+               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, rate);
+       } else {
+               pr_err("Not getting the clock %s for debug console\n",
+                                       debug_uart_clk->name);
+       }
+}
+
+static void __init ventana_uart_init(void)
+{
+       int i;
+       struct clk *c;
+
+       for (i = 0; i < ARRAY_SIZE(uart_parent_clk); ++i) {
+               c = tegra_get_clock_by_name(uart_parent_clk[i].name);
+               if (IS_ERR_OR_NULL(c)) {
+                       pr_err("Not able to get the clock for %s\n",
+                                               uart_parent_clk[i].name);
+                       continue;
+               }
+               uart_parent_clk[i].parent_clk = c;
+               uart_parent_clk[i].fixed_clk_rate = clk_get_rate(c);
+       }
+       ventana_uart_pdata.parent_clk_list = uart_parent_clk;
+       ventana_uart_pdata.parent_clk_count = ARRAY_SIZE(uart_parent_clk);
+       tegra_uartb_device.dev.platform_data = &ventana_uart_pdata;
+       tegra_uartc_device.dev.platform_data = &ventana_uart_pdata;
+       tegra_uartd_device.dev.platform_data = &ventana_uart_pdata;
+
+       /* Register low speed only if it is selected */
+       if (!is_tegra_debug_uartport_hs())
+               uart_debug_init();
+
+       platform_add_devices(ventana_uart_devices,
+                               ARRAY_SIZE(ventana_uart_devices));
+}
 
 #ifdef CONFIG_KEYBOARD_GPIO
 #define GPIO_KEY(_id, _gpio, _iswake)          \
@@ -242,7 +327,8 @@ static int ventana_wakeup_key(void)
        unsigned long status =
                readl(IO_ADDRESS(TEGRA_PMC_BASE) + PMC_WAKE_STATUS);
 
-       return status & TEGRA_WAKE_GPIO_PV2 ? KEY_POWER : KEY_RESERVED;
+       return (status & (1 << TEGRA_WAKE_GPIO_PV2)) ?
+               KEY_POWER : KEY_RESERVED;
 }
 
 static struct gpio_keys_platform_data ventana_keys_platform_data = {
@@ -258,14 +344,6 @@ static struct platform_device ventana_keys_device = {
                .platform_data  = &ventana_keys_platform_data,
        },
 };
-
-static void ventana_keys_init(void)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(ventana_keys); i++)
-               tegra_gpio_enable(ventana_keys[i].gpio);
-}
 #endif
 
 static struct platform_device tegra_camera = {
@@ -273,12 +351,37 @@ static struct platform_device tegra_camera = {
        .id = -1,
 };
 
+static struct tegra_asoc_platform_data ventana_audio_pdata = {
+       .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
+       .gpio_hp_det            = TEGRA_GPIO_HP_DET,
+       .gpio_hp_mute           = -1,
+       .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
+       .gpio_ext_mic_en        = 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 ventana_audio_device = {
+       .name   = "tegra-snd-wm8903",
+       .id     = 0,
+       .dev    = {
+               .platform_data  = &ventana_audio_pdata,
+       },
+};
+
 static struct platform_device *ventana_devices[] __initdata = {
-       &tegra_uartb_device,
-       &tegra_uartc_device,
        &tegra_pmu_device,
-       &tegra_udc_device,
-       &tegra_ehci2_device,
        &tegra_gart_device,
        &tegra_aes_device,
 #ifdef CONFIG_KEYBOARD_GPIO
@@ -287,6 +390,15 @@ static struct platform_device *ventana_devices[] __initdata = {
        &tegra_wdt_device,
        &tegra_avp_device,
        &tegra_camera,
+       &tegra_i2s_device1,
+       &tegra_i2s_device2,
+       &tegra_spdif_device,
+       &tegra_das_device,
+       &spdif_dit_device,
+       &bluetooth_dit_device,
+       &ventana_bt_rfkill_device,
+       &tegra_pcm_device,
+       &ventana_audio_device,
 };
 
 
@@ -329,91 +441,27 @@ static int __init ventana_touch_init_atmel(void)
        return 0;
 }
 
-static struct usb_phy_plat_data tegra_usb_phy_pdata[] = {
-       [0] = {
-                       .instance = 0,
-                       .vbus_irq = TPS6586X_INT_BASE + TPS6586X_INT_USB_DET,
-                       .vbus_gpio = TEGRA_GPIO_PD0,
-       },
-       [1] = {
-                       .instance = 1,
-                       .vbus_gpio = -1,
-       },
-       [2] = {
-                       .instance = 2,
-                       .vbus_gpio = TEGRA_GPIO_PD3,
-       },
+static struct panjit_i2c_ts_platform_data panjit_data = {
+       .gpio_reset = TEGRA_GPIO_PQ7,
 };
 
-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,
-       },
-       [1] = {
-                       .phy_config = &ulpi_phy_config,
-                       .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
-       },
-       [2] = {
-                       .phy_config = &utmi_phy_config[1],
-                       .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
+static struct i2c_board_info __initdata ventana_i2c_bus1_touch_info[] = {
+       {
+               I2C_BOARD_INFO("panjit_touch", 0x3),
+               .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV6),
+               .platform_data = &panjit_data,
        },
 };
 
-static struct platform_device *tegra_usb_otg_host_register(void)
+static int __init ventana_touch_init_panjit(void)
 {
-       struct platform_device *pdev;
-       void *platform_data;
-       int val;
-
-       pdev = platform_device_alloc(tegra_ehci1_device.name, tegra_ehci1_device.id);
-       if (!pdev)
-               return NULL;
-
-       val = platform_device_add_resources(pdev, tegra_ehci1_device.resource,
-               tegra_ehci1_device.num_resources);
-       if (val)
-               goto error;
-
-       pdev->dev.dma_mask =  tegra_ehci1_device.dev.dma_mask;
-       pdev->dev.coherent_dma_mask = tegra_ehci1_device.dev.coherent_dma_mask;
-
-       platform_data = kmalloc(sizeof(struct tegra_ehci_platform_data), GFP_KERNEL);
-       if (!platform_data)
-               goto error;
-
-       memcpy(platform_data, &tegra_ehci_pdata[0],
-                               sizeof(struct tegra_ehci_platform_data));
-       pdev->dev.platform_data = platform_data;
-
-       val = platform_device_add(pdev);
-       if (val)
-               goto error_add;
-
-       return pdev;
-
-error_add:
-       kfree(platform_data);
-error:
-       pr_err("%s: failed to add the host contoller device\n", __func__);
-       platform_device_put(pdev);
-       return NULL;
-}
+       tegra_gpio_enable(TEGRA_GPIO_PV6);
 
-static void tegra_usb_otg_host_unregister(struct platform_device *pdev)
-{
-       kfree(pdev->dev.platform_data);
-       pdev->dev.platform_data = NULL;
-       platform_device_unregister(pdev);
-}
+       tegra_gpio_enable(TEGRA_GPIO_PQ7);
+       i2c_register_board_info(0, ventana_i2c_bus1_touch_info, 1);
 
-static struct tegra_otg_platform_data tegra_otg_pdata = {
-       .host_register = &tegra_usb_otg_host_register,
-       .host_unregister = &tegra_usb_otg_host_unregister,
-};
+       return 0;
+}
 
 static int __init ventana_gps_init(void)
 {
@@ -427,30 +475,134 @@ static int __init ventana_gps_init(void)
        return 0;
 }
 
-static void ventana_power_off(void)
+static struct tegra_usb_platform_data tegra_udc_pdata = {
+       .port_otg = true,
+       .has_hostpc = false,
+       .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_ehci1_utmi_pdata = {
+       .port_otg = true,
+       .has_hostpc = false,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = TEGRA_GPIO_PD0,
+               .vbus_reg = NULL,
+               .hot_plug = true,
+               .remote_wakeup_supported = false,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 9,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+       },
+};
+
+static void ulpi_link_platform_open(void)
 {
-       int ret;
+       int reset_gpio = TEGRA_GPIO_PV1;
 
-       ret = tps6586x_power_off();
-       if (ret)
-               pr_err("ventana: failed to power off\n");
+       gpio_request(reset_gpio, "ulpi_phy_reset");
+       gpio_direction_output(reset_gpio, 0);
+       tegra_gpio_enable(reset_gpio);
 
-       while(1);
+       gpio_direction_output(reset_gpio, 0);
+       msleep(5);
+       gpio_direction_output(reset_gpio, 1);
 }
 
-static void __init ventana_power_off_init(void)
-{
-       pm_power_off = ventana_power_off;
-}
+static struct tegra_usb_phy_platform_ops ulpi_link_plat_ops = {
+       .open = ulpi_link_platform_open,
+};
+
+static struct tegra_usb_platform_data tegra_ehci2_ulpi_link_pdata = {
+       .port_otg = false,
+       .has_hostpc = false,
+       .phy_intf = TEGRA_USB_PHY_INTF_ULPI_LINK,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .vbus_reg = NULL,
+               .hot_plug = false,
+               .remote_wakeup_supported = false,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.ulpi = {
+               .shadow_clk_delay = 10,
+               .clock_out_delay = 1,
+               .data_trimmer = 4,
+               .stpdirnxt_trimmer = 4,
+               .dir_trimmer = 4,
+               .clk = "cdev2",
+       },
+       .ops = &ulpi_link_plat_ops,
+};
+
+static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
+       .port_otg = false,
+       .has_hostpc = false,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = TEGRA_GPIO_PD3,
+               .vbus_reg = NULL,
+               .hot_plug = true,
+               .remote_wakeup_supported = false,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 9,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+       },
+};
+
+static struct tegra_usb_otg_data tegra_otg_pdata = {
+       .ehci_device = &tegra_ehci1_device,
+       .ehci_pdata = &tegra_ehci1_utmi_pdata,
+};
 
 static void ventana_usb_init(void)
 {
-       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);
 
-       tegra_ehci3_device.dev.platform_data=&tegra_ehci_pdata[2];
+       tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+       platform_device_register(&tegra_udc_device);
+
+       tegra_ehci2_device.dev.platform_data = &tegra_ehci2_ulpi_link_pdata;
+       platform_device_register(&tegra_ehci2_device);
+
+       tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata;
        platform_device_register(&tegra_ehci3_device);
 }
 
@@ -461,16 +613,13 @@ static void __init tegra_ventana_init(void)
        tegra_clk_init_from_table(ventana_clk_init_table);
        ventana_pinmux_init();
        ventana_i2c_init();
-       if (is_tegra_debug_uartport_hs() == true)
-               platform_device_register(&tegra_uartd_device);
-       else
-               platform_device_register(&debug_uart);
-       tegra_ehci2_device.dev.platform_data
-               = &ventana_ehci2_ulpi_platform_data;
+       ventana_uart_init();
        platform_add_devices(ventana_devices, ARRAY_SIZE(ventana_devices));
+       tegra_ram_console_debug_init();
        ventana_sdhci_init();
        ventana_charge_init();
        ventana_regulator_init();
+       ventana_charger_init();
 
        tegra_get_board_info(&BoardInfo);
 
@@ -480,26 +629,25 @@ static void __init tegra_ventana_init(void)
                ventana_touch_init_atmel();
        } else {
                pr_info("Initializing Panjit touch driver\n");
+               ventana_touch_init_panjit();
        }
 
-#ifdef CONFIG_KEYBOARD_GPIO
-       ventana_keys_init();
-#endif
-#ifdef CONFIG_KEYBOARD_TEGRA
-       ventana_kbc_init();
-#endif
-
        ventana_usb_init();
        ventana_gps_init();
        ventana_panel_init();
        ventana_sensors_init();
        ventana_bt_rfkill();
-       ventana_power_off_init();
        ventana_emc_init();
+
+       ventana_setup_bluesleep();
+       tegra_release_bootloader_fb();
 }
 
 int __init tegra_ventana_protected_aperture_init(void)
 {
+       if (!machine_is_ventana())
+               return 0;
+
        tegra_protected_aperture_init(tegra_grhost_aperture);
        return 0;
 }
@@ -510,7 +658,8 @@ void __init tegra_ventana_reserve(void)
        if (memblock_reserve(0x0, 4096) < 0)
                pr_warn("Cannot reserve first 4K of memory for safety\n");
 
-       tegra_reserve(SZ_256M, SZ_8M, SZ_16M);
+       tegra_reserve(SZ_256M, SZ_8M + SZ_1M, SZ_16M);
+       tegra_ram_console_debug_reserve(SZ_1M);
 }
 
 MACHINE_START(VENTANA, "ventana")