-
Notifications
You must be signed in to change notification settings - Fork 39
/
wifi使能脚替换成为rfkill控制.diff
193 lines (159 loc) · 5.95 KB
/
wifi使能脚替换成为rfkill控制.diff
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
diff --git a/arch/arm/boot/dts/rk3288-evb.dtsi b/arch/arm/boot/dts/rk3288-evb.dtsi
index 1101fe5..ebb35c2 100644
--- a/arch/arm/boot/dts/rk3288-evb.dtsi
+++ b/arch/arm/boot/dts/rk3288-evb.dtsi
@@ -201,6 +201,7 @@
rockchip,grf = <&grf>;
wifi_chip_type = "ap6335";
sdio_vref = <1800>;
+ WIFI,poweren_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
status = "okay";
};
@@ -372,8 +373,8 @@
cap-sdio-irq;
disable-wp;
keep-power-in-suspend;
- mmc-pwrseq = <&sdio_pwrseq>;
- non-removable;
+// mmc-pwrseq = <&sdio_pwrseq>;
+// non-removable;
num-slots = <1>;
pinctrl-names = "default";
pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 8730e2e..3606dd1 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1492,7 +1492,7 @@ static int dw_mci_set_sdio_status(struct mmc_host *mmc, int val)
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci *host = slot->host;
-
+
if (!(mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO))
return 0;
@@ -1517,6 +1517,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
struct dw_mci_board *brd = slot->host->pdata;
struct dw_mci *host = slot->host;
int gpio_cd = mmc_gpio_get_cd(mmc);
+ if (mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO)
+ return test_bit(DW_MMC_CARD_PRESENT, &slot->flags);
/* Use platform get_cd function, else try onboard card detect */
if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
@@ -2754,6 +2756,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
}
dw_mci_get_cd(mmc);
+ if (mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO)
+ clear_bit(DW_MMC_CARD_PRESENT, &slot->flags);
ret = mmc_add_host(mmc);
if (ret)
sdk_project@aaaaa:~/9.0sdk/Rk3288W_ANDROID9.0_MID_V1.0.0_20199410/kernel/net/rfkill$ git diff .
diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c
index 333368f..e596920 100644
--- a/net/rfkill/rfkill-wlan.c
+++ b/net/rfkill/rfkill-wlan.c
@@ -405,7 +405,7 @@ EXPORT_SYMBOL(rockchip_wifi_power);
extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type);
int rockchip_wifi_set_carddetect(int val)
{
- return mmc_host_rescan(NULL, val, 1);
+ return mmc_host_rescan(NULL, val, 0);
}
EXPORT_SYMBOL(rockchip_wifi_set_carddetect);
@@ -833,7 +833,8 @@ static int rfkill_wlan_probe(struct platform_device *pdev)
{
rockchip_wifi_power(1);
}
-
+ msleep(100);
+ rockchip_wifi_set_carddetect(1);
#if BCM_STATIC_MEMORY_SUPPORT
rockchip_init_wifi_mem();
kernel4.4_mmc_rescan can't find card
----------------------------------------------------4.19内核-------------------------------------------------------------
diff --git a/arch/arm64/boot/dts/rockchip/rk3326-evb-lp3-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3326-evb-lp3-v10.dtsi
index 6fb2875..c8c7102 100644
--- a/arch/arm64/boot/dts/rockchip/rk3326-evb-lp3-v10.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3326-evb-lp3-v10.dtsi
@@ -148,7 +148,9 @@
wireless-wlan {
compatible = "wlan-platdata";
wifi_chip_type = "AP6210";
+ WIFI,poweren_gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+ WIFI,vbat_gpio = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>;
+ WIFI,host_wake_irq = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
status = "okay";
};
@@ -784,9 +786,9 @@
supports-sdio;
ignore-pm-notify;
keep-power-in-suspend;
- non-removable;
- mmc-pwrseq = <&sdio_pwrseq>;
- sd-uhs-sdr104;
+ //non-removable;
+ //mmc-pwrseq = <&sdio_pwrseq>;
+ //sd-uhs-sdr104;
status = "okay";
};
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 8730e2e..3606dd1 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1492,7 +1492,7 @@ static int dw_mci_set_sdio_status(struct mmc_host *mmc, int val)
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci *host = slot->host;
-
+
if (!(mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO))
return 0;
@@ -1517,6 +1517,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
struct dw_mci_board *brd = slot->host->pdata;
struct dw_mci *host = slot->host;
int gpio_cd = mmc_gpio_get_cd(mmc);
+ if (mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO)
+ return test_bit(DW_MMC_CARD_PRESENT, &slot->flags);
/* Use platform get_cd function, else try onboard card detect */
if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
@@ -2754,6 +2756,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
}
dw_mci_get_cd(mmc);
+ if (mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO)
+ clear_bit(DW_MMC_CARD_PRESENT, &slot->flags);
ret = mmc_add_host(mmc);
if (ret)
sdk_project@aaaaa:~/9.0sdk/Rk3288W_ANDROID9.0_MID_V1.0.0_20199410/kernel/net/rfkill$ git diff .
diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c
index 333368f..e596920 100644
--- a/net/rfkill/rfkill-wlan.c
+++ b/net/rfkill/rfkill-wlan.c
@@ -405,7 +405,7 @@ EXPORT_SYMBOL(rockchip_wifi_power);
extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type);
int rockchip_wifi_set_carddetect(int val)
{
- return mmc_host_rescan(NULL, val, 1);
+ return mmc_host_rescan(NULL, val, 0);
}
EXPORT_SYMBOL(rockchip_wifi_set_carddetect);
@@ -833,7 +833,8 @@ static int rfkill_wlan_probe(struct platform_device *pdev)
{
rockchip_wifi_power(1);
}
-
diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c
index 27bf91f..3c22704 100644
--- a/net/rfkill/rfkill-wlan.c
+++ b/net/rfkill/rfkill-wlan.c
@@ -757,6 +757,10 @@ static int rfkill_wlan_probe(struct platform_device *pdev)
if (pdata->wifi_power_remain)
rockchip_wifi_power(1);
+
+ rockchip_wifi_power(1);
+ msleep(100);
+ rockchip_wifi_set_carddetect(1);
#if BCM_STATIC_MEMORY_SUPPORT
rockchip_init_wifi_mem();
#if BCM_STATIC_MEMORY_SUPPORT
rockchip_init_wifi_mem();