Browse Source

support OOB interrupt

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Icenowy Zheng 1 year ago
parent
commit
bb8a4961be
2 changed files with 17 additions and 1 deletions
  1. 1 1
      Makefile
  2. 16 0
      os_dep/linux/sdio_intf.c

+ 1 - 1
Makefile

@@ -64,7 +64,7 @@ CONFIG_TDLS = n
 CONFIG_WIFI_MONITOR = n
 ######################## Wake On Lan ##########################
 CONFIG_WOWLAN = n
-CONFIG_GPIO_WAKEUP = n
+CONFIG_GPIO_WAKEUP = y
 CONFIG_WAKEUP_GPIO_IDX = default
 CONFIG_HIGH_ACTIVE = n
 CONFIG_PNO_SUPPORT = n

+ 16 - 0
os_dep/linux/sdio_intf.c

@@ -36,6 +36,9 @@
 static int wlan_en_gpio = -1;
 #endif //CONFIG_PLATFORM_INTEL_BYT
 
+#include <linux/of.h>
+#include <linux/of_irq.h>
+
 #ifndef dev_to_sdio_func
 #define dev_to_sdio_func(d)     container_of(d, struct sdio_func, dev)
 #endif
@@ -654,6 +657,10 @@ static int rtw_drv_init(
 	PADAPTER if1 = NULL, if2 = NULL;
 	struct dvobj_priv *dvobj;
 
+#ifdef CONFIG_OF
+	struct device_node *np;
+#endif
+
 #ifdef CONFIG_PLATFORM_INTEL_BYT
 
 #ifdef CONFIG_ACPI
@@ -690,6 +697,15 @@ static int rtw_drv_init(
 #endif
 #endif //CONFIG_PLATFORM_INTEL_BYT
 
+#if defined(CONFIG_OF)
+	np = func->dev.of_node;
+	if (np) {
+		/* make sure there are interrupts defined in the node */
+		if (of_find_property(np, "interrupts", NULL)) {
+			oob_irq = irq_of_parse_and_map(np, 0);
+		}
+	}
+#endif
 
 	RT_TRACE(_module_hci_intfs_c_, _drv_info_,
 		("+rtw_drv_init: vendor=0x%04x device=0x%04x class=0x%02x\n",