wifi:use function to detect irq trigger level
authorJiamin Miao <jiamin.miao@amlogic.com>
Fri, 24 Jul 2015 06:33:30 +0000 (14:33 +0800)
committerJiamin Miao <jiamin.miao@amlogic.com>
Fri, 24 Jul 2015 06:41:16 +0000 (14:41 +0800)
Change-Id: I68ae569bb2b31eda2941235ad4d2e783ed27f077

bcmdhd_1_201_59_x/Makefile
bcmdhd_1_201_59_x/bcmsdh_sdmmc.c

index d33381b1f42e61cdc8d8894aadd9644a07d72226..a7065082ceaf8b4d62c289a76b45c34609bde16b 100644 (file)
@@ -62,7 +62,7 @@ dhd-objs += $(DHDOFILES)
 
 #ifeq ($(CONFIG_MACH_ODROID_4210),y)
 DHDOFILES += dhd_gpio.o
-DHDCFLAGS += -DCUSTOMER_HW -DDHD_OF_SUPPORT -DCUSTOMER_HW_AMLOGIC -DHW_OOB_LOW_LEVEL
+DHDCFLAGS += -DCUSTOMER_HW -DDHD_OF_SUPPORT -DCUSTOMER_HW_AMLOGIC
 #DHDCFLAGS += -DBCMWAPI_WPI -DBCMWAPI_WAI
 #endif
 
index f5ece15f532a235fcfea836ce3daa7ee11e596c9..f0faaf879ef18911e04bbae09cf5e131d857680d 100644 (file)
@@ -43,6 +43,7 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 
+#include <linux/amlogic/aml_gpio_consumer.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
 #include <linux/suspend.h>
 extern volatile bool dhd_mmc_suspend;
@@ -704,19 +705,19 @@ exit:
 }
 
 #if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-
+extern int wifi_irq_trigger_level(void);
 SDIOH_API_RC
 sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
 {
        SDIOH_API_RC status;
        uint8 data;
 
-       if (enable)
-#ifdef HW_OOB_LOW_LEVEL
-               data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
-#else
-               data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE | SDIO_SEPINT_ACT_HI;
-#endif
+       if (enable) {
+               if (wifi_irq_trigger_level() == GPIO_IRQ_LOW)
+                       data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE;
+               else
+                       data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE | SDIO_SEPINT_ACT_HI;
+       }
        else
                data = SDIO_SEPINT_ACT_HI;      /* disable hw oob interrupt */