From 08e6bbc65fb248aa27ccff4c5dab73d7504c65a5 Mon Sep 17 00:00:00 2001 From: Jiamin Miao Date: Fri, 24 Jul 2015 14:33:30 +0800 Subject: [PATCH] wifi:use function to detect irq trigger level Change-Id: I68ae569bb2b31eda2941235ad4d2e783ed27f077 --- bcmdhd_1_201_59_x/Makefile | 2 +- bcmdhd_1_201_59_x/bcmsdh_sdmmc.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bcmdhd_1_201_59_x/Makefile b/bcmdhd_1_201_59_x/Makefile index d33381b..a706508 100644 --- a/bcmdhd_1_201_59_x/Makefile +++ b/bcmdhd_1_201_59_x/Makefile @@ -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 diff --git a/bcmdhd_1_201_59_x/bcmsdh_sdmmc.c b/bcmdhd_1_201_59_x/bcmsdh_sdmmc.c index f5ece15..f0faaf8 100644 --- a/bcmdhd_1_201_59_x/bcmsdh_sdmmc.c +++ b/bcmdhd_1_201_59_x/bcmsdh_sdmmc.c @@ -43,6 +43,7 @@ #include #include +#include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) #include 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 */ -- 2.20.1