diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-02-20 13:31:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:53 -0500 |
commit | 5f9724dd94d63e26edb02d9f6a4ce1ce35737f14 (patch) | |
tree | 1bdf6d93b958e92936581b6916cf47e29dbd9178 /drivers/net/wireless/b43/lo.c | |
parent | 3718582a663e035af5d2634cd537a012e20cdb3f (diff) |
b43: Convert usage of b43_radio_maskset()
This patch converts code to use the new b43_radio_maskset() API.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression dev, addr, mask, set;
@@
-b43_radio_write16(dev, addr, (b43_radio_read16(dev, addr) & mask) | set);
+b43_radio_maskset(dev, addr, mask, set);
// </smpl>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/lo.c')
-rw-r--r-- | drivers/net/wireless/b43/lo.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c index 70c39bbbcf1f..2a4e2b02faf9 100644 --- a/drivers/net/wireless/b43/lo.c +++ b/drivers/net/wireless/b43/lo.c | |||
@@ -225,8 +225,7 @@ static void lo_measure_txctl_values(struct b43_wldev *dev) | |||
225 | radio_pctl_reg = tmp; | 225 | radio_pctl_reg = tmp; |
226 | } | 226 | } |
227 | } | 227 | } |
228 | b43_radio_write16(dev, 0x43, (b43_radio_read16(dev, 0x43) | 228 | b43_radio_maskset(dev, 0x43, 0xFFF0, radio_pctl_reg); |
229 | & 0xFFF0) | radio_pctl_reg); | ||
230 | b43_gphy_set_baseband_attenuation(dev, 2); | 229 | b43_gphy_set_baseband_attenuation(dev, 2); |
231 | 230 | ||
232 | reg = lo_txctl_register_table(dev, &mask, NULL); | 231 | reg = lo_txctl_register_table(dev, &mask, NULL); |
@@ -241,14 +240,10 @@ static void lo_measure_txctl_values(struct b43_wldev *dev) | |||
241 | 240 | ||
242 | for (i = 0; i < ARRAY_SIZE(tx_magn_values); i++) { | 241 | for (i = 0; i < ARRAY_SIZE(tx_magn_values); i++) { |
243 | tx_magn = tx_magn_values[i]; | 242 | tx_magn = tx_magn_values[i]; |
244 | b43_radio_write16(dev, 0x52, | 243 | b43_radio_maskset(dev, 0x52, 0xFF0F, tx_magn); |
245 | (b43_radio_read16(dev, 0x52) | ||
246 | & 0xFF0F) | tx_magn); | ||
247 | for (j = 0; j < ARRAY_SIZE(tx_bias_values); j++) { | 244 | for (j = 0; j < ARRAY_SIZE(tx_bias_values); j++) { |
248 | tx_bias = tx_bias_values[j]; | 245 | tx_bias = tx_bias_values[j]; |
249 | b43_radio_write16(dev, 0x52, | 246 | b43_radio_maskset(dev, 0x52, 0xFFF0, tx_bias); |
250 | (b43_radio_read16(dev, 0x52) | ||
251 | & 0xFFF0) | tx_bias); | ||
252 | feedthrough = | 247 | feedthrough = |
253 | lo_measure_feedthrough(dev, 0, pga, | 248 | lo_measure_feedthrough(dev, 0, pga, |
254 | trsw_rx); | 249 | trsw_rx); |
@@ -541,8 +536,7 @@ static void lo_measure_restore(struct b43_wldev *dev, | |||
541 | b43_radio_write16(dev, 0x7A, sav->radio_7A); | 536 | b43_radio_write16(dev, 0x7A, sav->radio_7A); |
542 | if (!has_tx_magnification(phy)) { | 537 | if (!has_tx_magnification(phy)) { |
543 | tmp = sav->radio_52; | 538 | tmp = sav->radio_52; |
544 | b43_radio_write16(dev, 0x52, (b43_radio_read16(dev, 0x52) | 539 | b43_radio_maskset(dev, 0x52, 0xFF0F, tmp); |
545 | & 0xFF0F) | tmp); | ||
546 | } | 540 | } |
547 | b43_write16(dev, 0x3E2, sav->reg_3E2); | 541 | b43_write16(dev, 0x3E2, sav->reg_3E2); |
548 | if (phy->type == B43_PHYTYPE_B && | 542 | if (phy->type == B43_PHYTYPE_B && |
@@ -761,12 +755,8 @@ struct b43_lo_calib * b43_calibrate_lo_setting(struct b43_wldev *dev, | |||
761 | 755 | ||
762 | txctl_reg = lo_txctl_register_table(dev, &txctl_value, &pad_mix_gain); | 756 | txctl_reg = lo_txctl_register_table(dev, &txctl_value, &pad_mix_gain); |
763 | 757 | ||
764 | b43_radio_write16(dev, 0x43, | 758 | b43_radio_maskset(dev, 0x43, 0xFFF0, rfatt->att); |
765 | (b43_radio_read16(dev, 0x43) & 0xFFF0) | 759 | b43_radio_maskset(dev, txctl_reg, ~txctl_value, (rfatt->with_padmix ? txctl_value :0)); |
766 | | rfatt->att); | ||
767 | b43_radio_write16(dev, txctl_reg, | ||
768 | (b43_radio_read16(dev, txctl_reg) & ~txctl_value) | ||
769 | | (rfatt->with_padmix ? txctl_value : 0)); | ||
770 | 760 | ||
771 | max_rx_gain = rfatt->att * 2; | 761 | max_rx_gain = rfatt->att * 2; |
772 | max_rx_gain += bbatt->att / 2; | 762 | max_rx_gain += bbatt->att / 2; |