diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-03-09 07:49:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-13 14:27:49 -0400 |
commit | a51ab25811beef67bdd0ba2c5dd4b03e47948aa1 (patch) | |
tree | 6caea5930ce108a74cf6bf6cded9daf106223258 /drivers/net/wireless/b43 | |
parent | 4cce0956239d324aca045be2b589c43b9baa561d (diff) |
b43: HT-PHY: implement PA override
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.h | 5 |
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index 23a46c667974..1998dca73faa 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c | |||
@@ -178,6 +178,26 @@ static void b43_phy_ht_force_rf_sequence(struct b43_wldev *dev, u16 rf_seq) | |||
178 | b43_phy_write(dev, B43_PHY_HT_RF_SEQ_MODE, save_seq_mode); | 178 | b43_phy_write(dev, B43_PHY_HT_RF_SEQ_MODE, save_seq_mode); |
179 | } | 179 | } |
180 | 180 | ||
181 | static void b43_phy_ht_pa_override(struct b43_wldev *dev, bool enable) | ||
182 | { | ||
183 | struct b43_phy_ht *htphy = dev->phy.ht; | ||
184 | static const u16 regs[3] = { B43_PHY_HT_RF_CTL_INT_C1, | ||
185 | B43_PHY_HT_RF_CTL_INT_C2, | ||
186 | B43_PHY_HT_RF_CTL_INT_C3 }; | ||
187 | int i; | ||
188 | |||
189 | if (enable) { | ||
190 | for (i = 0; i < 3; i++) | ||
191 | b43_phy_write(dev, regs[i], htphy->rf_ctl_int_save[i]); | ||
192 | } else { | ||
193 | for (i = 0; i < 3; i++) | ||
194 | htphy->rf_ctl_int_save[i] = b43_phy_read(dev, regs[i]); | ||
195 | /* TODO: Does 5GHz band use different value (not 0x0400)? */ | ||
196 | for (i = 0; i < 3; i++) | ||
197 | b43_phy_write(dev, regs[i], 0x0400); | ||
198 | } | ||
199 | } | ||
200 | |||
181 | /************************************************** | 201 | /************************************************** |
182 | * Various PHY ops | 202 | * Various PHY ops |
183 | **************************************************/ | 203 | **************************************************/ |
@@ -554,8 +574,10 @@ static int b43_phy_ht_op_init(struct b43_wldev *dev) | |||
554 | 574 | ||
555 | b43_mac_phy_clock_set(dev, true); | 575 | b43_mac_phy_clock_set(dev, true); |
556 | 576 | ||
577 | b43_phy_ht_pa_override(dev, false); | ||
557 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RX2TX); | 578 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RX2TX); |
558 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RST2RX); | 579 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RST2RX); |
580 | b43_phy_ht_pa_override(dev, true); | ||
559 | 581 | ||
560 | /* TODO: Should we restore it? Or store it in global PHY info? */ | 582 | /* TODO: Should we restore it? Or store it in global PHY info? */ |
561 | b43_phy_ht_classifier(dev, 0, 0); | 583 | b43_phy_ht_classifier(dev, 0, 0); |
diff --git a/drivers/net/wireless/b43/phy_ht.h b/drivers/net/wireless/b43/phy_ht.h index 52603affa2d6..684807c2f125 100644 --- a/drivers/net/wireless/b43/phy_ht.h +++ b/drivers/net/wireless/b43/phy_ht.h | |||
@@ -40,6 +40,10 @@ | |||
40 | 40 | ||
41 | #define B43_PHY_HT_RF_CTL1 B43_PHY_EXTG(0x010) | 41 | #define B43_PHY_HT_RF_CTL1 B43_PHY_EXTG(0x010) |
42 | 42 | ||
43 | #define B43_PHY_HT_RF_CTL_INT_C1 B43_PHY_EXTG(0x04c) | ||
44 | #define B43_PHY_HT_RF_CTL_INT_C2 B43_PHY_EXTG(0x06c) | ||
45 | #define B43_PHY_HT_RF_CTL_INT_C3 B43_PHY_EXTG(0x08c) | ||
46 | |||
43 | #define B43_PHY_HT_AFE_C1_OVER B43_PHY_EXTG(0x110) | 47 | #define B43_PHY_HT_AFE_C1_OVER B43_PHY_EXTG(0x110) |
44 | #define B43_PHY_HT_AFE_C1 B43_PHY_EXTG(0x111) | 48 | #define B43_PHY_HT_AFE_C1 B43_PHY_EXTG(0x111) |
45 | #define B43_PHY_HT_AFE_C2_OVER B43_PHY_EXTG(0x114) | 49 | #define B43_PHY_HT_AFE_C2_OVER B43_PHY_EXTG(0x114) |
@@ -62,6 +66,7 @@ struct b43_phy_ht_channeltab_e_phy { | |||
62 | 66 | ||
63 | 67 | ||
64 | struct b43_phy_ht { | 68 | struct b43_phy_ht { |
69 | u16 rf_ctl_int_save[3]; | ||
65 | }; | 70 | }; |
66 | 71 | ||
67 | 72 | ||