diff options
| author | mattis fjallstrom <mattis@acm.org> | 2015-07-02 01:19:37 -0700 |
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2015-07-02 01:40:14 -0700 |
| commit | b40c8de18d0f070cb1182f18d643bb6c8917be0e (patch) | |
| tree | d8390ee12e475b26363a425e47bde005e541cfe6 /arch/arm/mach-omap2/board-omap3h1-bluetooth.c | |
| parent | a935b06ef32a95efb0d5ddb80d8e69cdefa575dd (diff) | |
| parent | 69a77a4d2e92d81f45249f09126bd5d2c36a0b5d (diff) | |
| download | olio-linux-3.10-b40c8de18d0f070cb1182f18d643bb6c8917be0e.tar.xz olio-linux-3.10-b40c8de18d0f070cb1182f18d643bb6c8917be0e.zip | |
Moved from Invensense accelerometer to ST.
Change-Id: If42c1a612784368bea2f77d2ef8722a31f9a4f34
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3h1-bluetooth.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3h1-bluetooth.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c index 323ec99ac6b..84108a79258 100644 --- a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c +++ b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c @@ -36,16 +36,19 @@ #include <linux/debugfs.h> #include <linux/seq_file.h> #include <asm/mach-types.h> +#include <linux/platform_data/serial-omap.h> #include "serial.h" #include "board-omap3h1.h" #include <linux/regulator/driver.h> static void update_host_wake_locked(int); +#define BT_RESET_GPIO 179 #define BT_REG_GPIO 180 #define BT_RESET_GPIO 179 #define BT_WAKE_GPIO 93 #define BT_HOST_WAKE_GPIO 11 +#define UART_PORT 1 static struct rfkill *bt_rfkill; static struct regulator *clk32ksys_reg; @@ -76,13 +79,14 @@ static int bcm20702_bt_rfkill_set_power(void *data, bool blocked) gpio_set_value(BT_RESET_GPIO, 1); gpio_set_value(BT_REG_GPIO, 1); + gpio_set_value(BT_RESET_GPIO, 1); } else { // Chip won't toggle host_wake after reset. Make sure // 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_RESET_GPIO, 0); gpio_set_value(BT_REG_GPIO, 0); if (clk32ksys_reg && bt_enabled) regulator_disable(clk32ksys_reg); @@ -104,13 +108,13 @@ static void set_wake_locked(int wake) if (!wake) wake_unlock(&bt_lpm.wake_lock); - //if (!wake_uart_enabled && wake) - //omap_uart_enable(2); + if (!wake_uart_enabled && wake) + omap_serial_ext_uart_enable(UART_PORT); gpio_set_value(BT_WAKE_GPIO, wake); - //if (wake_uart_enabled && !wake) - //omap_uart_disable(2); + if (wake_uart_enabled && !wake) + omap_serial_ext_uart_disable(UART_PORT); wake_uart_enabled = wake; } @@ -146,11 +150,11 @@ static void update_host_wake_locked(int host_wake) if (host_wake) { wake_lock(&bt_lpm.wake_lock); if (!host_wake_uart_enabled) { - //omap_uart_enable(2); + omap_serial_ext_uart_enable(UART_PORT); } } else { if (host_wake_uart_enabled) { - //omap_uart_disable(2); + omap_serial_ext_uart_disable(UART_PORT); } // Take a timed wakelock, so that upper layers can take it. // The chipset deasserts the hostwake lock, when there is no @@ -259,15 +263,16 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev) int rc = 0; int ret = 0; - rc = gpio_request(BT_RESET_GPIO, "bcm20702_nreset_gpip"); + 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"); |