diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-15 08:17:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-15 14:47:45 -0500 |
commit | d66be8294289346ceba4c6abc022954b682d4959 (patch) | |
tree | 04ecac99709fe94b5d1c0f5ef7189b155434918a /drivers | |
parent | aa1f2f0a3218a9b6ce979fca3d6ebdb1c5544dd8 (diff) |
b43: N-PHY: check for bustype before touching BCMA CC PLLs
Reported-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 111 |
1 files changed, 61 insertions, 50 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 154f97dc3780..c8fa2cd97e64 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -4048,60 +4048,71 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
4048 | /* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */ | 4048 | /* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */ |
4049 | static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid) | 4049 | static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid) |
4050 | { | 4050 | { |
4051 | #ifdef CONFIG_B43_BCMA | 4051 | struct bcma_drv_cc *cc; |
4052 | struct bcma_drv_cc *cc = &dev->dev->bdev->bus->drv_cc; | ||
4053 | u32 pmu_ctl; | 4052 | u32 pmu_ctl; |
4054 | if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) { | 4053 | |
4055 | if (avoid) { | 4054 | switch (dev->dev->bus_type) { |
4056 | bcma_chipco_pll_write(cc, 0x0, 0x11500010); | 4055 | #ifdef CONFIG_B43_BCMA |
4057 | bcma_chipco_pll_write(cc, 0x1, 0x000C0C06); | 4056 | case B43_BUS_BCMA: |
4058 | bcma_chipco_pll_write(cc, 0x2, 0x0F600a08); | 4057 | cc = &dev->dev->bdev->bus->drv_cc; |
4059 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | 4058 | if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) { |
4060 | bcma_chipco_pll_write(cc, 0x4, 0x2001E920); | 4059 | if (avoid) { |
4061 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | 4060 | bcma_chipco_pll_write(cc, 0x0, 0x11500010); |
4062 | } else { | 4061 | bcma_chipco_pll_write(cc, 0x1, 0x000C0C06); |
4063 | bcma_chipco_pll_write(cc, 0x0, 0x11100010); | 4062 | bcma_chipco_pll_write(cc, 0x2, 0x0F600a08); |
4064 | bcma_chipco_pll_write(cc, 0x1, 0x000c0c06); | 4063 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); |
4065 | bcma_chipco_pll_write(cc, 0x2, 0x03000a08); | 4064 | bcma_chipco_pll_write(cc, 0x4, 0x2001E920); |
4066 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | 4065 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); |
4067 | bcma_chipco_pll_write(cc, 0x4, 0x200005c0); | 4066 | } else { |
4068 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | 4067 | bcma_chipco_pll_write(cc, 0x0, 0x11100010); |
4069 | } | 4068 | bcma_chipco_pll_write(cc, 0x1, 0x000c0c06); |
4070 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD; | 4069 | bcma_chipco_pll_write(cc, 0x2, 0x03000a08); |
4071 | } else if (dev->dev->chip_id == 0x4716) { | 4070 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); |
4072 | if (avoid) { | 4071 | bcma_chipco_pll_write(cc, 0x4, 0x200005c0); |
4073 | bcma_chipco_pll_write(cc, 0x0, 0x11500060); | 4072 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); |
4074 | bcma_chipco_pll_write(cc, 0x1, 0x080C0C06); | 4073 | } |
4075 | bcma_chipco_pll_write(cc, 0x2, 0x0F600000); | 4074 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD; |
4076 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | 4075 | } else if (dev->dev->chip_id == 0x4716) { |
4077 | bcma_chipco_pll_write(cc, 0x4, 0x2001E924); | 4076 | if (avoid) { |
4078 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | 4077 | bcma_chipco_pll_write(cc, 0x0, 0x11500060); |
4078 | bcma_chipco_pll_write(cc, 0x1, 0x080C0C06); | ||
4079 | bcma_chipco_pll_write(cc, 0x2, 0x0F600000); | ||
4080 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | ||
4081 | bcma_chipco_pll_write(cc, 0x4, 0x2001E924); | ||
4082 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | ||
4083 | } else { | ||
4084 | bcma_chipco_pll_write(cc, 0x0, 0x11100060); | ||
4085 | bcma_chipco_pll_write(cc, 0x1, 0x080c0c06); | ||
4086 | bcma_chipco_pll_write(cc, 0x2, 0x03000000); | ||
4087 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | ||
4088 | bcma_chipco_pll_write(cc, 0x4, 0x200005c0); | ||
4089 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | ||
4090 | } | ||
4091 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD | | ||
4092 | BCMA_CC_PMU_CTL_NOILPONW; | ||
4093 | } else if (dev->dev->chip_id == 0x4322 || | ||
4094 | dev->dev->chip_id == 0x4340 || | ||
4095 | dev->dev->chip_id == 0x4341) { | ||
4096 | bcma_chipco_pll_write(cc, 0x0, 0x11100070); | ||
4097 | bcma_chipco_pll_write(cc, 0x1, 0x1014140a); | ||
4098 | bcma_chipco_pll_write(cc, 0x5, 0x88888854); | ||
4099 | if (avoid) | ||
4100 | bcma_chipco_pll_write(cc, 0x2, 0x05201828); | ||
4101 | else | ||
4102 | bcma_chipco_pll_write(cc, 0x2, 0x05001828); | ||
4103 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD; | ||
4079 | } else { | 4104 | } else { |
4080 | bcma_chipco_pll_write(cc, 0x0, 0x11100060); | 4105 | return; |
4081 | bcma_chipco_pll_write(cc, 0x1, 0x080c0c06); | ||
4082 | bcma_chipco_pll_write(cc, 0x2, 0x03000000); | ||
4083 | bcma_chipco_pll_write(cc, 0x3, 0x00000000); | ||
4084 | bcma_chipco_pll_write(cc, 0x4, 0x200005c0); | ||
4085 | bcma_chipco_pll_write(cc, 0x5, 0x88888815); | ||
4086 | } | 4106 | } |
4087 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD | BCMA_CC_PMU_CTL_NOILPONW; | 4107 | bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl); |
4088 | } else if (dev->dev->chip_id == 0x4322 || dev->dev->chip_id == 0x4340 || | 4108 | break; |
4089 | dev->dev->chip_id == 0x4341) { | ||
4090 | bcma_chipco_pll_write(cc, 0x0, 0x11100070); | ||
4091 | bcma_chipco_pll_write(cc, 0x1, 0x1014140a); | ||
4092 | bcma_chipco_pll_write(cc, 0x5, 0x88888854); | ||
4093 | if (avoid) | ||
4094 | bcma_chipco_pll_write(cc, 0x2, 0x05201828); | ||
4095 | else | ||
4096 | bcma_chipco_pll_write(cc, 0x2, 0x05001828); | ||
4097 | pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD; | ||
4098 | } else { | ||
4099 | return; | ||
4100 | } | ||
4101 | bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl); | ||
4102 | #else | ||
4103 | return; | ||
4104 | #endif | 4109 | #endif |
4110 | #ifdef CONFIG_B43_SSB | ||
4111 | case B43_BUS_SSB: | ||
4112 | /* FIXME */ | ||
4113 | break; | ||
4114 | #endif | ||
4115 | } | ||
4105 | } | 4116 | } |
4106 | 4117 | ||
4107 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ | 4118 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ |