aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-02-03 14:06:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-09 15:03:49 -0500
commit99e0fca6740b98aed1f604fc2e0acbdbc9e7578a (patch)
tree275ddba90f48bede362a5346ab8653c03b158ecf /drivers/net/wireless/b43
parent686aa5f2137d04f389e527f0391d65232338e599 (diff)
b43: (b2062) Fix crystal frequency calculations
This fixes the crystal frequency calculations in the b2062 init code. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/phy_lp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index fdd31d3672d2..94d9e8b215e3 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -160,6 +160,7 @@ struct b2062_freqdata {
160/* Initialize the 2062 radio. */ 160/* Initialize the 2062 radio. */
161static void lpphy_2062_init(struct b43_wldev *dev) 161static void lpphy_2062_init(struct b43_wldev *dev)
162{ 162{
163 struct ssb_bus *bus = dev->dev->bus;
163 u32 crystalfreq, pdiv, tmp, ref; 164 u32 crystalfreq, pdiv, tmp, ref;
164 unsigned int i; 165 unsigned int i;
165 const struct b2062_freqdata *fd = NULL; 166 const struct b2062_freqdata *fd = NULL;
@@ -193,7 +194,11 @@ static void lpphy_2062_init(struct b43_wldev *dev)
193 else 194 else
194 b43_radio_mask(dev, B2062_N_TSSI_CTL0, ~0x1); 195 b43_radio_mask(dev, B2062_N_TSSI_CTL0, ~0x1);
195 196
196 crystalfreq = 0;//FIXME 197 /* Get the crystal freq, in Hz. */
198 crystalfreq = bus->chipco.pmu.crystalfreq * 1000;
199
200 B43_WARN_ON(!(bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU));
201 B43_WARN_ON(crystalfreq == 0);
197 202
198 if (crystalfreq >= 30000000) { 203 if (crystalfreq >= 30000000) {
199 pdiv = 1; 204 pdiv = 1;
@@ -219,13 +224,15 @@ static void lpphy_2062_init(struct b43_wldev *dev)
219 break; 224 break;
220 } 225 }
221 } 226 }
222 if (B43_WARN_ON(!fd)) 227 if (!fd)
223 return; 228 fd = &freqdata_tab[ARRAY_SIZE(freqdata_tab) - 1];
229 b43dbg(dev->wl, "b2062: Using crystal tab entry %u kHz.\n",
230 fd->freq); /* FIXME: Keep this printk until the code is fully debugged. */
224 231
225 b43_radio_write(dev, B2062_S_RFPLL_CTL8, 232 b43_radio_write(dev, B2062_S_RFPLL_CTL8,
226 ((u16)(fd->data[1]) << 4) | fd->data[0]); 233 ((u16)(fd->data[1]) << 4) | fd->data[0]);
227 b43_radio_write(dev, B2062_S_RFPLL_CTL9, 234 b43_radio_write(dev, B2062_S_RFPLL_CTL9,
228 ((u16)(fd->data[3]) << 4) | fd->data[2]);//FIXME specs are different 235 ((u16)(fd->data[3]) << 4) | fd->data[2]);
229 b43_radio_write(dev, B2062_S_RFPLL_CTL10, fd->data[4]); 236 b43_radio_write(dev, B2062_S_RFPLL_CTL10, fd->data[4]);
230 b43_radio_write(dev, B2062_S_RFPLL_CTL11, fd->data[5]); 237 b43_radio_write(dev, B2062_S_RFPLL_CTL11, fd->data[5]);
231} 238}