summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/phy.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-02-12 04:36:45 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 19:51:43 (GMT)
commit06d0f0663e11cab4ec5f2c143a118d71a12fbbe9 (patch)
tree25f7f2dcee8b2f6acdf577a8122fd5da15e2b2b2 /drivers/net/wireless/ath9k/phy.c
parentfec0de1110e58ed39647e484bff8437e4185158d (diff)
downloadlinux-fsl-qoriq-06d0f0663e11cab4ec5f2c143a118d71a12fbbe9.tar.xz
ath9k: Enable Fractional N mode
This patch enables Fractional N mode for all channel if the EEPROM says so, and also fixes the INI only when the device is not a 2 GHz only capable device. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/phy.c')
-rw-r--r--drivers/net/wireless/ath9k/phy.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath9k/phy.c b/drivers/net/wireless/ath9k/phy.c
index 52aa2a7..e1494ba 100644
--- a/drivers/net/wireless/ath9k/phy.c
+++ b/drivers/net/wireless/ath9k/phy.c
@@ -132,20 +132,27 @@ ath9k_hw_ar9280_set_channel(struct ath_hw *ah,
bMode = 0;
fracMode = 0;
- if ((freq % 20) == 0) {
- aModeRefSel = 3;
- } else if ((freq % 10) == 0) {
- aModeRefSel = 2;
- } else {
+ switch(ah->eep_ops->get_eeprom(ah, EEP_FRAC_N_5G)) {
+ case 0:
+ if ((freq % 20) == 0) {
+ aModeRefSel = 3;
+ } else if ((freq % 10) == 0) {
+ aModeRefSel = 2;
+ }
+ if (aModeRefSel)
+ break;
+ case 1:
+ default:
aModeRefSel = 0;
-
fracMode = 1;
refDivA = 1;
channelSel = (freq * 0x8000) / 15;
REG_RMW_FIELD(ah, AR_AN_SYNTH9,
AR_AN_SYNTH9_REFDIVA, refDivA);
+
}
+
if (!fracMode) {
ndiv = (freq * (refDivA >> aModeRefSel)) / 60;
channelSel = ndiv & 0x1ff;