diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3h1-bluetooth.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3h1-bluetooth.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c index 3cec4bee656..323ec99ac6b 100644 --- a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c +++ b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c @@ -43,6 +43,7 @@ static void update_host_wake_locked(int); #define BT_REG_GPIO 180 +#define BT_RESET_GPIO 179 #define BT_WAKE_GPIO 93 #define BT_HOST_WAKE_GPIO 11 @@ -68,11 +69,12 @@ struct bcm_bt_lpm { static int bcm20702_bt_rfkill_set_power(void *data, bool blocked) { - // rfkill_ops callback. Turn transmitter on when blocked is false + // rfkill_ops callback. Turn transmitter on when blocked is false if (!blocked) { if (clk32ksys_reg && !bt_enabled) regulator_enable(clk32ksys_reg); + gpio_set_value(BT_RESET_GPIO, 1); gpio_set_value(BT_REG_GPIO, 1); } else { @@ -80,6 +82,7 @@ static int bcm20702_bt_rfkill_set_power(void *data, bool blocked) // we don't hold the wake_lock until chip wakes up again. update_host_wake_locked(0); + gpio_set_value(BT_RESET_GPIO, 0); gpio_set_value(BT_REG_GPIO, 0); if (clk32ksys_reg && bt_enabled) regulator_disable(clk32ksys_reg); @@ -256,15 +259,15 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev) int rc = 0; int ret = 0; -// rc = gpio_request(BT_RESET_GPIO, "bcm20702_nreset_gpip"); -// if (unlikely(rc)) { -// return rc; -// } + rc = gpio_request(BT_RESET_GPIO, "bcm20702_nreset_gpip"); + if (unlikely(rc)) { + return rc; + } rc = gpio_request(BT_REG_GPIO, "bcm20702_nshutdown_gpio"); if (unlikely(rc)) { - //gpio_free(BT_RESET_GPIO); - return rc; + gpio_free(BT_RESET_GPIO); + return rc; } clk32ksys_reg = regulator_get(0, "clk32ksys"); @@ -274,14 +277,14 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev) } gpio_direction_output(BT_REG_GPIO, 1); - //gpio_direction_output(BT_RESET_GPIO, 1); + gpio_direction_output(BT_RESET_GPIO, 1); bt_rfkill = rfkill_alloc("bcm20702 Bluetooth", &pdev->dev, RFKILL_TYPE_BLUETOOTH, &bcm20702_bt_rfkill_ops, NULL); if (unlikely(!bt_rfkill)) { - //gpio_free(BT_RESET_GPIO); + gpio_free(BT_RESET_GPIO); gpio_free(BT_REG_GPIO); return -ENOMEM; } @@ -291,7 +294,7 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev) if (unlikely(rc)) { rfkill_destroy(bt_rfkill); - //gpio_free(BT_RESET_GPIO); + gpio_free(BT_RESET_GPIO); gpio_free(BT_REG_GPIO); return -1; } @@ -301,7 +304,7 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev) rfkill_unregister(bt_rfkill); rfkill_destroy(bt_rfkill); - //gpio_free(BT_RESET_GPIO); + gpio_free(BT_RESET_GPIO); gpio_free(BT_REG_GPIO); } @@ -322,7 +325,7 @@ static int bcm20702_bluetooth_remove(struct platform_device *pdev) debugfs_remove(btdebugdent); gpio_free(BT_REG_GPIO); - //gpio_free(BT_RESET_GPIO); + gpio_free(BT_RESET_GPIO); gpio_free(BT_WAKE_GPIO); gpio_free(BT_HOST_WAKE_GPIO); regulator_put(clk32ksys_reg); @@ -337,7 +340,7 @@ int bcm4430_bluetooth_suspend(struct platform_device *pdev, pm_message_t state) int host_wake; disable_irq(irq); - host_wake = gpio_get_value(BT_HOST_WAKE_GPIO); /* Never goes low - what's up? */ + host_wake = gpio_get_value(BT_HOST_WAKE_GPIO); if (host_wake) { enable_irq(irq); |