ARM: tegra: vcm30t124: Added support Bluetooth.
Phoenix Jung [Tue, 8 Apr 2014 11:17:36 +0000 (20:17 +0900)]
Added support Bluetooth with bcm4330 and registered
bluedroid_pm for power management.

Bug 1440706
Bug 1481623

Change-Id: Ia02e4c00f2ec041caf79db8143aa6d8df9e788fd
Signed-off-by: Phoenix Jung <pjung@nvidia.com>
Reviewed-on: http://git-master/r/393423
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Tested-by: Sandeep Trasi <strasi@nvidia.com>

arch/arm/mach-tegra/board-vcm30_t124-power.c
arch/arm/mach-tegra/board-vcm30_t124.c

index df96af2..590d144 100644 (file)
@@ -397,12 +397,14 @@ int __init vcm30_t124_soctherm_init(void)
  * WiFi stack.
  */
 static struct gpio vcm30_t124_system_0_gpios[] = {
-       {MISCIO_WF_EN_GPIO,     GPIOF_OUT_INIT_LOW,     "wifi_en"},
-       {MISCIO_WF_RST_GPIO,    GPIOF_OUT_INIT_LOW,     "wifi_rst"},
-       {MISCIO_BT_WAKEUP_GPIO, GPIOF_OUT_INIT_HIGH,    "bt_wk"},
-       {MISCIO_ABB_RST_GPIO,   GPIOF_OUT_INIT_HIGH,    "ebb_rst"},
-       {MISCIO_USER_LED2_GPIO, GPIOF_OUT_INIT_LOW,     "usr_led2"},
-       {MISCIO_USER_LED1_GPIO, GPIOF_OUT_INIT_LOW,     "usr_led1"},
+       {MISCIO_BT_RST_GPIO,    GPIOF_OUT_INIT_HIGH, "bt_rst"},
+       {MISCIO_WF_EN_GPIO,     GPIOF_OUT_INIT_LOW,  "wifi_en"},
+       {MISCIO_WF_RST_GPIO,    GPIOF_OUT_INIT_LOW,  "wifi_rst"},
+       {MISCIO_BT_EN_GPIO,     GPIOF_OUT_INIT_HIGH, "bt_en"},
+       {MISCIO_BT_WAKEUP_GPIO, GPIOF_OUT_INIT_HIGH, "bt_wk"},
+       {MISCIO_ABB_RST_GPIO,   GPIOF_OUT_INIT_HIGH, "ebb_rst"},
+       {MISCIO_USER_LED2_GPIO, GPIOF_OUT_INIT_LOW,  "usr_led2"},
+       {MISCIO_USER_LED1_GPIO, GPIOF_OUT_INIT_LOW,  "usr_led1"},
 };
 
 /*
index cfea61c..add48d9 100644 (file)
 
 static struct board_info board_info, display_board_info;
 
+#if defined(CONFIG_ANDROID) && defined(CONFIG_BLUEDROID_PM)
+static struct resource vcm30_t124_bluedroid_pm_resources[] = {
+       [0] = {
+               .name   = "reset_gpio",
+               .start  = MISCIO_BT_RST_GPIO,
+               .end    = MISCIO_BT_RST_GPIO,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .name   = "shutdown_gpio",
+               .start  = MISCIO_BT_EN_GPIO,
+               .end    = MISCIO_BT_EN_GPIO,
+               .flags  = IORESOURCE_IO,
+       },
+};
+
+static struct platform_device vcm30_t124_bluedroid_pm_device = {
+       .name = "bluedroid_pm",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(vcm30_t124_bluedroid_pm_resources),
+       .resource       = vcm30_t124_bluedroid_pm_resources,
+};
+
+static noinline void __init vcm30_t124_setup_bluedroid_pm(void)
+{
+       platform_device_register(&vcm30_t124_bluedroid_pm_device);
+}
+#endif
+
 /*
  * Set clock values as per automotive POR
  */
@@ -243,7 +272,9 @@ static struct tegra_clk_init_table vcm30t124_fixed_target_clk_table[] = {
        SET_FIXED_TARGET_RATE("uarta",          408000000),
        SET_FIXED_TARGET_RATE("uartb",          408000000),
        SET_FIXED_TARGET_RATE("uartc",          408000000),
+#ifndef CONFIG_ANDROID
        SET_FIXED_TARGET_RATE("uartd",          408000000),
+#endif
 };
 
 static struct tegra_clk_init_table vcm30t124_a0x_i2s_clk_table[] = {
@@ -751,6 +782,9 @@ static void __init tegra_vcm30_t124_late_init(void)
        register_therm_monitor(&vcm30t30_therm_monitor_data);
 #endif
 
+#if defined(CONFIG_ANDROID) && defined(CONFIG_BLUEDROID_PM)
+       vcm30_t124_setup_bluedroid_pm();
+#endif
 }
 
 static void __init tegra_vcm30_t124_dt_init(void)