arm: tegra: Enable Host mode on USB3 port
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu.c
index 7bf79fb..235b1cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu.c
  *
- * Copyright (c) 2010, NVIDIA Corporation.
+ * Copyright (c) 2011, NVIDIA Corporation.
  *
  * 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
@@ -31,7 +31,6 @@
 #include <linux/delay.h>
 #include <linux/i2c-tegra.h>
 #include <linux/gpio.h>
-#include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/platform_data/tegra_usb.h>
 #include <mach/clk.h>
@@ -53,6 +52,8 @@
 #include "gpio-names.h"
 #include "fuse.h"
 
+#define ENABLE_USB_HOST 0
+
 static struct plat_serial8250_port debug_uart_platform_data[] = {
        {
                .membase        = IO_ADDRESS(TEGRA_UARTA_BASE),
@@ -62,7 +63,7 @@ static struct plat_serial8250_port debug_uart_platform_data[] = {
                .type           = PORT_TEGRA,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
-               .uartclk        = 13000000,
+               .uartclk        = 216000000,
        }, {
                .flags          = 0,
        }
@@ -144,22 +145,23 @@ static inline void cardhu_bt_rfkill(void) { }
 
 static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = {
        /* name         parent          rate            enabled */
-       { "uarta",      "clk_m",        13000000,       true},
+       { "uarta",      "pll_p",        216000000,      true},
        { "uartb",      "clk_m",        13000000,       true},
        { "uartc",      "clk_m",        13000000,       true},
        { "uartd",      "clk_m",        13000000,       true},
        { "uarte",      "clk_m",        13000000,       true},
-       { "pll_m",      NULL,           600000000,      true},
-       { "blink",      "clk_32k",      32768,          false},
+       { "pll_m",      NULL,           0,              true},
        { "pll_p_out4", "pll_p",        24000000,       true },
        { "pwm",        "clk_32k",      32768,          false},
-       { "blink",      "clk_32k",      32768,          false},
-       { "pll_a",      NULL,           11289600,       true},
+       { "blink",      "clk_32k",      32768,          true},
+       { "pll_a",      NULL,           56448000,       true},
        { "pll_a_out0", NULL,           11289600,       true},
        { "i2s1",       "pll_a_out0",   11289600,       true},
        { "i2s2",       "pll_a_out0",   11289600,       true},
        { "audio",      "pll_a_out0",   11289600,       true},
        { "audio_2x",   "audio",        22579200,       true},
+       { "sdmmc3",     "clk_m",        12000000,       true},
+       { "sdmmc1",     "clk_m",        12000000,       true},
        { NULL,         NULL,           0,              0},
 };
 
@@ -177,32 +179,31 @@ static struct tegra_ehci_platform_data cardhu_ehci2_ulpi_platform_data = {
 static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = {
        .adapter_nr     = 0,
        .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
+       .bus_clk_rate   = { 100000, 0 },
 };
 
 static struct tegra_i2c_platform_data cardhu_i2c2_platform_data = {
        .adapter_nr     = 1,
        .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
+       .bus_clk_rate   = { 100000, 0 },
 };
 
 static struct tegra_i2c_platform_data cardhu_i2c3_platform_data = {
        .adapter_nr     = 2,
        .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
+       .bus_clk_rate   = { 100000, 0 },
 };
 
 static struct tegra_i2c_platform_data cardhu_i2c4_platform_data = {
        .adapter_nr     = 3,
        .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
-       .is_dvc         = true,
+       .bus_clk_rate   = { 100000, 0 },
 };
 
 static struct tegra_i2c_platform_data cardhu_i2c5_platform_data = {
        .adapter_nr     = 4,
        .bus_count      = 1,
-       .bus_clk_rate   = { 400000, 0 },
+       .bus_clk_rate   = { 100000, 0 },
 };
 
 
@@ -221,40 +222,6 @@ static void cardhu_i2c_init(void)
        platform_device_register(&tegra_i2c_device1);
 }
 
-#define GPIO_KEY(_id, _gpio, _iswake)          \
-       {                                       \
-               .code = _id,                    \
-               .gpio = TEGRA_GPIO_##_gpio,     \
-               .active_low = 1,                \
-               .desc = #_id,                   \
-               .type = EV_KEY,                 \
-               .wakeup = _iswake,              \
-               .debounce_interval = 10,        \
-       }
-
-/* !!!TODO!!! Change for cardhu */
-static struct gpio_keys_button cardhu_keys[] = {
-       [0] = GPIO_KEY(KEY_MENU, PQ0, 0),
-       [1] = GPIO_KEY(KEY_HOME, PQ1, 0),
-       [2] = GPIO_KEY(KEY_BACK, PQ2, 0),
-       [3] = GPIO_KEY(KEY_VOLUMEUP, PQ3, 0),
-       [4] = GPIO_KEY(KEY_VOLUMEDOWN, PQ4, 0),
-       [5] = GPIO_KEY(KEY_POWER, PV2, 1),
-};
-
-static struct gpio_keys_platform_data cardhu_keys_platform_data = {
-       .buttons        = cardhu_keys,
-       .nbuttons       = ARRAY_SIZE(cardhu_keys),
-};
-
-static struct platform_device cardhu_keys_device = {
-       .name   = "gpio-keys",
-       .id     = 0,
-       .dev    = {
-               .platform_data  = &cardhu_keys_platform_data,
-       },
-};
-
 static struct resource tegra_rtc_resources[] = {
        [0] = {
                .start = TEGRA_RTC_BASE,
@@ -285,11 +252,12 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &pmu_device,
        &tegra_rtc_device,
        &tegra_udc_device,
+#if ENABLE_USB_HOST
        &tegra_ehci2_device,
+#endif
 #if defined(CONFIG_TEGRA_IOVMM_SMMU)
        &tegra_smmu_device,
 #endif
-       &cardhu_keys_device,
        &tegra_wdt_device,
        &tegra_avp_device,
 };
@@ -371,6 +339,16 @@ void tegra_usb_otg_host_unregister(struct platform_device *pdev)
        platform_device_unregister(pdev);
 }
 
+
+#ifdef CONFIG_SATA_AHCI_TEGRA
+static void cardhu_sata_init(void)
+{
+       platform_device_register(&tegra_sata_device);
+}
+#else
+static void cardhu_sata_init(void) { }
+#endif
+
 static void __init tegra_cardhu_init(void)
 {
        tegra_common_init();
@@ -384,16 +362,32 @@ static void __init tegra_cardhu_init(void)
        cardhu_sdhci_init();
        cardhu_i2c_init();
        cardhu_regulator_init();
+       cardhu_gpio_switch_regulator_init();
+       cardhu_suspend_init();
        cardhu_touch_init();
        cardhu_usb_init();
+
+#ifdef CONFIG_KEYBOARD_TEGRA
+       cardhu_kbc_init();
+#endif
+
+#ifdef CONFIG_INPUT_ALPS_GPIO_SCROLLWHEEL
+       cardhu_scroll_init();
+#endif
+
+#ifdef CONFIG_KEYBOARD_GPIO
+       cardhu_keys_init();
+#endif
+
        cardhu_panel_init();
        cardhu_sensors_init();
        cardhu_bt_rfkill();
+       cardhu_sata_init();
 }
 
 static void __init tegra_cardhu_reserve(void)
 {
-       tegra_reserve(SZ_128M, SZ_8M, SZ_16M);
+       tegra_reserve(SZ_128M, SZ_4M, SZ_8M);
 }
 
 MACHINE_START(CARDHU, "cardhu")