Skip to content

Commit

Permalink
bluetooth: rfkill-bt: fix bt irq cannot wake host.
Browse files Browse the repository at this point in the history
This issue is  caused by set wake_host_gpio to out put,
 so cancel set wake_host_gpio to out put

Change-Id: If776c1a9f54914cf0da728925fb8c8bbb5886155
Signed-off-by: Longjian Lin <[email protected]>
  • Loading branch information
Longjian Lin authored and rkhuangtao committed Jan 9, 2019
1 parent 7ec0b63 commit 5f582e9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions net/rfkill/rfkill-bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ 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;
Expand All @@ -290,20 +289,13 @@ 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) && gpio_is_valid(wake_host->io)) {
if (gpio_is_valid(poweron->io)) {
if (gpio_get_value(poweron->io) == !poweron->enable) {
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__);
}
}

Expand Down

0 comments on commit 5f582e9

Please sign in to comment.