diff options
author | Anantha Idapalapati <aidapalapati@nvidia.com> | 2010-08-10 15:17:44 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:52:12 -0800 |
commit | b444af0306164e7d037f70817da45027b568a1f2 (patch) | |
tree | 9564a46797500314c5137c4102753bd1f58cb76d /arch/arm/mach-tegra/board-ventana.c | |
parent | 46834140dca922ed6acfccf9d961e4bb67289d34 (diff) |
tegra bluesleep: creating a bluesleep platform device.
Based on CONFIG_BT_BLUESLEEP configuration variable, a bluesleep device
will be created and used to actively manage the BT device power.
Bug 791669, 773186
(cherry picked from commit 011a705248274804c80c12af5366693e6662829b)
Reviewed-on: http://git-master/r/6851
Original-Change-Id: If5275ecfc920a038ec96928ea7f7f739f5051e33
(cherry picked from commit ae1bf987d38b15d6688cd2152ee4b4624211c113)
Reviewed-on: http://git-master/r/19868
Reviewed-by: Anantha Idapalapati <aidapalapati@nvidia.com>
Tested-by: Anantha Idapalapati <aidapalapati@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R5e8a80983a7d22f608176224ca4d8295b96fa931
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c index 89a27cb229e9..c9bcae3faf62 100644 --- a/arch/arm/mach-tegra/board-ventana.c +++ b/arch/arm/mach-tegra/board-ventana.c @@ -126,6 +126,60 @@ static noinline void __init ventana_bt_rfkill(void) static inline void ventana_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; + + 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; + } + return; + +err_free_res: + kfree(res); +err_free_dev: + platform_device_put(pdev); + return; +} +#else +static inline void tegra_setup_bluesleep(void) { } +#endif + static __initdata struct tegra_clk_init_table ventana_clk_init_table[] = { /* name parent rate enabled */ { "blink", "clk_32k", 32768, false}, @@ -619,6 +673,9 @@ static void __init tegra_ventana_init(void) ventana_power_off_init(); ventana_emc_init(); +#ifdef CONFIG_BT_BLUESLEEP + tegra_setup_bluesleep(); +#endif tegra_release_bootloader_fb(); } |