Lines Matching refs:sdiodev
438 struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ member
706 sdio_retune_crc_disable(bus->sdiodev->func1); in brcmf_sdio_kso_control()
710 sdio_retune_hold_now(bus->sdiodev->func1); in brcmf_sdio_kso_control()
714 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); in brcmf_sdio_kso_control()
748 rd_val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, in brcmf_sdio_kso_control()
760 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, in brcmf_sdio_kso_control()
773 sdio_retune_release(bus->sdiodev->func1); in brcmf_sdio_kso_control()
775 sdio_retune_crc_enable(bus->sdiodev->func1); in brcmf_sdio_kso_control()
803 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_htclk()
811 clkctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_htclk()
821 devctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_htclk()
829 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL, in brcmf_sdio_htclk()
837 devctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_htclk()
840 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL, in brcmf_sdio_htclk()
848 clkctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_htclk()
882 devctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_htclk()
885 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_DEVICE_CTL, in brcmf_sdio_htclk()
890 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_htclk()
981 clkcsr = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_bus_sleep()
986 brcmf_sdiod_writeb(bus->sdiodev, in brcmf_sdio_bus_sleep()
1034 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readshared()
1044 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, shaddr, in brcmf_sdio_readshared()
1063 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&sh_le, in brcmf_sdio_readshared()
1068 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readshared()
1090 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readshared()
1109 struct brcmf_sdio_dev *sdiod = bus->sdiodev; in brcmf_sdio_hostmail()
1202 struct brcmf_sdio_dev *sdiod = bus->sdiodev; in brcmf_sdio_rxfail()
1214 brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func2); in brcmf_sdio_rxfail()
1216 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM, in brcmf_sdio_rxfail()
1222 hi = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_RFRAMEBCHI, in brcmf_sdio_rxfail()
1224 lo = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_RFRAMEBCLO, in brcmf_sdio_rxfail()
1259 struct brcmf_sdio_dev *sdiodev = bus->sdiodev; in brcmf_sdio_txfail() local
1266 brcmf_sdiod_abort(sdiodev, sdiodev->func2); in brcmf_sdio_txfail()
1267 brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL); in brcmf_sdio_txfail()
1271 hi = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_WFRAMEBCHI, NULL); in brcmf_sdio_txfail()
1272 lo = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_WFRAMEBCLO, NULL); in brcmf_sdio_txfail()
1622 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1623 errcode = brcmf_sdiod_recv_chain(bus->sdiodev, in brcmf_sdio_rxglom()
1625 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1633 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1637 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1647 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1650 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1665 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1668 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1677 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1681 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_rxglom()
1715 brcmf_rx_event(bus->sdiodev->dev, pfirst); in brcmf_sdio_rxglom()
1717 brcmf_rx_frame(bus->sdiodev->dev, pfirst, in brcmf_sdio_rxglom()
1783 ((len + pad) < bus->sdiodev->bus_if->maxctl)) in brcmf_sdio_read_control()
1790 if ((rdlen + BRCMF_FIRSTREAD) > bus->sdiodev->bus_if->maxctl) { in brcmf_sdio_read_control()
1792 rdlen, bus->sdiodev->bus_if->maxctl); in brcmf_sdio_read_control()
1797 if ((len - doff) > bus->sdiodev->bus_if->maxctl) { in brcmf_sdio_read_control()
1799 len, len - doff, bus->sdiodev->bus_if->maxctl); in brcmf_sdio_read_control()
1806 sdret = brcmf_sdiod_recv_buf(bus->sdiodev, rbuf, rdlen); in brcmf_sdio_read_control()
1871 !bus->rxskip && rxleft && bus->sdiodev->state == BRCMF_SDIOD_DATA; in brcmf_sdio_readframes()
1888 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1890 ret = brcmf_sdiod_recv_buf(bus->sdiodev, in brcmf_sdio_readframes()
1898 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1908 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1924 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1941 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1947 ret = brcmf_sdiod_recv_pkt(bus->sdiodev, pkt); in brcmf_sdio_readframes()
1949 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1955 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1958 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1969 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1974 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1985 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
1989 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
2005 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
2007 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
2030 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
2032 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_readframes()
2049 brcmf_rx_event(bus->sdiodev->dev, pkt); in brcmf_sdio_readframes()
2051 brcmf_rx_frame(bus->sdiodev->dev, pkt, in brcmf_sdio_readframes()
2094 stats = &bus->sdiodev->bus_if->stats; in brcmf_sdio_txpkt_hdalign()
2122 struct brcmf_sdio_dev *sdiodev; in brcmf_sdio_txpkt_prep_sg() local
2129 sdiodev = bus->sdiodev; in brcmf_sdio_txpkt_prep_sg()
2130 blksize = sdiodev->func2->cur_blksize; in brcmf_sdio_txpkt_prep_sg()
2309 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_txpkt()
2310 ret = brcmf_sdiod_send_pkt(bus->sdiodev, pktq); in brcmf_sdio_txpkt()
2316 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_txpkt()
2324 brcmf_proto_bcdc_txcomplete(bus->sdiodev->dev, pkt_next, in brcmf_sdio_txpkt()
2349 bus->sdiodev->txglomsz); in brcmf_sdio_sendfromq()
2372 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_sendfromq()
2373 intstatus = brcmf_sdiod_readl(bus->sdiodev, in brcmf_sdio_sendfromq()
2375 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_sendfromq()
2386 if ((bus->sdiodev->state == BRCMF_SDIOD_DATA) && in brcmf_sdio_sendfromq()
2389 brcmf_proto_bcdc_txflowblock(bus->sdiodev->dev, false); in brcmf_sdio_sendfromq()
2446 ret = brcmf_sdiod_send_buf(bus->sdiodev, frame, len); in brcmf_sdio_tx_ctrlframe()
2468 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_stop() local
2469 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_stop()
2483 if (sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { in brcmf_sdio_bus_stop()
2484 sdio_claim_host(sdiodev->func1); in brcmf_sdio_bus_stop()
2490 brcmf_sdiod_writel(sdiodev, core->base + SD_REG(hostintmask), in brcmf_sdio_bus_stop()
2497 saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_bus_stop()
2503 brcmf_sdiod_writeb(sdiodev, in brcmf_sdio_bus_stop()
2513 sdio_disable_func(sdiodev->func2); in brcmf_sdio_bus_stop()
2516 brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus), in brcmf_sdio_bus_stop()
2519 sdio_release_host(sdiodev->func1); in brcmf_sdio_bus_stop()
2541 struct brcmf_sdio_dev *sdiodev; in brcmf_sdio_clrintr() local
2544 sdiodev = bus->sdiodev; in brcmf_sdio_clrintr()
2545 if (sdiodev->oob_irq_requested) { in brcmf_sdio_clrintr()
2546 spin_lock_irqsave(&sdiodev->irq_en_lock, flags); in brcmf_sdio_clrintr()
2547 if (!sdiodev->irq_en && !atomic_read(&bus->ipend)) { in brcmf_sdio_clrintr()
2548 enable_irq(sdiodev->settings->bus.sdio.oob_irq_nr); in brcmf_sdio_clrintr()
2549 sdiodev->irq_en = true; in brcmf_sdio_clrintr()
2551 spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags); in brcmf_sdio_clrintr()
2564 val = brcmf_sdiod_readl(bus->sdiodev, addr, &ret); in brcmf_sdio_intr_rstatus()
2574 brcmf_sdiod_writel(bus->sdiodev, addr, val, &ret); in brcmf_sdio_intr_rstatus()
2584 struct brcmf_sdio_dev *sdiod = bus->sdiodev; in brcmf_sdio_dpc()
2594 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2602 devctl = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_DEVICE_CTL, in brcmf_sdio_dpc()
2607 clkctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_dpc()
2614 devctl = brcmf_sdiod_readb(bus->sdiodev, in brcmf_sdio_dpc()
2617 brcmf_sdiod_writeb(bus->sdiodev, in brcmf_sdio_dpc()
2657 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2700 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2711 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2723 if ((bus->sdiodev->state != BRCMF_SDIOD_DATA) || (err != 0)) { in brcmf_sdio_dpc()
2727 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2734 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_dpc()
2748 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_gettxq() local
2749 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_gettxq()
2801 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_txdata() local
2802 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_txdata()
2805 if (sdiodev->state != BRCMF_SDIOD_DATA) in brcmf_sdio_bus_txdata()
2868 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, (u8 *)&c->log_le, in brcmf_sdio_readconsole()
2894 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, c->buf, c->bufsize); in brcmf_sdio_readconsole()
2936 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_txctl() local
2937 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_txctl()
2941 if (sdiodev->state != BRCMF_SDIOD_DATA) in brcmf_sdio_bus_txctl()
2955 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_bus_txctl()
2961 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_bus_txctl()
2989 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, in brcmf_sdio_dump_console()
2996 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, in brcmf_sdio_dump_console()
3003 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, in brcmf_sdio_dump_console()
3018 rv = brcmf_sdiod_ramrw(bus->sdiodev, false, console_ptr, (u8 *)conbuf, in brcmf_sdio_dump_console()
3047 error = brcmf_sdiod_ramrw(bus->sdiodev, false, sh->trap_addr, (u8 *)&tr, in brcmf_sdio_trap_info()
3099 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_assert_info()
3101 error = brcmf_sdiod_ramrw(bus->sdiodev, false, in brcmf_sdio_assert_info()
3107 error = brcmf_sdiod_ramrw(bus->sdiodev, false, in brcmf_sdio_assert_info()
3112 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_assert_info()
3176 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_debugfs_sdio_count_read() local
3177 struct brcmf_sdio_count *sdcnt = &sdiodev->bus->sdcnt; in brcmf_debugfs_sdio_count_read()
3216 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_debugfs_create() local
3217 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_debugfs_create()
3250 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_rxctl() local
3251 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_rxctl()
3254 if (sdiodev->state != BRCMF_SDIOD_DATA) in brcmf_sdio_bus_rxctl()
3294 brcmf_sdio_verifymemory(struct brcmf_sdio_dev *sdiodev, u32 ram_addr, in brcmf_sdio_verifymemory() argument
3317 err = brcmf_sdiod_ramrw(sdiodev, false, address, ram_cmp, len); in brcmf_sdio_verifymemory()
3339 brcmf_sdio_verifymemory(struct brcmf_sdio_dev *sdiodev, u32 ram_addr, in brcmf_sdio_verifymemory() argument
3353 err = brcmf_sdiod_ramrw(bus->sdiodev, true, bus->ci->rambase, in brcmf_sdio_download_code_file()
3358 else if (!brcmf_sdio_verifymemory(bus->sdiodev, bus->ci->rambase, in brcmf_sdio_download_code_file()
3374 err = brcmf_sdiod_ramrw(bus->sdiodev, true, address, vars, varsz); in brcmf_sdio_download_nvram()
3378 else if (!brcmf_sdio_verifymemory(bus->sdiodev, address, vars, varsz)) in brcmf_sdio_download_nvram()
3391 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_download_firmware()
3421 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_download_firmware()
3459 val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, &err); in brcmf_sdio_sr_init()
3465 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err); in brcmf_sdio_sr_init()
3472 brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP, in brcmf_sdio_sr_init()
3480 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_sr_init()
3505 val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, &err); in brcmf_sdio_kso_init()
3514 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, in brcmf_sdio_kso_init()
3529 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_preinit() local
3530 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_preinit()
3559 value = sdiodev->settings->bus.sdio.sd_sgentry_align; in brcmf_sdio_bus_preinit()
3570 if (sdiodev->sg_support) { in brcmf_sdio_bus_preinit()
3573 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", in brcmf_sdio_bus_preinit()
3583 brcmf_bus_add_txhdrlen(bus->sdiodev->dev, bus->tx_hdrlen); in brcmf_sdio_bus_preinit()
3592 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_get_ramsize() local
3593 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_get_ramsize()
3602 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_get_memdump() local
3603 struct brcmf_sdio *bus = sdiodev->bus; in brcmf_sdio_bus_get_memdump()
3614 sdio_claim_host(sdiodev->func1); in brcmf_sdio_bus_get_memdump()
3618 err = brcmf_sdiod_ramrw(sdiodev, false, address, data, len); in brcmf_sdio_bus_get_memdump()
3630 sdio_release_host(sdiodev->func1); in brcmf_sdio_bus_get_memdump()
3687 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3688 devpend = brcmf_sdiod_func0_rb(bus->sdiodev, in brcmf_sdio_bus_watchdog()
3690 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3711 if (bus->sdiodev->state == BRCMF_SDIOD_DATA && BRCMF_FWCON_ON() && in brcmf_sdio_bus_watchdog()
3716 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3722 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3735 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3743 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_bus_watchdog()
3766 if (brcmf_sdiod_freezing(bus->sdiodev)) { in brcmf_sdio_dataworker()
3767 brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DOWN); in brcmf_sdio_dataworker()
3768 brcmf_sdiod_try_freeze(bus->sdiodev); in brcmf_sdio_dataworker()
3769 brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA); in brcmf_sdio_dataworker()
3774 brcmf_sdio_drivestrengthinit(struct brcmf_sdio_dev *sdiodev, in brcmf_sdio_drivestrengthinit() argument
3831 brcmf_sdiod_writel(sdiodev, addr, 1, NULL); in brcmf_sdio_drivestrengthinit()
3832 cc_data_temp = brcmf_sdiod_readl(sdiodev, addr, NULL); in brcmf_sdio_drivestrengthinit()
3836 brcmf_sdiod_writel(sdiodev, addr, cc_data_temp, NULL); in brcmf_sdio_drivestrengthinit()
3845 struct brcmf_sdio_dev *sdiodev = ctx; in brcmf_sdio_buscoreprep() local
3851 brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err); in brcmf_sdio_buscoreprep()
3859 clkval = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, NULL); in brcmf_sdio_buscoreprep()
3867 SPINWAIT(((clkval = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_buscoreprep()
3879 brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, clkset, &err); in brcmf_sdio_buscoreprep()
3883 brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_SDIOPULLUP, 0, NULL); in brcmf_sdio_buscoreprep()
3891 struct brcmf_sdio_dev *sdiodev = ctx; in brcmf_sdio_buscore_activate() local
3892 struct brcmf_core *core = sdiodev->bus->sdio_core; in brcmf_sdio_buscore_activate()
3897 brcmf_sdiod_writel(sdiodev, reg_addr, 0xFFFFFFFF, NULL); in brcmf_sdio_buscore_activate()
3901 brcmf_sdiod_ramrw(sdiodev, true, 0, (void *)&rstvec, in brcmf_sdio_buscore_activate()
3907 struct brcmf_sdio_dev *sdiodev = ctx; in brcmf_sdio_buscore_read32() local
3910 val = brcmf_sdiod_readl(sdiodev, addr, NULL); in brcmf_sdio_buscore_read32()
3920 (sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4339 || in brcmf_sdio_buscore_read32()
3921 sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) { in brcmf_sdio_buscore_read32()
3934 struct brcmf_sdio_dev *sdiodev = ctx; in brcmf_sdio_buscore_write32() local
3936 brcmf_sdiod_writel(sdiodev, addr, val, NULL); in brcmf_sdio_buscore_write32()
3949 struct brcmf_sdio_dev *sdiodev; in brcmf_sdio_probe_attach() local
3957 sdiodev = bus->sdiodev; in brcmf_sdio_probe_attach()
3958 sdio_claim_host(sdiodev->func1); in brcmf_sdio_probe_attach()
3960 enum_base = brcmf_chip_enum_base(sdiodev->func1->device); in brcmf_sdio_probe_attach()
3963 brcmf_sdiod_readl(sdiodev, enum_base, NULL)); in brcmf_sdio_probe_attach()
3970 brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, BRCMF_INIT_CLKCTL1, in brcmf_sdio_probe_attach()
3973 clkctl = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, in brcmf_sdio_probe_attach()
3982 bus->ci = brcmf_chip_attach(sdiodev, sdiodev->func1->device, in brcmf_sdio_probe_attach()
3996 sdiodev->cc_core = brcmf_chip_get_core(bus->ci, BCMA_CORE_CHIPCOMMON); in brcmf_sdio_probe_attach()
3997 if (!sdiodev->cc_core) in brcmf_sdio_probe_attach()
4000 sdiodev->settings = brcmf_get_module_param(sdiodev->dev, in brcmf_sdio_probe_attach()
4004 if (!sdiodev->settings) { in brcmf_sdio_probe_attach()
4013 if (sdiodev->settings->bus.sdio.sd_head_align > ALIGNMENT) in brcmf_sdio_probe_attach()
4014 bus->head_align = sdiodev->settings->bus.sdio.sd_head_align; in brcmf_sdio_probe_attach()
4015 if (sdiodev->settings->bus.sdio.sd_sgentry_align > ALIGNMENT) in brcmf_sdio_probe_attach()
4017 sdiodev->settings->bus.sdio.sd_sgentry_align; in brcmf_sdio_probe_attach()
4022 brcmf_sdiod_sgtable_alloc(sdiodev); in brcmf_sdio_probe_attach()
4028 (sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_KEEP_POWER) && in brcmf_sdio_probe_attach()
4029 ((sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_WAKE_SDIO_IRQ) || in brcmf_sdio_probe_attach()
4030 (sdiodev->settings->bus.sdio.oob_irq_supported))) in brcmf_sdio_probe_attach()
4031 sdiodev->bus_if->wowl_supported = true; in brcmf_sdio_probe_attach()
4038 if (sdiodev->settings->bus.sdio.drive_strength) in brcmf_sdio_probe_attach()
4039 drivestrength = sdiodev->settings->bus.sdio.drive_strength; in brcmf_sdio_probe_attach()
4042 brcmf_sdio_drivestrengthinit(sdiodev, bus->ci, drivestrength); in brcmf_sdio_probe_attach()
4045 reg_val = brcmf_sdiod_func0_rb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, &err); in brcmf_sdio_probe_attach()
4051 brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, reg_val, &err); in brcmf_sdio_probe_attach()
4057 reg_val = brcmf_sdiod_readl(sdiodev, reg_addr, &err); in brcmf_sdio_probe_attach()
4063 brcmf_sdiod_writel(sdiodev, reg_addr, reg_val, &err); in brcmf_sdio_probe_attach()
4067 sdio_release_host(sdiodev->func1); in brcmf_sdio_probe_attach()
4088 sdio_release_host(sdiodev->func1); in brcmf_sdio_probe_attach()
4100 brcmf_sdiod_freezer_count(bus->sdiodev); in brcmf_sdio_watchdog_thread()
4104 brcmf_sdiod_freezer_uncount(bus->sdiodev); in brcmf_sdio_watchdog_thread()
4106 brcmf_sdiod_freezer_count(bus->sdiodev); in brcmf_sdio_watchdog_thread()
4107 brcmf_sdiod_try_freeze(bus->sdiodev); in brcmf_sdio_watchdog_thread()
4137 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_get_blob() local
4141 *fw = sdiodev->clm_fw; in brcmf_sdio_get_blob()
4142 sdiodev->clm_fw = NULL; in brcmf_sdio_get_blob()
4157 struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; in brcmf_sdio_bus_reset() local
4162 brcmf_sdiod_intr_unregister(sdiodev); in brcmf_sdio_bus_reset()
4164 brcmf_sdiod_remove(sdiodev); in brcmf_sdio_bus_reset()
4167 sdio_claim_host(sdiodev->func1); in brcmf_sdio_bus_reset()
4168 mmc_hw_reset(sdiodev->func1->card); in brcmf_sdio_bus_reset()
4169 sdio_release_host(sdiodev->func1); in brcmf_sdio_bus_reset()
4171 brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN); in brcmf_sdio_bus_reset()
4372 brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA); in brcmf_sdio_firmware_callback()
4422 { ".bin", bus->sdiodev->fw_name }, in brcmf_sdio_prepare_fw_request()
4423 { ".txt", bus->sdiodev->nvram_name }, in brcmf_sdio_prepare_fw_request()
4424 { ".clm_blob", bus->sdiodev->clm_name }, in brcmf_sdio_prepare_fw_request()
4438 fwreq->board_types[0] = bus->sdiodev->settings->board_type; in brcmf_sdio_prepare_fw_request()
4443 struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) in brcmf_sdio_probe() argument
4457 bus->sdiodev = sdiodev; in brcmf_sdio_probe()
4458 sdiodev->bus = bus; in brcmf_sdio_probe()
4467 dev_name(&sdiodev->func1->dev)); in brcmf_sdio_probe()
4472 brcmf_sdiod_freezer_count(sdiodev); in brcmf_sdio_probe()
4493 dev_name(&sdiodev->func1->dev)); in brcmf_sdio_probe()
4506 bus->blocksize = bus->sdiodev->func2->cur_blksize; in brcmf_sdio_probe()
4509 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_probe()
4512 sdio_disable_func(bus->sdiodev->func2); in brcmf_sdio_probe()
4517 brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL); in brcmf_sdio_probe()
4519 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_probe()
4537 ret = brcmf_fw_get_firmwares(sdiodev->dev, fwreq, in brcmf_sdio_probe()
4566 brcmf_sdiod_intr_unregister(bus->sdiodev); in brcmf_sdio_remove()
4568 brcmf_detach(bus->sdiodev->dev); in brcmf_sdio_remove()
4569 brcmf_free(bus->sdiodev->dev); in brcmf_sdio_remove()
4576 if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { in brcmf_sdio_remove()
4577 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_remove()
4587 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_remove()
4591 if (bus->sdiodev->settings) in brcmf_sdio_remove()
4592 brcmf_release_module_param(bus->sdiodev->settings); in brcmf_sdio_remove()
4594 release_firmware(bus->sdiodev->clm_fw); in brcmf_sdio_remove()
4595 bus->sdiodev->clm_fw = NULL; in brcmf_sdio_remove()
4614 if (bus->sdiodev->state != BRCMF_SDIOD_DATA) in brcmf_sdio_wd_timer()
4636 sdio_claim_host(bus->sdiodev->func1); in brcmf_sdio_sleep()
4638 sdio_release_host(bus->sdiodev->func1); in brcmf_sdio_sleep()