diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-05-10 10:05:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-11 14:50:39 -0400 |
commit | 858a16529cb4c6434d863740283e0dfeb93cd599 (patch) | |
tree | 3b54b21a6f19933667cb2d2734e9b020208f71be /drivers/net | |
parent | a7ffab33203ae0c755b33a80756fe734f732dbb0 (diff) |
b43: move MAC PHY clock controling function
This is not N-PHY specific function, we partially duplicate code.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 13 |
3 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index f7582c096f8..1e6a2add2aa 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2685,6 +2685,17 @@ out: | |||
2685 | dev->mac_suspended++; | 2685 | dev->mac_suspended++; |
2686 | } | 2686 | } |
2687 | 2687 | ||
2688 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */ | ||
2689 | void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on) | ||
2690 | { | ||
2691 | u32 tmslow = ssb_read32(dev->dev, SSB_TMSLOW); | ||
2692 | if (on) | ||
2693 | tmslow |= B43_TMSLOW_MACPHYCLKEN; | ||
2694 | else | ||
2695 | tmslow &= ~B43_TMSLOW_MACPHYCLKEN; | ||
2696 | ssb_write32(dev->dev, SSB_TMSLOW, tmslow); | ||
2697 | } | ||
2698 | |||
2688 | static void b43_adjust_opmode(struct b43_wldev *dev) | 2699 | static void b43_adjust_opmode(struct b43_wldev *dev) |
2689 | { | 2700 | { |
2690 | struct b43_wl *wl = dev->wl; | 2701 | struct b43_wl *wl = dev->wl; |
@@ -2841,7 +2852,7 @@ static int b43_chip_init(struct b43_wldev *dev) | |||
2841 | { | 2852 | { |
2842 | struct b43_phy *phy = &dev->phy; | 2853 | struct b43_phy *phy = &dev->phy; |
2843 | int err; | 2854 | int err; |
2844 | u32 value32, macctl; | 2855 | u32 macctl; |
2845 | u16 value16; | 2856 | u16 value16; |
2846 | 2857 | ||
2847 | /* Initialize the MAC control */ | 2858 | /* Initialize the MAC control */ |
@@ -2919,9 +2930,7 @@ static int b43_chip_init(struct b43_wldev *dev) | |||
2919 | b43_write32(dev, B43_MMIO_DMA4_IRQ_MASK, 0x0000DC00); | 2930 | b43_write32(dev, B43_MMIO_DMA4_IRQ_MASK, 0x0000DC00); |
2920 | b43_write32(dev, B43_MMIO_DMA5_IRQ_MASK, 0x0000DC00); | 2931 | b43_write32(dev, B43_MMIO_DMA5_IRQ_MASK, 0x0000DC00); |
2921 | 2932 | ||
2922 | value32 = ssb_read32(dev->dev, SSB_TMSLOW); | 2933 | b43_mac_phy_clock_set(dev, true); |
2923 | value32 |= 0x00100000; | ||
2924 | ssb_write32(dev->dev, SSB_TMSLOW, value32); | ||
2925 | 2934 | ||
2926 | b43_write16(dev, B43_MMIO_POWERUP_DELAY, | 2935 | b43_write16(dev, B43_MMIO_POWERUP_DELAY, |
2927 | dev->dev->bus->chipco.fast_pwrup_delay); | 2936 | dev->dev->bus->chipco.fast_pwrup_delay); |
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h index 40db03678d9..a0d327f1318 100644 --- a/drivers/net/wireless/b43/main.h +++ b/drivers/net/wireless/b43/main.h | |||
@@ -133,6 +133,7 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags); | |||
133 | 133 | ||
134 | void b43_mac_suspend(struct b43_wldev *dev); | 134 | void b43_mac_suspend(struct b43_wldev *dev); |
135 | void b43_mac_enable(struct b43_wldev *dev); | 135 | void b43_mac_enable(struct b43_wldev *dev); |
136 | void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on); | ||
136 | 137 | ||
137 | 138 | ||
138 | struct b43_request_fw_context; | 139 | struct b43_request_fw_context; |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 6755063f955..b075a3f82a4 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -3540,17 +3540,6 @@ static int b43_nphy_cal_rx_iq(struct b43_wldev *dev, | |||
3540 | return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug); | 3540 | return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug); |
3541 | } | 3541 | } |
3542 | 3542 | ||
3543 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */ | ||
3544 | static void b43_nphy_mac_phy_clock_set(struct b43_wldev *dev, bool on) | ||
3545 | { | ||
3546 | u32 tmslow = ssb_read32(dev->dev, SSB_TMSLOW); | ||
3547 | if (on) | ||
3548 | tmslow |= B43_TMSLOW_MACPHYCLKEN; | ||
3549 | else | ||
3550 | tmslow &= ~B43_TMSLOW_MACPHYCLKEN; | ||
3551 | ssb_write32(dev->dev, SSB_TMSLOW, tmslow); | ||
3552 | } | ||
3553 | |||
3554 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreSetState */ | 3543 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreSetState */ |
3555 | static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask) | 3544 | static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask) |
3556 | { | 3545 | { |
@@ -3691,7 +3680,7 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
3691 | b43_phy_write(dev, B43_NPHY_BBCFG, tmp & ~B43_NPHY_BBCFG_RSTCCA); | 3680 | b43_phy_write(dev, B43_NPHY_BBCFG, tmp & ~B43_NPHY_BBCFG_RSTCCA); |
3692 | b43_nphy_bmac_clock_fgc(dev, 0); | 3681 | b43_nphy_bmac_clock_fgc(dev, 0); |
3693 | 3682 | ||
3694 | b43_nphy_mac_phy_clock_set(dev, true); | 3683 | b43_mac_phy_clock_set(dev, true); |
3695 | 3684 | ||
3696 | b43_nphy_pa_override(dev, false); | 3685 | b43_nphy_pa_override(dev, false); |
3697 | b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX); | 3686 | b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX); |