add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rkwifi / bcmdhd / dhd_gpio.c
1 /*
2 * Customer code to add GPIO control during WLAN start/stop
3 * Copyright (C) 1999-2011, Broadcom Corporation
4
5 *         Unless you and Broadcom execute a separate written software license
6 * agreement governing use of this software, this software is licensed to you
7 * under the terms of the GNU General Public License version 2 (the "GPL"),
8 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
9 * following added to such license:
10
11 *      As a special exception, the copyright holders of this software give you
12 * permission to link this software with independent modules, and to copy and
13 * distribute the resulting executable under terms of your choice, provided that
14 * you also meet, for each linked independent module, the terms and conditions of
15 * the license of that module.  An independent module is a module which is not
16 * derived from this software.  The special exception does not apply to any
17 * modifications of the software.
18
19 *      Notwithstanding the above, under no circumstances may you combine this
20 * software in any way with any other Broadcom software provided under a license
21 * other than the GPL, without Broadcom's express prior written consent.
22 *
23 * $Id: dhd_custom_gpio.c,v 1.2.42.1 2010-10-19 00:41:09 Exp $
24 */
25
26 #include <linux/kernel.h>
27 #include <linux/platform_device.h>
28 #include <linux/module.h>
29 #include <linux/rfkill.h>
30 #include <linux/init.h>
31 #include <linux/slab.h>
32 #include <linux/delay.h>
33 #include <linux/interrupt.h>
34
35 #ifdef CUSTOMER_HW
36 #ifdef CUSTOMER_OOB
37 int bcm_wlan_get_oob_irq(void)
38 {
39         int host_oob_irq = 0;
40
41
42         return host_oob_irq;
43 }
44 #endif
45
46 extern int rk29sdk_wifi_power(int on);
47
48 void bcm_wlan_power_on(int flag)
49 {
50         if (flag == 1) {
51                 printk("======== PULL WL_REG_ON HIGH! ========\n");
52                 rk29sdk_wifi_power(1);
53         msleep(100);
54         } else {
55                 printk("======== PULL WL_REG_ON HIGH! (flag = %d) ========\n", flag);
56                 rk29sdk_wifi_power(1);
57         msleep(100);
58         }
59 }
60
61 void bcm_wlan_power_off(int flag)
62 {
63         if (flag == 1) {
64                 printk("======== Card detection to remove SDIO card! ========\n");
65                 rk29sdk_wifi_power(0);
66         } else {
67                 printk("======== PULL WL_REG_ON LOW! (flag = %d) ========\n", flag);
68                 rk29sdk_wifi_power(0);
69         }
70 }
71
72 #endif /* CUSTOMER_HW */