forked from paolosabatino/ssv6xxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssv6051-generic-wlan.c
81 lines (66 loc) · 2.05 KB
/
ssv6051-generic-wlan.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Copyright (c) 2015 South Silicon Valley Microelectronics Inc.
* Copyright (c) 2015 iComm Corporation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/irq.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/gpio.h>
#include <linux/mmc/host.h>
#include <linux/delay.h>
#include <linux/regulator/consumer.h>
#include <asm/io.h>
#include <linux/printk.h>
#include <linux/err.h>
#define GPIO_REG_WRITEL(val, reg) \
do { \
__raw_writel(val, CTL_PIN_BASE + (reg)); \
} while (0)
static int g_wifidev_registered = 0;
extern int ssvdevice_init(void);
extern void ssvdevice_exit(void);
extern int ssv6xxx_get_dev_status(void);
static __init int ssv_init_module(void)
{
int ret = 0;
int time = 5;
msleep(120);
g_wifidev_registered = 1;
ret = ssvdevice_init();
while(time-- > 0){
msleep(500);
if(ssv6xxx_get_dev_status() == 1)
break;
pr_info("%s : Retry to carddetect\n",__func__);
}
return ret;
}
static __exit void ssv_exit_module(void)
{
if (g_wifidev_registered)
{
ssvdevice_exit();
msleep(50);
g_wifidev_registered = 0;
}
return;
}
module_init(ssv_init_module);
module_exit(ssv_exit_module);
MODULE_AUTHOR("iComm Semiconductor Co., Ltd");
MODULE_FIRMWARE("ssv*-sw.bin");
MODULE_FIRMWARE("ssv*-wifi.cfg");
MODULE_DESCRIPTION("Shared library for SSV wireless LAN cards.");
MODULE_LICENSE("Dual BSD/GPL");