aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2012-05-04 21:27:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-15 17:27:57 -0400
commit79ae39570f82f96e2d899c100e32409129c6d62f (patch)
tree67c3f164c501c75befb603feba462519cd2e4706 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parent3bba829f63ad776be487005c3a106531a27806f5 (diff)
brcmfmac: replace brcmf_sdcard_reg_read with brcmf_sdio_regrl
Use the newly introduced brcmf_sdio_regrl to replace brcmf_sdcard_reg_read as part of the SDIO WiFi dongle register access interface clean up. 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: 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.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 1e35a3de9595..1e96ebf01295 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -630,19 +630,20 @@ static bool data_ok(struct brcmf_sdio *bus)
630 * adresses on the 32 bit backplane bus. 630 * adresses on the 32 bit backplane bus.
631 */ 631 */
632static void 632static void
633r_sdreg32(struct brcmf_sdio *bus, u32 *regvar, u32 reg_offset, u32 *retryvar) 633r_sdreg32(struct brcmf_sdio *bus, u32 *regvar, u32 offset, u32 *retryvar)
634{ 634{
635 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV); 635 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV);
636 int ret;
636 *retryvar = 0; 637 *retryvar = 0;
637 do { 638 do {
638 *regvar = brcmf_sdcard_reg_read(bus->sdiodev, 639 *regvar = brcmf_sdio_regrl(bus->sdiodev,
639 bus->ci->c_inf[idx].base + reg_offset); 640 bus->ci->c_inf[idx].base + offset,
640 } while (brcmf_sdcard_regfail(bus->sdiodev) && 641 &ret);
641 (++(*retryvar) <= retry_limit)); 642 } while ((ret != 0) && (++(*retryvar) <= retry_limit));
642 if (*retryvar) { 643 if (*retryvar) {
643 bus->regfails += (*retryvar-1); 644 bus->regfails += (*retryvar-1);
644 if (*retryvar > retry_limit) { 645 if (*retryvar > retry_limit) {
645 brcmf_dbg(ERROR, "FAILED READ %Xh\n", reg_offset); 646 brcmf_dbg(ERROR, "FAILED READ %Xh\n", offset);
646 *regvar = 0; 647 *regvar = 0;
647 } 648 }
648 } 649 }
@@ -3705,12 +3706,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
3705 3706
3706 bus->alp_only = true; 3707 bus->alp_only = true;
3707 3708
3708 /* Return the window to backplane enumeration space for core access */
3709 if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, SI_ENUM_BASE))
3710 brcmf_dbg(ERROR, "FAILED to return to SI_ENUM_BASE\n");
3711
3712 pr_debug("F1 signature read @0x18000000=0x%4x\n", 3709 pr_debug("F1 signature read @0x18000000=0x%4x\n",
3713 brcmf_sdcard_reg_read(bus->sdiodev, SI_ENUM_BASE)); 3710 brcmf_sdio_regrl(bus->sdiodev, SI_ENUM_BASE, NULL));
3714 3711
3715 /* 3712 /*
3716 * Force PLL off until brcmf_sdio_chip_attach() 3713 * Force PLL off until brcmf_sdio_chip_attach()
@@ -3753,7 +3750,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
3753 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV); 3750 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV);
3754 reg_addr = bus->ci->c_inf[idx].base + 3751 reg_addr = bus->ci->c_inf[idx].base +
3755 offsetof(struct sdpcmd_regs, corecontrol); 3752 offsetof(struct sdpcmd_regs, corecontrol);
3756 reg_val = brcmf_sdcard_reg_read(bus->sdiodev, reg_addr); 3753 reg_val = brcmf_sdio_regrl(bus->sdiodev, reg_addr, NULL);
3757 brcmf_sdcard_reg_write(bus->sdiodev, reg_addr, reg_val | CC_BPRESEN); 3754 brcmf_sdcard_reg_write(bus->sdiodev, reg_addr, reg_val | CC_BPRESEN);
3758 3755
3759 brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN); 3756 brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);