summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-whistler.c
diff options
context:
space:
mode:
authorJoshua Cha <joshuac@nvidia.com>2011-11-15 20:53:03 +0900
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:50:05 -0800
commitf2c79001445d047f3e08f435dc579ee4dab791ea (patch)
tree9bdb8b50b6ba132bd5992d9fa6c9326a8f9aa229 /arch/arm/mach-tegra/board-whistler.c
parent15b18ddbdd48111a05af1cdcc19789a280e82425 (diff)
arm: tegra: whistler: Enable BT device
Add bluesleep device and clock source of rfkill device to enable bluetooth device. Bug 896901 Bug 901950 Change-Id: I6080fa3b30bab29225777a8fc312d46dd935066d Reviewed-on: http://git-master/r/64409 Tested-by: Joshua Cha <joshuac@nvidia.com> Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rdbd459a7a2accfe48cb39da40f1e7621dd282236
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler.c')
-rw-r--r--arch/arm/mach-tegra/board-whistler.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler.c b/arch/arm/mach-tegra/board-whistler.c
index f0714b72f03c..503800abf48b 100644
--- a/arch/arm/mach-tegra/board-whistler.c
+++ b/arch/arm/mach-tegra/board-whistler.c
@@ -185,6 +185,64 @@ static noinline void __init whistler_bt_rfkill(void)
static inline void whistler_bt_rfkill(void) { }
#endif
+#ifdef CONFIG_BT_BLUESLEEP
+static noinline void __init tegra_setup_bluesleep(void)
+{
+ struct platform_device *pdev = NULL;
+ struct resource *res;
+
+ pdev = platform_device_alloc("bluesleep", 0);
+ if (!pdev) {
+ pr_err("unable to allocate platform device for bluesleep");
+ return;
+ }
+
+ res = kzalloc(sizeof(struct resource) * 3, GFP_KERNEL);
+ if (!res) {
+ pr_err("unable to allocate resource for bluesleep\n");
+ goto err_free_dev;
+ }
+
+ res[0].name = "gpio_host_wake";
+ res[0].start = TEGRA_GPIO_PU6;
+ res[0].end = TEGRA_GPIO_PU6;
+ res[0].flags = IORESOURCE_IO;
+
+ res[1].name = "gpio_ext_wake";
+ res[1].start = TEGRA_GPIO_PU1;
+ res[1].end = TEGRA_GPIO_PU1;
+ res[1].flags = IORESOURCE_IO;
+
+ res[2].name = "host_wake";
+ res[2].start = gpio_to_irq(TEGRA_GPIO_PU6);
+ res[2].end = gpio_to_irq(TEGRA_GPIO_PU6);
+ res[2].flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE;
+
+ if (platform_device_add_resources(pdev, res, 3)) {
+ pr_err("unable to add resources to bluesleep device\n");
+ goto err_free_res;
+ }
+
+ if (platform_device_add(pdev)) {
+ pr_err("unable to add bluesleep device\n");
+ goto err_free_res;
+ }
+
+ tegra_gpio_enable(TEGRA_GPIO_PU6);
+ tegra_gpio_enable(TEGRA_GPIO_PU1);
+
+ return;
+
+err_free_res:
+ kfree(res);
+err_free_dev:
+ platform_device_put(pdev);
+ return;
+}
+#else
+static inline void tegra_setup_bluesleep(void) { }
+#endif
+
static struct tegra_utmip_config utmi_phy_config[] = {
[0] = {
.hssync_start_delay = 9,
@@ -451,6 +509,9 @@ static void __init tegra_whistler_init(void)
whistler_power_off_init();
whistler_emc_init();
whistler_baseband_init();
+#ifdef CONFIG_BT_BLUESLEEP
+ tegra_setup_bluesleep();
+#endif
tegra_release_bootloader_fb();
}