BT: new config 'CONFIG_RFKILL_RESET' for bluetooth reset on suspend/resume
authorCMY <cmy@rock-chips.com>
Wed, 9 May 2012 09:20:40 +0000 (17:20 +0800)
committerCMY <cmy@rock-chips.com>
Wed, 9 May 2012 09:20:40 +0000 (17:20 +0800)
arch/arm/mach-rk30/board-rk30-sdk-rfkill.c
net/rfkill/Kconfig
net/rfkill/core.c

index 459aad0620297bfd0ec9d14c186d21b9ae3b0012..49ac361297430639a6eacc46131db4f777a22cfa 100755 (executable)
@@ -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;
 }
 
index 8e12c8a2b82b613a5637537685b71174c412c028..73111a5867ab79eba5be7bfd6c2bdf5500886b08 100644 (file)
@@ -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
+
index df2dae6b27236432c3f8a5ff2a4a7dbf5f8c1d2b..cfd0c89edf680bfacbad0f98084168c42a9d5711 100644 (file)
@@ -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);