aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2012-09-13 15:11:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-24 14:59:08 -0400
commit86761fcbea8a779b0aa2af120173cd4ef7edd72f (patch)
tree95a7178ddae80f961a1b66904f3dbe6eb1b250a3 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parent8514fd02baac42c6f6ef248e70c4bdddd5b66433 (diff)
brcmfmac: remove obsolete sdio bus sleep mechanism
Remove sdio bus sleep mechanism since it is never invoked. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 4580ff34c2d..2ca9e8c179c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -549,7 +549,6 @@ struct brcmf_sdio {
549 s32 idleclock; /* How to set bus driver when idle */ 549 s32 idleclock; /* How to set bus driver when idle */
550 s32 sd_rxchain; 550 s32 sd_rxchain;
551 bool use_rxchain; /* If brcmf should use PKT chains */ 551 bool use_rxchain; /* If brcmf should use PKT chains */
552 bool sleeping; /* Is SDIO bus sleeping? */
553 bool rxflow_mode; /* Rx flow control mode */ 552 bool rxflow_mode; /* Rx flow control mode */
554 bool rxflow; /* Is rx flow control on */ 553 bool rxflow; /* Is rx flow control on */
555 bool alp_only; /* Don't use HT clock (ALP only) */ 554 bool alp_only; /* Don't use HT clock (ALP only) */
@@ -853,81 +852,6 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
853 return 0; 852 return 0;
854} 853}
855 854
856static int brcmf_sdbrcm_bussleep(struct brcmf_sdio *bus, bool sleep)
857{
858 int ret;
859
860 brcmf_dbg(INFO, "request %s (currently %s)\n",
861 sleep ? "SLEEP" : "WAKE",
862 bus->sleeping ? "SLEEP" : "WAKE");
863
864 /* Done if we're already in the requested state */
865 if (sleep == bus->sleeping)
866 return 0;
867
868 /* Going to sleep: set the alarm and turn off the lights... */
869 if (sleep) {
870 /* Don't sleep if something is pending */
871 if (bus->dpc_sched || bus->rxskip || pktq_len(&bus->txq))
872 return -EBUSY;
873
874 /* Make sure the controller has the bus up */
875 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
876
877 /* Tell device to start using OOB wakeup */
878 ret = w_sdreg32(bus, SMB_USE_OOB,
879 offsetof(struct sdpcmd_regs, tosbmailbox));
880 if (ret != 0)
881 brcmf_dbg(ERROR, "CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n");
882
883 /* Turn off our contribution to the HT clock request */
884 brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
885
886 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
887 SBSDIO_FORCE_HW_CLKREQ_OFF, NULL);
888
889 /* Isolate the bus */
890 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
891 SBSDIO_DEVCTL_PADS_ISO, NULL);
892
893 /* Change state */
894 bus->sleeping = true;
895
896 } else {
897 /* Waking up: bus power up is ok, set local state */
898
899 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
900 0, NULL);
901
902 /* Make sure the controller has the bus up */
903 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
904
905 /* Send misc interrupt to indicate OOB not needed */
906 ret = w_sdreg32(bus, 0,
907 offsetof(struct sdpcmd_regs, tosbmailboxdata));
908 if (ret == 0)
909 ret = w_sdreg32(bus, SMB_DEV_INT,
910 offsetof(struct sdpcmd_regs, tosbmailbox));
911
912 if (ret != 0)
913 brcmf_dbg(ERROR, "CANNOT SIGNAL CHIP TO CLEAR OOB!!\n");
914
915 /* Make sure we have SD bus access */
916 brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
917
918 /* Change state */
919 bus->sleeping = false;
920 }
921
922 return 0;
923}
924
925static void bus_wake(struct brcmf_sdio *bus)
926{
927 if (bus->sleeping)
928 brcmf_sdbrcm_bussleep(bus, false);
929}
930
931static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus) 855static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
932{ 856{
933 u32 intstatus = 0; 857 u32 intstatus = 0;
@@ -2267,8 +2191,6 @@ static void brcmf_sdbrcm_bus_stop(struct device *dev)
2267 2191
2268 down(&bus->sdsem); 2192 down(&bus->sdsem);
2269 2193
2270 bus_wake(bus);
2271
2272 /* Enable clock for device interrupts */ 2194 /* Enable clock for device interrupts */
2273 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false); 2195 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
2274 2196
@@ -2404,8 +2326,6 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2404 } 2326 }
2405 } 2327 }
2406 2328
2407 bus_wake(bus);
2408
2409 /* Make sure backplane clock is on */ 2329 /* Make sure backplane clock is on */
2410 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, true); 2330 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, true);
2411 if (bus->clkstate == CLK_PENDING) 2331 if (bus->clkstate == CLK_PENDING)
@@ -2918,8 +2838,6 @@ brcmf_sdbrcm_bus_txctl(struct device *dev, unsigned char *msg, uint msglen)
2918 /* Need to lock here to protect txseq and SDIO tx calls */ 2838 /* Need to lock here to protect txseq and SDIO tx calls */
2919 down(&bus->sdsem); 2839 down(&bus->sdsem);
2920 2840
2921 bus_wake(bus);
2922
2923 /* Make sure backplane clock is on */ 2841 /* Make sure backplane clock is on */
2924 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false); 2842 brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
2925 2843
@@ -3776,12 +3694,6 @@ void brcmf_sdbrcm_isr(void *arg)
3776 bus->sdcnt.intrcount++; 3694 bus->sdcnt.intrcount++;
3777 bus->ipend = true; 3695 bus->ipend = true;
3778 3696
3779 /* Shouldn't get this interrupt if we're sleeping? */
3780 if (bus->sleeping) {
3781 brcmf_dbg(ERROR, "INTERRUPT WHILE SLEEPING??\n");
3782 return;
3783 }
3784
3785 /* Disable additional interrupts (is this needed now)? */ 3697 /* Disable additional interrupts (is this needed now)? */
3786 if (!bus->intr) 3698 if (!bus->intr)
3787 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); 3699 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n");
@@ -3801,10 +3713,6 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
3801 3713
3802 brcmf_dbg(TIMER, "Enter\n"); 3714 brcmf_dbg(TIMER, "Enter\n");
3803 3715
3804 /* Ignore the timer if simulating bus down */
3805 if (bus->sleeping)
3806 return false;
3807
3808 down(&bus->sdsem); 3716 down(&bus->sdsem);
3809 3717
3810 /* Poll period: check device if appropriate. */ 3718 /* Poll period: check device if appropriate. */
@@ -4024,7 +3932,6 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_sdio *bus)
4024 SDIO_FUNC_ENABLE_1, NULL); 3932 SDIO_FUNC_ENABLE_1, NULL);
4025 3933
4026 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 3934 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
4027 bus->sleeping = false;
4028 bus->rxflow = false; 3935 bus->rxflow = false;
4029 3936
4030 /* Done with backplane-dependent accesses, can drop clock... */ 3937 /* Done with backplane-dependent accesses, can drop clock... */