forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/net/wireless/ath/ath9k/ar5008_phy.c
....@@ -18,7 +18,6 @@
1818 #include "hw-ops.h"
1919 #include "../regd.h"
2020 #include "ar9002_phy.h"
21
-#include "ar5008_initvals.h"
2221
2322 /* All code below is for AR5008, AR9001, AR9002 */
2423
....@@ -37,10 +36,6 @@
3736 #define AR5008_11NG_HT_SS_SHIFT 12
3837 #define AR5008_11NG_HT_DS_SHIFT 20
3938
40
-static const int firstep_table[] =
41
-/* level: 0 1 2 3 4 5 6 7 8 */
42
- { -4, -2, 0, 2, 4, 6, 8, 10, 12 }; /* lvl 0-8, default 2 */
43
-
4439 /*
4540 * register values to turn OFDM weak signal detection OFF
4641 */
....@@ -54,6 +49,36 @@
5449 static const int m2ThreshLowExt_off = 127;
5550 static const int m1ThreshExt_off = 127;
5651 static const int m2ThreshExt_off = 127;
52
+
53
+static const u32 ar5416Bank0[][2] = {
54
+ /* Addr allmodes */
55
+ {0x000098b0, 0x1e5795e5},
56
+ {0x000098e0, 0x02008020},
57
+};
58
+
59
+static const u32 ar5416Bank1[][2] = {
60
+ /* Addr allmodes */
61
+ {0x000098b0, 0x02108421},
62
+ {0x000098ec, 0x00000008},
63
+};
64
+
65
+static const u32 ar5416Bank2[][2] = {
66
+ /* Addr allmodes */
67
+ {0x000098b0, 0x0e73ff17},
68
+ {0x000098e0, 0x00000420},
69
+};
70
+
71
+static const u32 ar5416Bank3[][3] = {
72
+ /* Addr 5G 2G */
73
+ {0x000098f0, 0x01400018, 0x01c00018},
74
+};
75
+
76
+static const u32 ar5416Bank7[][2] = {
77
+ /* Addr allmodes */
78
+ {0x0000989c, 0x00000500},
79
+ {0x0000989c, 0x00000800},
80
+ {0x000098cc, 0x0000000e},
81
+};
5782
5883 static const struct ar5416IniArray bank0 = STATIC_INI_ARRAY(ar5416Bank0);
5984 static const struct ar5416IniArray bank1 = STATIC_INI_ARRAY(ar5416Bank1);
....@@ -583,14 +608,14 @@
583608 case 0x5:
584609 REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
585610 AR_PHY_SWAP_ALT_CHAIN);
586
- /* fall through */
611
+ fallthrough;
587612 case 0x3:
588613 if (ah->hw_version.macVersion == AR_SREV_REVISION_5416_10) {
589614 REG_WRITE(ah, AR_PHY_RX_CHAINMASK, 0x7);
590615 REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, 0x7);
591616 break;
592617 }
593
- /* else: fall through */
618
+ fallthrough;
594619 case 0x1:
595620 case 0x2:
596621 case 0x7: