Skip to content

Commit ff766be

Browse files
kevin-xu-88rkhuangtao
authored andcommitted
bluetooth: rfkill: rockchip: ap6356s bluetooth module for RK3328 EVB board
Change-Id: I3f1e7e792b1c4d6952080b15e5bdb2902df4ddb1 Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
1 parent 8092b0b commit ff766be

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

net/rfkill/rfkill-bt.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ int rfkill_get_bt_power_state(int *power, bool *toggle)
264264
static int rfkill_rk_set_power(void *data, bool blocked)
265265
{
266266
struct rfkill_rk_data *rfkill = data;
267+
struct rfkill_rk_gpio *wake_host = &rfkill->pdata->wake_host_irq.gpio;
267268
struct rfkill_rk_gpio *poweron = &rfkill->pdata->poweron_gpio;
268269
struct rfkill_rk_gpio *reset = &rfkill->pdata->reset_gpio;
269270
struct rfkill_rk_gpio* rts = &rfkill->pdata->rts_gpio;
@@ -289,13 +290,20 @@ static int rfkill_rk_set_power(void *data, bool blocked)
289290
if (false == blocked) {
290291

291292
rfkill_rk_sleep_bt(BT_WAKEUP); // ensure bt is wakeup
293+
if (gpio_is_valid(wake_host->io)) {
294+
LOG("%s: set bt wake_host pin output high!\n", __func__);
295+
gpio_direction_output(wake_host->io, 1);
296+
msleep(20);
297+
}
292298

293-
if (gpio_is_valid(poweron->io))
299+
if (gpio_is_valid(poweron->io) && gpio_is_valid(wake_host->io))
294300
{
295-
gpio_direction_output(poweron->io, !poweron->enable);
296-
msleep(20);
297-
gpio_direction_output(poweron->io, poweron->enable);
298-
msleep(20);
301+
gpio_direction_output(poweron->io, !poweron->enable);
302+
msleep(20);
303+
gpio_direction_output(poweron->io, poweron->enable);
304+
msleep(20);
305+
gpio_direction_input(wake_host->io);
306+
LOG("%s: set bt wake_host pin input!\n", __func__);
299307
}
300308
if (gpio_is_valid(reset->io))
301309
{

0 commit comments

Comments
 (0)