From: huweiguo Date: Mon, 14 Mar 2016 01:07:44 +0000 (+0800) Subject: net: rfkill-bt: auto compatible for uart rts control for all uart bt chip X-Git-Tag: firefly_0821_release~3188 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f99458ca3759c283011af6768195df910c7f53b3;p=firefly-linux-kernel-4.4.55.git net: rfkill-bt: auto compatible for uart rts control for all uart bt chip Change-Id: I9b4d6614160285754ee86c427e8918296b92ddbd Signed-off-by: huweiguo --- diff --git a/net/rfkill/rfkill-bt.c b/net/rfkill/rfkill-bt.c index c7da89ccb54b..11e182882365 100644 --- a/net/rfkill/rfkill-bt.c +++ b/net/rfkill/rfkill-bt.c @@ -266,10 +266,8 @@ static int rfkill_rk_set_power(void *data, bool blocked) struct rfkill_rk_data *rfkill = data; struct rfkill_rk_gpio *poweron = &rfkill->pdata->poweron_gpio; struct rfkill_rk_gpio *reset = &rfkill->pdata->reset_gpio; -#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335) struct rfkill_rk_gpio* rts = &rfkill->pdata->rts_gpio; struct pinctrl *pinctrl = rfkill->pdata->pinctrl; -#endif int power = 0, vref_ctrl_enable = 0; bool toggle = false; @@ -305,7 +303,7 @@ static int rfkill_rk_set_power(void *data, bool blocked) msleep(20); gpio_direction_output(reset->io, reset->enable); } -#if defined(CONFIG_AP6210) || defined(CONFIG_AP6335) + if (pinctrl != NULL && gpio_is_valid(rts->io)) { pinctrl_select_state(pinctrl, rts->gpio_state); @@ -316,7 +314,7 @@ static int rfkill_rk_set_power(void *data, bool blocked) gpio_direction_output(rts->io, !rts->enable); pinctrl_select_state(pinctrl, rts->default_state); } -#endif + bt_power_state = 1; LOG("bt turn on power\n"); } else {