summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/657-0039-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
blob: 1e2a89a0395276f104514c0ef4631861c834e434 (plain)
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
From 7ebc1e51f92b632774131291f471c66554179a18 Mon Sep 17 00:00:00 2001
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Wed, 10 Aug 2016 15:40:30 -0400
Subject: [PATCH] rtl8xxxu: Implement 8188eu specific 8051 reset function

The 8188eu doesn't seem to require the additional hacks used on some
other chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
@@ -505,6 +505,18 @@ static int rtl8188eu_parse_efuse(struct
 	return 0;
 }
 
+void rtl8188eu_reset_8051(struct rtl8xxxu_priv *priv)
+{
+	u16 sys_func;
+
+	sys_func = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+	sys_func &= ~SYS_FUNC_CPU_ENABLE;
+	rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
+
+	sys_func |= SYS_FUNC_CPU_ENABLE;
+	rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
+}
+
 static int rtl8188eu_load_firmware(struct rtl8xxxu_priv *priv)
 {
 	char *fw_name;
@@ -1204,7 +1216,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
 	.load_firmware = rtl8188eu_load_firmware,
 	.power_on = rtl8188eu_power_on,
 	.power_off = rtl8xxxu_power_off,
-	.reset_8051 = rtl8xxxu_reset_8051,
+	.reset_8051 = rtl8188eu_reset_8051,
 	.llt_init = rtl8xxxu_auto_llt_table,
 	.init_phy_bb = rtl8188eu_init_phy_bb,
 	.init_phy_rf = rtl8188eu_init_phy_rf,