From: CMY Date: Wed, 9 May 2012 09:20:40 +0000 (+0800) Subject: BT: new config 'CONFIG_RFKILL_RESET' for bluetooth reset on suspend/resume X-Git-Tag: firefly_0821_release~9217 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9736343ee37beb98f517f7cb7c5b4154f4456c59;p=firefly-linux-kernel-4.4.55.git BT: new config 'CONFIG_RFKILL_RESET' for bluetooth reset on suspend/resume --- diff --git a/arch/arm/mach-rk30/board-rk30-sdk-rfkill.c b/arch/arm/mach-rk30/board-rk30-sdk-rfkill.c index 459aad062029..49ac36129743 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk-rfkill.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-rfkill.c @@ -148,6 +148,12 @@ static int bcm4329_rfkill_suspend(struct platform_device *pdev, pm_message_t sta gpio_request(UART_RTS, "uart_rts"); gpio_set_value(UART_RTS, GPIO_HIGH); +#ifdef CONFIG_RFKILL_RESET + extern void rfkill_set_block(struct rfkill *rfkill, bool blocked); + printk("rfkill_set_block\n"); + rfkill_set_block(gBtCtrl.bt_rfk, true); +#endif + return 0; } diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig index 8e12c8a2b82b..73111a5867ab 100644 --- a/net/rfkill/Kconfig +++ b/net/rfkill/Kconfig @@ -47,3 +47,9 @@ config RFKILL_GPIO If you say yes here you get support of a generic gpio RFKILL driver. The platform should fill in the appropriate fields in the rfkill_gpio_platform_data structure and pass that to the driver. + +config RFKILL_RESET + bool "Reset bluetooth on resume" + depends on RFKILL && PM + default n + diff --git a/net/rfkill/core.c b/net/rfkill/core.c index df2dae6b2723..cfd0c89edf68 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -252,7 +252,11 @@ static bool __rfkill_set_hw_state(struct rfkill *rfkill, * Calls the set_block method (when applicable) and handles notifications * etc. as well. */ +#ifdef CONFIG_RFKILL_RESET +void rfkill_set_block(struct rfkill *rfkill, bool blocked) +#else static void rfkill_set_block(struct rfkill *rfkill, bool blocked) +#endif { unsigned long flags; int err; @@ -303,6 +307,9 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) rfkill_led_trigger_event(rfkill); rfkill_event(rfkill); } +#ifdef CONFIG_RFKILL_RESET +EXPORT_SYMBOL(rfkill_set_block); +#endif #ifdef CONFIG_RFKILL_INPUT static atomic_t rfkill_input_disabled = ATOMIC_INIT(0);