aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-14 11:40:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-15 13:45:07 -0400
commitc7d36f9fe73ed29760042276295ac42c17849f32 (patch)
treeee411894088ff392b3bac230caa22afb0ed698b0 /drivers/net/wireless/ath/ath9k
parent9951c4d042dbc325b147cce5bd6f6436adb2c7fc (diff)
ath9k_hw: clean up iniModesAdditional
use iniModesFastClock for 5 ghz fast clock specific settings, and iniAdditional for clock/chip specific initval overrides Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_hw.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
5 files changed, 22 insertions, 30 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 86a891f93fc..5d34e57ce50 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -869,10 +869,9 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
869 869
870 REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites); 870 REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites);
871 871
872 if (IS_CHAN_A_FAST_CLOCK(ah, chan)) { 872 if (IS_CHAN_A_FAST_CLOCK(ah, chan))
873 REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, 873 REG_WRITE_ARRAY(&ah->iniModesFastClock, modesIndex,
874 regWrites); 874 regWrites);
875 }
876 875
877 ar5008_hw_override_ini(ah, chan); 876 ar5008_hw_override_ini(ah, chan);
878 ar5008_hw_set_channel_regs(ah, chan); 877 ar5008_hw_set_channel_regs(ah, chan);
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 1d06dab2703..7098cd8eee6 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -73,7 +73,7 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
73 INIT_INI_ARRAY(&ah->iniCommon, ar9280Common_9280_2, 73 INIT_INI_ARRAY(&ah->iniCommon, ar9280Common_9280_2,
74 ARRAY_SIZE(ar9280Common_9280_2), 2); 74 ARRAY_SIZE(ar9280Common_9280_2), 2);
75 75
76 INIT_INI_ARRAY(&ah->iniModesAdditional, 76 INIT_INI_ARRAY(&ah->iniModesFastClock,
77 ar9280Modes_fast_clock_9280_2, 77 ar9280Modes_fast_clock_9280_2,
78 ARRAY_SIZE(ar9280Modes_fast_clock_9280_2), 3); 78 ARRAY_SIZE(ar9280Modes_fast_clock_9280_2), 3);
79 } else if (AR_SREV_9160_10_OR_LATER(ah)) { 79 } else if (AR_SREV_9160_10_OR_LATER(ah)) {
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 7b4aa000cc2..0f56e322dd3 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -87,11 +87,11 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
87 87
88 /* additional clock settings */ 88 /* additional clock settings */
89 if (ah->is_clk_25mhz) 89 if (ah->is_clk_25mhz)
90 INIT_INI_ARRAY(&ah->iniModesAdditional, 90 INIT_INI_ARRAY(&ah->iniAdditional,
91 ar9331_1p1_xtal_25M, 91 ar9331_1p1_xtal_25M,
92 ARRAY_SIZE(ar9331_1p1_xtal_25M), 2); 92 ARRAY_SIZE(ar9331_1p1_xtal_25M), 2);
93 else 93 else
94 INIT_INI_ARRAY(&ah->iniModesAdditional, 94 INIT_INI_ARRAY(&ah->iniAdditional,
95 ar9331_1p1_xtal_40M, 95 ar9331_1p1_xtal_40M,
96 ARRAY_SIZE(ar9331_1p1_xtal_40M), 2); 96 ARRAY_SIZE(ar9331_1p1_xtal_40M), 2);
97 } else if (AR_SREV_9330_12(ah)) { 97 } else if (AR_SREV_9330_12(ah)) {
@@ -140,11 +140,11 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
140 140
141 /* additional clock settings */ 141 /* additional clock settings */
142 if (ah->is_clk_25mhz) 142 if (ah->is_clk_25mhz)
143 INIT_INI_ARRAY(&ah->iniModesAdditional, 143 INIT_INI_ARRAY(&ah->iniAdditional,
144 ar9331_1p2_xtal_25M, 144 ar9331_1p2_xtal_25M,
145 ARRAY_SIZE(ar9331_1p2_xtal_25M), 2); 145 ARRAY_SIZE(ar9331_1p2_xtal_25M), 2);
146 else 146 else
147 INIT_INI_ARRAY(&ah->iniModesAdditional, 147 INIT_INI_ARRAY(&ah->iniAdditional,
148 ar9331_1p2_xtal_40M, 148 ar9331_1p2_xtal_40M,
149 ARRAY_SIZE(ar9331_1p2_xtal_40M), 2); 149 ARRAY_SIZE(ar9331_1p2_xtal_40M), 2);
150 } else if (AR_SREV_9340(ah)) { 150 } else if (AR_SREV_9340(ah)) {
@@ -194,15 +194,16 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
194 ARRAY_SIZE(ar9340Modes_high_ob_db_tx_gain_table_1p0), 194 ARRAY_SIZE(ar9340Modes_high_ob_db_tx_gain_table_1p0),
195 5); 195 5);
196 196
197 INIT_INI_ARRAY(&ah->iniModesAdditional, 197 INIT_INI_ARRAY(&ah->iniModesFastClock,
198 ar9340Modes_fast_clock_1p0, 198 ar9340Modes_fast_clock_1p0,
199 ARRAY_SIZE(ar9340Modes_fast_clock_1p0), 199 ARRAY_SIZE(ar9340Modes_fast_clock_1p0),
200 3); 200 3);
201 201
202 INIT_INI_ARRAY(&ah->iniModesAdditional_40M, 202 if (!ah->is_clk_25mhz)
203 ar9340_1p0_radio_core_40M, 203 INIT_INI_ARRAY(&ah->iniAdditional,
204 ARRAY_SIZE(ar9340_1p0_radio_core_40M), 204 ar9340_1p0_radio_core_40M,
205 2); 205 ARRAY_SIZE(ar9340_1p0_radio_core_40M),
206 2);
206 } else if (AR_SREV_9485_11(ah)) { 207 } else if (AR_SREV_9485_11(ah)) {
207 /* mac */ 208 /* mac */
208 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0); 209 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_PRE], NULL, 0, 0);
@@ -321,7 +322,7 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
321 2); 322 2);
322 323
323 /* Fast clock modal settings */ 324 /* Fast clock modal settings */
324 INIT_INI_ARRAY(&ah->iniModesAdditional, 325 INIT_INI_ARRAY(&ah->iniModesFastClock,
325 ar9462_modes_fast_clock_2p0, 326 ar9462_modes_fast_clock_2p0,
326 ARRAY_SIZE(ar9462_modes_fast_clock_2p0), 3); 327 ARRAY_SIZE(ar9462_modes_fast_clock_2p0), 3);
327 328
@@ -378,7 +379,7 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
378 ARRAY_SIZE(ar9580_1p0_low_ob_db_tx_gain_table), 379 ARRAY_SIZE(ar9580_1p0_low_ob_db_tx_gain_table),
379 5); 380 5);
380 381
381 INIT_INI_ARRAY(&ah->iniModesAdditional, 382 INIT_INI_ARRAY(&ah->iniModesFastClock,
382 ar9580_1p0_modes_fast_clock, 383 ar9580_1p0_modes_fast_clock,
383 ARRAY_SIZE(ar9580_1p0_modes_fast_clock), 384 ARRAY_SIZE(ar9580_1p0_modes_fast_clock),
384 3); 385 3);
@@ -445,7 +446,7 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
445 2); 446 2);
446 447
447 /* Fast clock modal settings */ 448 /* Fast clock modal settings */
448 INIT_INI_ARRAY(&ah->iniModesAdditional, 449 INIT_INI_ARRAY(&ah->iniModesFastClock,
449 ar9300Modes_fast_clock_2p2, 450 ar9300Modes_fast_clock_2p2,
450 ARRAY_SIZE(ar9300Modes_fast_clock_2p2), 451 ARRAY_SIZE(ar9300Modes_fast_clock_2p2),
451 3); 452 3);
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 99b64f27bb2..bc992b237ae 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -679,14 +679,10 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
679 * different modal values. 679 * different modal values.
680 */ 680 */
681 if (IS_CHAN_A_FAST_CLOCK(ah, chan)) 681 if (IS_CHAN_A_FAST_CLOCK(ah, chan))
682 REG_WRITE_ARRAY(&ah->iniModesAdditional, 682 REG_WRITE_ARRAY(&ah->iniModesFastClock,
683 modesIndex, regWrites); 683 modesIndex, regWrites);
684 684
685 if (AR_SREV_9330(ah)) 685 REG_WRITE_ARRAY(&ah->iniAdditional, 1, regWrites);
686 REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);
687
688 if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
689 REG_WRITE_ARRAY(&ah->iniModesAdditional_40M, 1, regWrites);
690 686
691 if (AR_SREV_9462(ah)) 687 if (AR_SREV_9462(ah))
692 ar9003_hw_prog_ini(ah, &ah->ini_BTCOEX_MAX_TXPWR, 1); 688 ar9003_hw_prog_ini(ah, &ah->ini_BTCOEX_MAX_TXPWR, 1);
@@ -1323,13 +1319,9 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah,
1323 * different modal values. 1319 * different modal values.
1324 */ 1320 */
1325 if (IS_CHAN_A_FAST_CLOCK(ah, chan)) 1321 if (IS_CHAN_A_FAST_CLOCK(ah, chan))
1326 REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, regWrites); 1322 REG_WRITE_ARRAY(&ah->iniModesFastClock, modesIndex, regWrites);
1327
1328 if (AR_SREV_9330(ah))
1329 REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);
1330 1323
1331 if (AR_SREV_9340(ah) && !ah->is_clk_25mhz) 1324 REG_WRITE_ARRAY(&ah->iniAdditional, 1, regWrites);
1332 REG_WRITE_ARRAY(&ah->iniModesAdditional_40M, 1, regWrites);
1333 1325
1334 ah->modes_index = modesIndex; 1326 ah->modes_index = modesIndex;
1335 *ini_reloaded = true; 1327 *ini_reloaded = true;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 4bd2c89654d..7822d5ecbf8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -827,8 +827,8 @@ struct ath_hw {
827 struct ar5416IniArray iniAddac; 827 struct ar5416IniArray iniAddac;
828 struct ar5416IniArray iniPcieSerdes; 828 struct ar5416IniArray iniPcieSerdes;
829 struct ar5416IniArray iniPcieSerdesLowPower; 829 struct ar5416IniArray iniPcieSerdesLowPower;
830 struct ar5416IniArray iniModesAdditional; 830 struct ar5416IniArray iniModesFastClock;
831 struct ar5416IniArray iniModesAdditional_40M; 831 struct ar5416IniArray iniAdditional;
832 struct ar5416IniArray iniModesRxGain; 832 struct ar5416IniArray iniModesRxGain;
833 struct ar5416IniArray iniModesTxGain; 833 struct ar5416IniArray iniModesTxGain;
834 struct ar5416IniArray iniModes_9271_1_0_only; 834 struct ar5416IniArray iniModes_9271_1_0_only;