summaryrefslogtreecommitdiff
path: root/net/rfkill/rfkill-bt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rfkill/rfkill-bt.c')
-rw-r--r--net/rfkill/rfkill-bt.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/rfkill/rfkill-bt.c b/net/rfkill/rfkill-bt.c
index 332eb47b0986..920eaa3981e2 100644
--- a/net/rfkill/rfkill-bt.c
+++ b/net/rfkill/rfkill-bt.c
@@ -264,6 +264,7 @@ int rfkill_get_bt_power_state(int *power, bool *toggle)
static int rfkill_rk_set_power(void *data, bool blocked)
{
struct rfkill_rk_data *rfkill = data;
+ struct rfkill_rk_gpio *wake_host = &rfkill->pdata->wake_host_irq.gpio;
struct rfkill_rk_gpio *poweron = &rfkill->pdata->poweron_gpio;
struct rfkill_rk_gpio *reset = &rfkill->pdata->reset_gpio;
struct rfkill_rk_gpio* rts = &rfkill->pdata->rts_gpio;
@@ -289,13 +290,20 @@ static int rfkill_rk_set_power(void *data, bool blocked)
if (false == blocked) {
rfkill_rk_sleep_bt(BT_WAKEUP); // ensure bt is wakeup
+ if (gpio_is_valid(wake_host->io)) {
+ LOG("%s: set bt wake_host pin output high!\n", __func__);
+ gpio_direction_output(wake_host->io, 1);
+ msleep(20);
+ }
- if (gpio_is_valid(poweron->io))
+ if (gpio_is_valid(poweron->io) && gpio_is_valid(wake_host->io))
{
- gpio_direction_output(poweron->io, !poweron->enable);
- msleep(20);
- gpio_direction_output(poweron->io, poweron->enable);
- msleep(20);
+ gpio_direction_output(poweron->io, !poweron->enable);
+ msleep(20);
+ gpio_direction_output(poweron->io, poweron->enable);
+ msleep(20);
+ gpio_direction_input(wake_host->io);
+ LOG("%s: set bt wake_host pin input!\n", __func__);
}
if (gpio_is_valid(reset->io))
{