net: wifi: add get_oob_irq_flags interface for request_irq(flags)

Change-Id: I251d3dbad7dbf97c503b3f1ddf46199d8e669cae
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
This commit is contained in:
xiaoyao 2018-05-11 17:43:12 +08:00 committed by Tao Huang
parent ab01fa5a2f
commit 4ecfee5112
3 changed files with 27 additions and 6 deletions

View File

@ -244,6 +244,7 @@ int dhd_wlan_init_gpio(void)
#ifdef CUSTOMER_OOB
int host_oob_irq = -1;
uint host_oob_irq_flags = 0;
int irq_flags = -1;
#endif
/* Please check your schematic and fill right GPIO number which connected to
@ -289,11 +290,14 @@ int dhd_wlan_init_gpio(void)
printf("%s: host_oob_irq: %d\n", __FUNCTION__, host_oob_irq);
#ifdef HW_OOB
#ifdef HW_OOB_LOW_LEVEL
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_SHAREABLE;
#else
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
#endif
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE;
irq_flags = rockchip_wifi_get_oob_irq_flag();
if (irq_flags == 1)
host_oob_irq_flags |= IORESOURCE_IRQ_HIGHLEVEL;
else if (irq_flags == 0)
host_oob_irq_flags |= IORESOURCE_IRQ_LOWLEVEL;
else
pr_warn("%s: unknown oob irqflags !\n", __func__);
#else
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_SHAREABLE;
#endif

View File

@ -83,6 +83,7 @@ int rockchip_wifi_ref_voltage(int on);
int rockchip_wifi_power(int on);
int rockchip_wifi_set_carddetect(int val);
int rockchip_wifi_get_oob_irq(void);
int rockchip_wifi_get_oob_irq_flag(void);
int rockchip_wifi_reset(int on);
int rockchip_wifi_mac_addr(unsigned char *buf);
void *rockchip_wifi_country_code(char *ccode);

View File

@ -434,6 +434,22 @@ int rockchip_wifi_get_oob_irq(void)
}
EXPORT_SYMBOL(rockchip_wifi_get_oob_irq);
int rockchip_wifi_get_oob_irq_flag(void)
{
struct rfkill_wlan_data *mrfkill = g_rfkill;
struct rksdmmc_gpio *wifi_int_irq;
int gpio_flags = -1;
if (mrfkill) {
wifi_int_irq = &mrfkill->pdata->wifi_int_b;
if (gpio_is_valid(wifi_int_irq->io))
gpio_flags = wifi_int_irq->enable;
}
return gpio_flags;
}
EXPORT_SYMBOL(rockchip_wifi_get_oob_irq_flag);
/**************************************************************************
*
* Wifi Reset Func
@ -654,7 +670,7 @@ static int wlan_platdata_parse_dt(struct device *dev,
gpio = of_get_named_gpio_flags(node, "WIFI,host_wake_irq", 0, &flags);
if (gpio_is_valid(gpio)){
data->wifi_int_b.io = gpio;
data->wifi_int_b.enable = flags;
data->wifi_int_b.enable = !flags;
LOG("%s: get property: WIFI,host_wake_irq = %d, flags = %d.\n", __func__, gpio, flags);
} else data->wifi_int_b.io = -1;
}