Lines Matching refs:func

94 static void brcmf_sdiod_ib_irqhandler(struct sdio_func *func)  in brcmf_sdiod_ib_irqhandler()  argument
96 struct brcmf_bus *bus_if = dev_get_drvdata(&func->dev); in brcmf_sdiod_ib_irqhandler()
105 static void brcmf_sdiod_dummy_irqhandler(struct sdio_func *func) in brcmf_sdiod_dummy_irqhandler() argument
123 &sdiodev->func[1]->dev); in brcmf_sdiod_intr_register()
141 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
167 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
170 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
171 sdio_claim_irq(sdiodev->func[1], brcmf_sdiod_ib_irqhandler); in brcmf_sdiod_intr_register()
172 sdio_claim_irq(sdiodev->func[2], brcmf_sdiod_dummy_irqhandler); in brcmf_sdiod_intr_register()
173 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_register()
184 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
187 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
196 &sdiodev->func[1]->dev); in brcmf_sdiod_intr_unregister()
200 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
201 sdio_release_irq(sdiodev->func[2]); in brcmf_sdiod_intr_unregister()
202 sdio_release_irq(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
203 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_intr_unregister()
233 static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func, in brcmf_sdiod_f0_writeb() argument
245 sdio_writeb(func, byte, regaddr, &err_ret); in brcmf_sdiod_f0_writeb()
247 sdio_f0_writeb(func, byte, regaddr, &err_ret); in brcmf_sdiod_f0_writeb()
255 struct sdio_func *func; in brcmf_sdiod_request_data() local
264 func = sdiodev->func[fn]; in brcmf_sdiod_request_data()
270 sdio_writeb(func, *(u8 *)data, addr, &ret); in brcmf_sdiod_request_data()
272 ret = brcmf_sdiod_f0_writeb(func, addr, in brcmf_sdiod_request_data()
276 *(u8 *)data = sdio_readb(func, addr, &ret); in brcmf_sdiod_request_data()
278 *(u8 *)data = sdio_f0_readb(func, addr, &ret); in brcmf_sdiod_request_data()
283 sdio_writew(func, *(u16 *)data, addr, &ret); in brcmf_sdiod_request_data()
285 *(u16 *)data = sdio_readw(func, addr, &ret); in brcmf_sdiod_request_data()
289 sdio_writel(func, *(u32 *)data, addr, &ret); in brcmf_sdiod_request_data()
291 *(u32 *)data = sdio_readl(func, addr, &ret); in brcmf_sdiod_request_data()
308 u8 func; in brcmf_sdiod_regrw_helper() local
322 func = SDIO_FUNC_0; in brcmf_sdiod_regrw_helper()
324 func = SDIO_FUNC_1; in brcmf_sdiod_regrw_helper()
332 ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, in brcmf_sdiod_regrw_helper()
347 write ? "write" : "read", func, addr, ret); in brcmf_sdiod_regrw_helper()
350 write ? "write" : "read", func, addr, ret); in brcmf_sdiod_regrw_helper()
480 err = sdio_memcpy_toio(sdiodev->func[fn], addr, in brcmf_sdiod_buffrw()
483 err = sdio_memcpy_fromio(sdiodev->func[fn], ((u8 *)(pkt->data)), in brcmf_sdiod_buffrw()
487 err = sdio_readsb(sdiodev->func[fn], ((u8 *)(pkt->data)), addr, in brcmf_sdiod_buffrw()
532 req_sz = ALIGN(req_sz, sdiodev->func[fn]->cur_blksize); in brcmf_sdiod_sglist_rw()
551 func_blk_sz = sdiodev->func[fn]->cur_blksize; in brcmf_sdiod_sglist_rw()
620 mmc_set_data_timeout(&mmc_dat, sdiodev->func[fn]->card); in brcmf_sdiod_sglist_rw()
621 mmc_wait_for_req(sdiodev->func[fn]->card->host, &mmc_req); in brcmf_sdiod_sglist_rw()
820 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_ramrw()
866 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_ramrw()
939 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_freezer_on()
941 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_freezer_on()
947 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_freezer_off()
949 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_freezer_off()
998 sdio_claim_host(sdiodev->func[2]); in brcmf_sdiod_remove()
999 sdio_disable_func(sdiodev->func[2]); in brcmf_sdiod_remove()
1000 sdio_release_host(sdiodev->func[2]); in brcmf_sdiod_remove()
1003 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_remove()
1004 sdio_disable_func(sdiodev->func[1]); in brcmf_sdiod_remove()
1005 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_remove()
1010 pm_runtime_allow(sdiodev->func[1]->card->host->parent); in brcmf_sdiod_remove()
1016 struct sdio_func *func; in brcmf_sdiod_probe() local
1023 sdio_claim_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1025 ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE); in brcmf_sdiod_probe()
1028 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1031 ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE); in brcmf_sdiod_probe()
1034 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1039 sdiodev->func[2]->enable_timeout = SDIO_WAIT_F2RDY; in brcmf_sdiod_probe()
1042 ret = sdio_enable_func(sdiodev->func[1]); in brcmf_sdiod_probe()
1043 sdio_release_host(sdiodev->func[1]); in brcmf_sdiod_probe()
1054 func = sdiodev->func[2]; in brcmf_sdiod_probe()
1055 host = func->card->host; in brcmf_sdiod_probe()
1059 max_blocks * func->cur_blksize); in brcmf_sdiod_probe()
1111 static int brcmf_ops_sdio_probe(struct sdio_func *func, in brcmf_ops_sdio_probe() argument
1119 brcmf_dbg(SDIO, "Class=%x\n", func->class); in brcmf_ops_sdio_probe()
1120 brcmf_dbg(SDIO, "sdio vendor ID: 0x%04x\n", func->vendor); in brcmf_ops_sdio_probe()
1121 brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); in brcmf_ops_sdio_probe()
1122 brcmf_dbg(SDIO, "Function#: %d\n", func->num); in brcmf_ops_sdio_probe()
1125 if (func->num == 1) in brcmf_ops_sdio_probe()
1129 if (func->num != 2) in brcmf_ops_sdio_probe()
1144 sdiodev->func[0] = kmemdup(func, sizeof(*func), GFP_KERNEL); in brcmf_ops_sdio_probe()
1145 sdiodev->func[0]->num = 0; in brcmf_ops_sdio_probe()
1146 sdiodev->func[1] = func->card->sdio_func[0]; in brcmf_ops_sdio_probe()
1147 sdiodev->func[2] = func; in brcmf_ops_sdio_probe()
1152 dev_set_drvdata(&func->dev, bus_if); in brcmf_ops_sdio_probe()
1153 dev_set_drvdata(&sdiodev->func[1]->dev, bus_if); in brcmf_ops_sdio_probe()
1154 sdiodev->dev = &sdiodev->func[1]->dev; in brcmf_ops_sdio_probe()
1164 if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && in brcmf_ops_sdio_probe()
1165 ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || in brcmf_ops_sdio_probe()
1183 dev_set_drvdata(&func->dev, NULL); in brcmf_ops_sdio_probe()
1184 dev_set_drvdata(&sdiodev->func[1]->dev, NULL); in brcmf_ops_sdio_probe()
1185 kfree(sdiodev->func[0]); in brcmf_ops_sdio_probe()
1191 static void brcmf_ops_sdio_remove(struct sdio_func *func) in brcmf_ops_sdio_remove() argument
1197 brcmf_dbg(SDIO, "sdio vendor ID: 0x%04x\n", func->vendor); in brcmf_ops_sdio_remove()
1198 brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); in brcmf_ops_sdio_remove()
1199 brcmf_dbg(SDIO, "Function: %d\n", func->num); in brcmf_ops_sdio_remove()
1201 if (func->num != 1) in brcmf_ops_sdio_remove()
1204 bus_if = dev_get_drvdata(&func->dev); in brcmf_ops_sdio_remove()
1209 dev_set_drvdata(&sdiodev->func[1]->dev, NULL); in brcmf_ops_sdio_remove()
1210 dev_set_drvdata(&sdiodev->func[2]->dev, NULL); in brcmf_ops_sdio_remove()
1213 kfree(sdiodev->func[0]); in brcmf_ops_sdio_remove()
1232 struct sdio_func *func; in brcmf_ops_sdio_suspend() local
1237 func = container_of(dev, struct sdio_func, dev); in brcmf_ops_sdio_suspend()
1238 brcmf_dbg(SDIO, "Enter: F%d\n", func->num); in brcmf_ops_sdio_suspend()
1239 if (func->num != SDIO_FUNC_1) in brcmf_ops_sdio_suspend()
1255 if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) in brcmf_ops_sdio_suspend()
1265 struct sdio_func *func = container_of(dev, struct sdio_func, dev); in brcmf_ops_sdio_resume() local
1267 brcmf_dbg(SDIO, "Enter: F%d\n", func->num); in brcmf_ops_sdio_resume()
1268 if (func->num != SDIO_FUNC_2) in brcmf_ops_sdio_resume()