diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-12-12 18:15:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:48:23 -0500 |
commit | e3d5af56e1a50c9bc3c24810e6b25df91d37bc77 (patch) | |
tree | 2cfbe8c51f2175b7410e84020e636f5a6e167945 /drivers/net/wireless | |
parent | 937642f55ef7f8b9dcb202754d53853c7b36e15f (diff) |
brcm80211: smac: remove ai_switch_core() function
The function ai_switch_core() is no longer needed and its counterpart
ai_restore_core() as well, because interrupts disabling is not needed
anymore.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/pmu.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/pmu.h | 2 |
5 files changed, 7 insertions, 69 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index 86e33f953770..a99a1633cc10 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | |||
@@ -321,20 +321,6 @@ | |||
321 | #define IS_SIM(chippkg) \ | 321 | #define IS_SIM(chippkg) \ |
322 | ((chippkg == HDLSIM_PKG_ID) || (chippkg == HWSIM_PKG_ID)) | 322 | ((chippkg == HDLSIM_PKG_ID) || (chippkg == HWSIM_PKG_ID)) |
323 | 323 | ||
324 | /* | ||
325 | * Macros to disable/restore function core(D11, ENET, ILINE20, etc) interrupts | ||
326 | * before after core switching to avoid invalid register accesss inside ISR. | ||
327 | */ | ||
328 | #define INTR_OFF(si, intr_val) \ | ||
329 | if ((si)->intrsoff_fn && \ | ||
330 | (si)->coreid[(si)->curidx] == (si)->dev_coreid) \ | ||
331 | intr_val = (*(si)->intrsoff_fn)((si)->intr_arg) | ||
332 | |||
333 | #define INTR_RESTORE(si, intr_val) \ | ||
334 | if ((si)->intrsrestore_fn && \ | ||
335 | (si)->coreid[(si)->curidx] == (si)->dev_coreid) \ | ||
336 | (*(si)->intrsrestore_fn)((si)->intr_arg, intr_val) | ||
337 | |||
338 | #define PCI(sih) (ai_get_buscoretype(sih) == PCI_CORE_ID) | 324 | #define PCI(sih) (ai_get_buscoretype(sih) == PCI_CORE_ID) |
339 | #define PCIE(sih) (ai_get_buscoretype(sih) == PCIE_CORE_ID) | 325 | #define PCIE(sih) (ai_get_buscoretype(sih) == PCIE_CORE_ID) |
340 | 326 | ||
@@ -872,32 +858,6 @@ void __iomem *ai_setcore(struct si_pub *sih, uint coreid, uint coreunit) | |||
872 | return ai_setcoreidx(sih, core->core_index); | 858 | return ai_setcoreidx(sih, core->core_index); |
873 | } | 859 | } |
874 | 860 | ||
875 | /* Turn off interrupt as required by ai_setcore, before switch core */ | ||
876 | void __iomem *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx, | ||
877 | uint *intr_val) | ||
878 | { | ||
879 | void __iomem *cc; | ||
880 | struct si_info *sii; | ||
881 | |||
882 | sii = (struct si_info *)sih; | ||
883 | |||
884 | INTR_OFF(sii, *intr_val); | ||
885 | *origidx = sii->curidx; | ||
886 | cc = ai_setcore(sih, coreid, 0); | ||
887 | return cc; | ||
888 | } | ||
889 | |||
890 | /* restore coreidx and restore interrupt */ | ||
891 | void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val) | ||
892 | { | ||
893 | struct si_info *sii; | ||
894 | |||
895 | sii = (struct si_info *)sih; | ||
896 | |||
897 | ai_setcoreidx(sih, coreid); | ||
898 | INTR_RESTORE(sii, intr_val); | ||
899 | } | ||
900 | |||
901 | /* | 861 | /* |
902 | * Switch to 'coreidx', issue a single arbitrary 32bit register mask&set | 862 | * Switch to 'coreidx', issue a single arbitrary 32bit register mask&set |
903 | * operation, switch back to the original core, and return the new value. | 863 | * operation, switch back to the original core, and return the new value. |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h index 8c513456643f..e37c9f4d843d 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | |||
@@ -234,9 +234,6 @@ extern uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val); | |||
234 | extern uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit); | 234 | extern uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit); |
235 | extern void __iomem *ai_setcoreidx(struct si_pub *sih, uint coreidx); | 235 | extern void __iomem *ai_setcoreidx(struct si_pub *sih, uint coreidx); |
236 | extern void __iomem *ai_setcore(struct si_pub *sih, uint coreid, uint coreunit); | 236 | extern void __iomem *ai_setcore(struct si_pub *sih, uint coreid, uint coreunit); |
237 | extern void __iomem *ai_switch_core(struct si_pub *sih, uint coreid, | ||
238 | uint *origidx, uint *intr_val); | ||
239 | extern void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val); | ||
240 | extern void ai_pci_setup(struct si_pub *sih, uint coremask); | 237 | extern void ai_pci_setup(struct si_pub *sih, uint coremask); |
241 | extern void ai_clkctl_init(struct si_pub *sih); | 238 | extern void ai_clkctl_init(struct si_pub *sih); |
242 | extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih); | 239 | extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih); |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c index e0237e497600..a16f1ab292fd 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | |||
@@ -19447,7 +19447,6 @@ void wlc_phy_init_nphy(struct brcms_phy *pi) | |||
19447 | u8 tx_pwr_ctrl_state; | 19447 | u8 tx_pwr_ctrl_state; |
19448 | bool do_nphy_cal = false; | 19448 | bool do_nphy_cal = false; |
19449 | uint core; | 19449 | uint core; |
19450 | uint origidx, intr_val; | ||
19451 | u32 d11_clk_ctl_st; | 19450 | u32 d11_clk_ctl_st; |
19452 | bool do_rssi_cal = false; | 19451 | bool do_rssi_cal = false; |
19453 | 19452 | ||
@@ -19469,8 +19468,6 @@ void wlc_phy_init_nphy(struct brcms_phy *pi) | |||
19469 | if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) && | 19468 | if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) && |
19470 | CHSPEC_IS40(pi->radio_chanspec)) { | 19469 | CHSPEC_IS40(pi->radio_chanspec)) { |
19471 | 19470 | ||
19472 | ai_switch_core(pi->sh->sih, D11_CORE_ID, &origidx, &intr_val); | ||
19473 | |||
19474 | d11_clk_ctl_st = bcma_read32(pi->d11core, | 19471 | d11_clk_ctl_st = bcma_read32(pi->d11core, |
19475 | D11REGOFFS(clk_ctl_st)); | 19472 | D11REGOFFS(clk_ctl_st)); |
19476 | bcma_mask32(pi->d11core, D11REGOFFS(clk_ctl_st), | 19473 | bcma_mask32(pi->d11core, D11REGOFFS(clk_ctl_st), |
@@ -19478,8 +19475,6 @@ void wlc_phy_init_nphy(struct brcms_phy *pi) | |||
19478 | 19475 | ||
19479 | bcma_write32(pi->d11core, D11REGOFFS(clk_ctl_st), | 19476 | bcma_write32(pi->d11core, D11REGOFFS(clk_ctl_st), |
19480 | d11_clk_ctl_st); | 19477 | d11_clk_ctl_st); |
19481 | |||
19482 | ai_restore_core(pi->sh->sih, origidx, intr_val); | ||
19483 | } | 19478 | } |
19484 | 19479 | ||
19485 | pi->use_int_tx_iqlo_cal_nphy = | 19480 | pi->use_int_tx_iqlo_cal_nphy = |
@@ -21342,7 +21337,7 @@ wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec, | |||
21342 | spuravoid = 1; | 21337 | spuravoid = 1; |
21343 | 21338 | ||
21344 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false); | 21339 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false); |
21345 | si_pmu_spuravoid(pi->sh->sih, spuravoid); | 21340 | si_pmu_spuravoid_pllupdate(pi->sh->sih, spuravoid); |
21346 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); | 21341 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); |
21347 | 21342 | ||
21348 | if ((pi->sh->chip == BCM43224_CHIP_ID) || | 21343 | if ((pi->sh->chip == BCM43224_CHIP_ID) || |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.c b/drivers/net/wireless/brcm80211/brcmsmac/pmu.c index d972e9c8d2df..4931d29d077b 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.c | |||
@@ -139,11 +139,13 @@ static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax) | |||
139 | *pmax = max_mask; | 139 | *pmax = max_mask; |
140 | } | 140 | } |
141 | 141 | ||
142 | static void | 142 | void si_pmu_spuravoid_pllupdate(struct si_pub *sih, u8 spuravoid) |
143 | si_pmu_spuravoid_pllupdate(struct si_pub *sih, struct bcma_device *core, | ||
144 | u8 spuravoid) | ||
145 | { | 143 | { |
146 | u32 tmp = 0; | 144 | u32 tmp = 0; |
145 | struct bcma_device *core; | ||
146 | |||
147 | /* switch to chipc */ | ||
148 | core = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0); | ||
147 | 149 | ||
148 | switch (ai_get_chip_id(sih)) { | 150 | switch (ai_get_chip_id(sih)) { |
149 | case BCM43224_CHIP_ID: | 151 | case BCM43224_CHIP_ID: |
@@ -281,22 +283,6 @@ u32 si_pmu_alp_clock(struct si_pub *sih) | |||
281 | return clock; | 283 | return clock; |
282 | } | 284 | } |
283 | 285 | ||
284 | void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid) | ||
285 | { | ||
286 | struct bcma_device *cc; | ||
287 | uint origidx, intr_val; | ||
288 | |||
289 | /* switch to chipc */ | ||
290 | cc = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0); | ||
291 | ai_switch_core(sih, CC_CORE_ID, &origidx, &intr_val); | ||
292 | |||
293 | /* update the pll changes */ | ||
294 | si_pmu_spuravoid_pllupdate(sih, cc, spuravoid); | ||
295 | |||
296 | /* Return to original core */ | ||
297 | ai_restore_core(sih, origidx, intr_val); | ||
298 | } | ||
299 | |||
300 | /* initialize PMU */ | 286 | /* initialize PMU */ |
301 | void si_pmu_init(struct si_pub *sih) | 287 | void si_pmu_init(struct si_pub *sih) |
302 | { | 288 | { |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h index dcd893c68f9a..3e39c5e0f9ff 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h | |||
@@ -26,7 +26,7 @@ extern u32 si_pmu_chipcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val); | |||
26 | extern u32 si_pmu_regcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val); | 26 | extern u32 si_pmu_regcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val); |
27 | extern u32 si_pmu_alp_clock(struct si_pub *sih); | 27 | extern u32 si_pmu_alp_clock(struct si_pub *sih); |
28 | extern void si_pmu_pllupd(struct si_pub *sih); | 28 | extern void si_pmu_pllupd(struct si_pub *sih); |
29 | extern void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid); | 29 | extern void si_pmu_spuravoid_pllupdate(struct si_pub *sih, u8 spuravoid); |
30 | extern u32 si_pmu_pllcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val); | 30 | extern u32 si_pmu_pllcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val); |
31 | extern void si_pmu_init(struct si_pub *sih); | 31 | extern void si_pmu_init(struct si_pub *sih); |
32 | extern void si_pmu_res_init(struct si_pub *sih); | 32 | extern void si_pmu_res_init(struct si_pub *sih); |