File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2985,7 +2985,22 @@ void b43_mac_switch_freq(struct b43_wldev *dev, u8 spurmode)
29852985{
29862986 u16 chip_id = dev -> dev -> chip_id ;
29872987
2988- if (chip_id == BCMA_CHIP_ID_BCM43131 ||
2988+ if (chip_id == BCMA_CHIP_ID_BCM4331 ) {
2989+ switch (spurmode ) {
2990+ case 2 : /* 168 Mhz: 2^26/168 = 0x61862 */
2991+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_LOW , 0x1862 );
2992+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_HIGH , 0x6 );
2993+ break ;
2994+ case 1 : /* 164 Mhz: 2^26/164 = 0x63e70 */
2995+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_LOW , 0x3e70 );
2996+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_HIGH , 0x6 );
2997+ break ;
2998+ default : /* 160 Mhz: 2^26/160 = 0x66666 */
2999+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_LOW , 0x6666 );
3000+ b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_HIGH , 0x6 );
3001+ break ;
3002+ }
3003+ } else if (chip_id == BCMA_CHIP_ID_BCM43131 ||
29893004 chip_id == BCMA_CHIP_ID_BCM43217 ||
29903005 chip_id == BCMA_CHIP_ID_BCM43222 ||
29913006 chip_id == BCMA_CHIP_ID_BCM43224 ||
Original file line number Diff line number Diff line change @@ -728,7 +728,6 @@ static void b43_phy_ht_spur_avoid(struct b43_wldev *dev,
728728{
729729 struct bcma_device * core = dev -> dev -> bdev ;
730730 int spuravoid = 0 ;
731- u16 tmp ;
732731
733732 /* Check for 13 and 14 is just a guess, we don't have enough logs. */
734733 if (new_channel -> hw_value == 13 || new_channel -> hw_value == 14 )
@@ -741,20 +740,7 @@ static void b43_phy_ht_spur_avoid(struct b43_wldev *dev,
741740 B43_BCMA_CLKCTLST_80211_PLL_ST |
742741 B43_BCMA_CLKCTLST_PHY_PLL_ST , false);
743742
744- /* Values has been taken from wlc_bmac_switch_macfreq comments */
745- switch (spuravoid ) {
746- case 2 : /* 126MHz */
747- tmp = 0x2082 ;
748- break ;
749- case 1 : /* 123MHz */
750- tmp = 0x5341 ;
751- break ;
752- default : /* 120MHz */
753- tmp = 0x8889 ;
754- }
755-
756- b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_LOW , tmp );
757- b43_write16 (dev , B43_MMIO_TSF_CLK_FRAC_HIGH , 0x8 );
743+ b43_mac_switch_freq (dev , spuravoid );
758744
759745 /* TODO: reset PLL */
760746
You can’t perform that action at this time.
0 commit comments