Lines Matching refs:func

95 static void brcmf_sdiod_ib_irqhandler(struct sdio_func *func)  in brcmf_sdiod_ib_irqhandler()  argument
97 struct brcmf_bus *bus_if = dev_get_drvdata(&func->dev); in brcmf_sdiod_ib_irqhandler()
106 static void brcmf_sdiod_dummy_irqhandler(struct sdio_func *func) in brcmf_sdiod_dummy_irqhandler() argument
124 &sdiodev->func[1]->dev); in brcmf_sdiod_intr_register()
142 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
168 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
171 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
172 sdio_claim_irq(sdiodev->func[1], brcmf_sdiod_ib_irqhandler); in brcmf_sdiod_intr_register()
173 sdio_claim_irq(sdiodev->func[2], brcmf_sdiod_dummy_irqhandler); in brcmf_sdiod_intr_register()
174 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
185 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
188 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
197 &sdiodev->func[1]->dev); in brcmf_sdiod_intr_unregister()
201 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
202 sdio_release_irq(sdiodev->func[2]); in brcmf_sdiod_intr_unregister()
203 sdio_release_irq(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
204 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
234 static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func, in brcmf_sdiod_f0_writeb() argument
246 sdio_writeb(func, byte, regaddr, &err_ret); in brcmf_sdiod_f0_writeb()
248 sdio_f0_writeb(func, byte, regaddr, &err_ret); in brcmf_sdiod_f0_writeb()
256 struct sdio_func *func; in brcmf_sdiod_request_data() local
265 func = sdiodev->func[fn]; in brcmf_sdiod_request_data()
271 sdio_writeb(func, *(u8 *)data, addr, &ret); in brcmf_sdiod_request_data()
273 ret = brcmf_sdiod_f0_writeb(func, addr, in brcmf_sdiod_request_data()
277 *(u8 *)data = sdio_readb(func, addr, &ret); in brcmf_sdiod_request_data()
279 *(u8 *)data = sdio_f0_readb(func, addr, &ret); in brcmf_sdiod_request_data()
284 sdio_writew(func, *(u16 *)data, addr, &ret); in brcmf_sdiod_request_data()
286 *(u16 *)data = sdio_readw(func, addr, &ret); in brcmf_sdiod_request_data()
290 sdio_writel(func, *(u32 *)data, addr, &ret); in brcmf_sdiod_request_data()
292 *(u32 *)data = sdio_readl(func, addr, &ret); in brcmf_sdiod_request_data()
309 u8 func; in brcmf_sdiod_regrw_helper() local
323 func = SDIO_FUNC_0; in brcmf_sdiod_regrw_helper()
325 func = SDIO_FUNC_1; in brcmf_sdiod_regrw_helper()
333 ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, in brcmf_sdiod_regrw_helper()
348 write ? "write" : "read", func, addr, ret); in brcmf_sdiod_regrw_helper()
351 write ? "write" : "read", func, addr, ret); in brcmf_sdiod_regrw_helper()
481 err = sdio_memcpy_toio(sdiodev->func[fn], addr, in brcmf_sdiod_buffrw()
484 err = sdio_memcpy_fromio(sdiodev->func[fn], ((u8 *)(pkt->data)), in brcmf_sdiod_buffrw()
488 err = sdio_readsb(sdiodev->func[fn], ((u8 *)(pkt->data)), addr, in brcmf_sdiod_buffrw()
533 req_sz = ALIGN(req_sz, sdiodev->func[fn]->cur_blksize); in brcmf_sdiod_sglist_rw()
552 func_blk_sz = sdiodev->func[fn]->cur_blksize; in brcmf_sdiod_sglist_rw()
621 mmc_set_data_timeout(&mmc_dat, sdiodev->func[fn]->card); in brcmf_sdiod_sglist_rw()
622 mmc_wait_for_req(sdiodev->func[fn]->card->host, &mmc_req); in brcmf_sdiod_sglist_rw()
821 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_ramrw()
867 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_ramrw()
940 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_freezer_on()
942 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_freezer_on()
948 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_freezer_off()
950 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_freezer_off()
1000 sdio_claim_host(sdiodev->func[2]); in brcmf_sdiod_remove()
1001 sdio_disable_func(sdiodev->func[2]); in brcmf_sdiod_remove()
1002 sdio_release_host(sdiodev->func[2]); in brcmf_sdiod_remove()
1005 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_remove()
1006 sdio_disable_func(sdiodev->func[1]); in brcmf_sdiod_remove()
1007 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_remove()
1012 pm_runtime_allow(sdiodev->func[1]->card->host->parent); in brcmf_sdiod_remove()
1026 struct sdio_func *func; in brcmf_sdiod_probe() local
1033 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1035 ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE); in brcmf_sdiod_probe()
1038 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1041 ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE); in brcmf_sdiod_probe()
1044 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1049 sdiodev->func[2]->enable_timeout = SDIO_WAIT_F2RDY; in brcmf_sdiod_probe()
1052 ret = sdio_enable_func(sdiodev->func[1]); in brcmf_sdiod_probe()
1053 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1064 func = sdiodev->func[2]; in brcmf_sdiod_probe()
1065 host = func->card->host; in brcmf_sdiod_probe()
1069 max_blocks * func->cur_blksize); in brcmf_sdiod_probe()
1133 static int brcmf_ops_sdio_probe(struct sdio_func *func, in brcmf_ops_sdio_probe() argument
1142 brcmf_dbg(SDIO, "Class=%x\n", func->class); in brcmf_ops_sdio_probe()
1143 brcmf_dbg(SDIO, "sdio vendor ID: 0x%04x\n", func->vendor); in brcmf_ops_sdio_probe()
1144 brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); in brcmf_ops_sdio_probe()
1145 brcmf_dbg(SDIO, "Function#: %d\n", func->num); in brcmf_ops_sdio_probe()
1147 dev = &func->dev; in brcmf_ops_sdio_probe()
1152 if (func->num == 1) in brcmf_ops_sdio_probe()
1156 if (func->num != 2) in brcmf_ops_sdio_probe()
1171 sdiodev->func[0] = kmemdup(func, sizeof(*func), GFP_KERNEL); in brcmf_ops_sdio_probe()
1172 sdiodev->func[0]->num = 0; in brcmf_ops_sdio_probe()
1173 sdiodev->func[1] = func->card->sdio_func[0]; in brcmf_ops_sdio_probe()
1174 sdiodev->func[2] = func; in brcmf_ops_sdio_probe()
1179 dev_set_drvdata(&func->dev, bus_if); in brcmf_ops_sdio_probe()
1180 dev_set_drvdata(&sdiodev->func[1]->dev, bus_if); in brcmf_ops_sdio_probe()
1181 sdiodev->dev = &sdiodev->func[1]->dev; in brcmf_ops_sdio_probe()
1191 if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && in brcmf_ops_sdio_probe()
1192 ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || in brcmf_ops_sdio_probe()
1210 dev_set_drvdata(&func->dev, NULL); in brcmf_ops_sdio_probe()
1211 dev_set_drvdata(&sdiodev->func[1]->dev, NULL); in brcmf_ops_sdio_probe()
1212 kfree(sdiodev->func[0]); in brcmf_ops_sdio_probe()
1218 static void brcmf_ops_sdio_remove(struct sdio_func *func) in brcmf_ops_sdio_remove() argument
1224 brcmf_dbg(SDIO, "sdio vendor ID: 0x%04x\n", func->vendor); in brcmf_ops_sdio_remove()
1225 brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); in brcmf_ops_sdio_remove()
1226 brcmf_dbg(SDIO, "Function: %d\n", func->num); in brcmf_ops_sdio_remove()
1228 if (func->num != 1) in brcmf_ops_sdio_remove()
1231 bus_if = dev_get_drvdata(&func->dev); in brcmf_ops_sdio_remove()
1236 dev_set_drvdata(&sdiodev->func[1]->dev, NULL); in brcmf_ops_sdio_remove()
1237 dev_set_drvdata(&sdiodev->func[2]->dev, NULL); in brcmf_ops_sdio_remove()
1240 kfree(sdiodev->func[0]); in brcmf_ops_sdio_remove()
1259 struct sdio_func *func; in brcmf_ops_sdio_suspend() local
1264 func = container_of(dev, struct sdio_func, dev); in brcmf_ops_sdio_suspend()
1265 brcmf_dbg(SDIO, "Enter: F%d\n", func->num); in brcmf_ops_sdio_suspend()
1266 if (func->num != SDIO_FUNC_1) in brcmf_ops_sdio_suspend()
1283 if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) in brcmf_ops_sdio_suspend()
1292 struct sdio_func *func = container_of(dev, struct sdio_func, dev); in brcmf_ops_sdio_resume() local
1294 brcmf_dbg(SDIO, "Enter: F%d\n", func->num); in brcmf_ops_sdio_resume()
1295 if (func->num != SDIO_FUNC_2) in brcmf_ops_sdio_resume()