diff options
author | rgoyal <rgoyal@nvidia.com> | 2010-10-26 10:43:01 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2010-10-28 19:41:25 -0700 |
commit | 7d5f8c651c06af7889a5d48c5886eb91e78ccb6d (patch) | |
tree | 099a3a0a948497af7ab0fab157c9308dc79ab957 /arch | |
parent | 4b1ae9254924cded7285f5166a8cf982cd7d6473 (diff) |
csr lowpower mode:adding bluesleep support for csr
Adding bluesleep support for CSR chip
BUG 691608
Change-Id: I5cb9420201e99b36a9ee26a411c0312b3c6e3fa1
Reviewed-on: http://git-master/r/9678
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-generic.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-tegra/odm_kit/query/harmony/nvodm_query.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c | 2 |
3 files changed, 52 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-generic.c b/arch/arm/mach-tegra/board-generic.c index f1f26ce2777f..d2de4a4ac4b1 100644 --- a/arch/arm/mach-tegra/board-generic.c +++ b/arch/arm/mach-tegra/board-generic.c @@ -326,7 +326,7 @@ static noinline void __init tegra_setup_bluesleep(void) 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; + 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"); @@ -348,7 +348,54 @@ err_free_dev: #else static inline void tegra_setup_bluesleep(void) { } #endif +#ifdef CONFIG_BT_BLUESLEEP +static noinline void __init tegra_setup_bluesleep_csr(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) * 2, 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 = "host_wake"; + res[1].start = gpio_to_irq(TEGRA_GPIO_PU6); + res[1].end = gpio_to_irq(TEGRA_GPIO_PU6); + res[1].flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE; + + if (platform_device_add_resources(pdev, res, 2)) { + 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_csr(void) { } +#endif static void __init tegra_harmony_init(void) @@ -357,6 +404,7 @@ static void __init tegra_harmony_init(void) tegra_android_platform.product_name = harmony_dev; #endif do_system_init(true, true); + tegra_setup_bluesleep_csr(); } @@ -379,6 +427,7 @@ static void __init tegra_generic_init(void) #endif do_system_init(true, true); register_spi_ipc_devices(); + tegra_setup_bluesleep_csr(); } MACHINE_START(VENTANA, "NVIDIA Ventana Development System") diff --git a/arch/arm/mach-tegra/odm_kit/query/harmony/nvodm_query.c b/arch/arm/mach-tegra/odm_kit/query/harmony/nvodm_query.c index 5eb105409ace..23ae5bb3a7d9 100644 --- a/arch/arm/mach-tegra/odm_kit/query/harmony/nvodm_query.c +++ b/arch/arm/mach-tegra/odm_kit/query/harmony/nvodm_query.c @@ -301,7 +301,7 @@ static NvOdmWakeupPadInfo s_NvOdmWakeupPadInfo[] = {NV_FALSE, 4, NvOdmWakeupPadPolarity_High}, // Wake Event 4 - hdmi_int (HDMI_HPD) {NV_TRUE, 5, NvOdmWakeupPadPolarity_Low}, // Wake Event 5 - vgp[6] (VI_GP6, Flash_EN2) {NV_FALSE, 6, NvOdmWakeupPadPolarity_High}, // Wake Event 6 - gp3_pu[5] (GPS_ON_OFF, GPS_IRQ) - {NV_FALSE, 7, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 7 - gp3_pu[6] (GPS_INT, BT_IRQ) + {NV_TRUE, 7, NvOdmWakeupPadPolarity_AnyEdge}, /* Wake Event 7 - gp3_pu[6] (GPS_INT, BT_IRQ*/ {NV_FALSE, 8, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 8 - gmi_wp_n (MICRO SD_CD) {NV_FALSE, 9, NvOdmWakeupPadPolarity_High}, // Wake Event 9 - gp3_ps[2] (KB_COL10) {NV_FALSE, 10, NvOdmWakeupPadPolarity_High}, // Wake Event 10 - gmi_ad21 (Accelerometer_TH/TAP) diff --git a/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c b/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c index 84da33aa6215..346aa035cefe 100644 --- a/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c +++ b/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c @@ -1557,7 +1557,7 @@ static NvOdmWakeupPadInfo s_NvOdmWakeupPadInfo[] = {NV_FALSE, 4, NvOdmWakeupPadPolarity_High}, // Wake Event 4 - hdmi_int (HDMI_HPD) {NV_FALSE, 5, NvOdmWakeupPadPolarity_High}, // Wake Event 5 - vgp[6] (VI_GP6, Flash_EN2) {NV_FALSE, 6, NvOdmWakeupPadPolarity_High}, // Wake Event 6 - gp3_pu[5] (GPS_ON_OFF, GPS_IRQ) - {NV_FALSE, 7, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 7 - gp3_pu[6] (GPS_INT, BT_IRQ) + {NV_TRUE, 7, NvOdmWakeupPadPolarity_AnyEdge}, /* Wake Event 7 - gp3_pu[6] (GPS_INT, BT_IRQ)*/ {NV_FALSE, 8, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 8 - gmi_wp_n (MICRO SD_CD) {NV_FALSE, 9, NvOdmWakeupPadPolarity_High}, // Wake Event 9 - gp3_ps[2] (KB_COL10) {NV_FALSE, 10, NvOdmWakeupPadPolarity_High}, // Wake Event 10 - gmi_ad21 (Accelerometer_TH/TAP) |