Lines Matching refs:cmd

60 static int wilc_sdio_cmd52(struct wilc *wilc, struct sdio_cmd52 *cmd)  in wilc_sdio_cmd52()  argument
68 func->num = cmd->function; in wilc_sdio_cmd52()
69 if (cmd->read_write) { /* write */ in wilc_sdio_cmd52()
70 if (cmd->raw) { in wilc_sdio_cmd52()
71 sdio_writeb(func, cmd->data, cmd->address, &ret); in wilc_sdio_cmd52()
72 data = sdio_readb(func, cmd->address, &ret); in wilc_sdio_cmd52()
73 cmd->data = data; in wilc_sdio_cmd52()
75 sdio_writeb(func, cmd->data, cmd->address, &ret); in wilc_sdio_cmd52()
78 data = sdio_readb(func, cmd->address, &ret); in wilc_sdio_cmd52()
79 cmd->data = data; in wilc_sdio_cmd52()
89 static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd) in wilc_sdio_cmd53() argument
96 func->num = cmd->function; in wilc_sdio_cmd53()
97 func->cur_blksize = cmd->block_size; in wilc_sdio_cmd53()
98 if (cmd->block_mode) in wilc_sdio_cmd53()
99 size = cmd->count * cmd->block_size; in wilc_sdio_cmd53()
101 size = cmd->count; in wilc_sdio_cmd53()
103 if (cmd->read_write) { /* write */ in wilc_sdio_cmd53()
104 ret = sdio_memcpy_toio(func, cmd->address, in wilc_sdio_cmd53()
105 (void *)cmd->buffer, size); in wilc_sdio_cmd53()
107 ret = sdio_memcpy_fromio(func, (void *)cmd->buffer, in wilc_sdio_cmd53()
108 cmd->address, size); in wilc_sdio_cmd53()
177 struct sdio_cmd52 cmd; in wilc_sdio_reset() local
181 cmd.read_write = 1; in wilc_sdio_reset()
182 cmd.function = 0; in wilc_sdio_reset()
183 cmd.raw = 0; in wilc_sdio_reset()
184 cmd.address = SDIO_CCCR_ABORT; in wilc_sdio_reset()
185 cmd.data = WILC_SDIO_CCCR_ABORT_RESET; in wilc_sdio_reset()
186 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_reset()
258 struct sdio_cmd52 cmd; in wilc_sdio_set_func0_csa_address() local
264 cmd.read_write = 1; in wilc_sdio_set_func0_csa_address()
265 cmd.function = 0; in wilc_sdio_set_func0_csa_address()
266 cmd.raw = 0; in wilc_sdio_set_func0_csa_address()
267 cmd.address = WILC_SDIO_FBR_CSA_REG; in wilc_sdio_set_func0_csa_address()
268 cmd.data = (u8)adr; in wilc_sdio_set_func0_csa_address()
269 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
272 cmd.address); in wilc_sdio_set_func0_csa_address()
276 cmd.address = WILC_SDIO_FBR_CSA_REG + 1; in wilc_sdio_set_func0_csa_address()
277 cmd.data = (u8)(adr >> 8); in wilc_sdio_set_func0_csa_address()
278 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
281 cmd.address); in wilc_sdio_set_func0_csa_address()
285 cmd.address = WILC_SDIO_FBR_CSA_REG + 2; in wilc_sdio_set_func0_csa_address()
286 cmd.data = (u8)(adr >> 16); in wilc_sdio_set_func0_csa_address()
287 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
290 cmd.address); in wilc_sdio_set_func0_csa_address()
301 struct sdio_cmd52 cmd; in wilc_sdio_set_block_size() local
304 cmd.read_write = 1; in wilc_sdio_set_block_size()
305 cmd.function = 0; in wilc_sdio_set_block_size()
306 cmd.raw = 0; in wilc_sdio_set_block_size()
307 cmd.address = SDIO_FBR_BASE(func_num) + SDIO_CCCR_BLKSIZE; in wilc_sdio_set_block_size()
308 cmd.data = (u8)block_size; in wilc_sdio_set_block_size()
309 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_block_size()
312 cmd.address); in wilc_sdio_set_block_size()
316 cmd.address = SDIO_FBR_BASE(func_num) + SDIO_CCCR_BLKSIZE + 1; in wilc_sdio_set_block_size()
317 cmd.data = (u8)(block_size >> 8); in wilc_sdio_set_block_size()
318 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_block_size()
321 cmd.address); in wilc_sdio_set_block_size()
342 struct sdio_cmd52 cmd; in wilc_sdio_write_reg() local
344 cmd.read_write = 1; in wilc_sdio_write_reg()
345 cmd.function = 0; in wilc_sdio_write_reg()
346 cmd.raw = 0; in wilc_sdio_write_reg()
347 cmd.address = addr; in wilc_sdio_write_reg()
348 cmd.data = data; in wilc_sdio_write_reg()
349 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_write_reg()
354 struct sdio_cmd53 cmd; in wilc_sdio_write_reg() local
363 cmd.read_write = 1; in wilc_sdio_write_reg()
364 cmd.function = 0; in wilc_sdio_write_reg()
365 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_write_reg()
366 cmd.block_mode = 0; in wilc_sdio_write_reg()
367 cmd.increment = 1; in wilc_sdio_write_reg()
368 cmd.count = 4; in wilc_sdio_write_reg()
369 cmd.buffer = (u8 *)&data; in wilc_sdio_write_reg()
370 cmd.block_size = sdio_priv->block_size; in wilc_sdio_write_reg()
371 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write_reg()
385 struct sdio_cmd53 cmd; in wilc_sdio_write() local
388 cmd.read_write = 1; in wilc_sdio_write()
393 cmd.function = 0; in wilc_sdio_write()
394 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_write()
399 cmd.function = 1; in wilc_sdio_write()
400 cmd.address = WILC_SDIO_F1_DATA_REG; in wilc_sdio_write()
408 cmd.block_mode = 1; in wilc_sdio_write()
409 cmd.increment = 1; in wilc_sdio_write()
410 cmd.count = nblk; in wilc_sdio_write()
411 cmd.buffer = buf; in wilc_sdio_write()
412 cmd.block_size = block_size; in wilc_sdio_write()
418 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write()
430 cmd.block_mode = 0; in wilc_sdio_write()
431 cmd.increment = 1; in wilc_sdio_write()
432 cmd.count = nleft; in wilc_sdio_write()
433 cmd.buffer = buf; in wilc_sdio_write()
435 cmd.block_size = block_size; in wilc_sdio_write()
442 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write()
460 struct sdio_cmd52 cmd; in wilc_sdio_read_reg() local
462 cmd.read_write = 0; in wilc_sdio_read_reg()
463 cmd.function = 0; in wilc_sdio_read_reg()
464 cmd.raw = 0; in wilc_sdio_read_reg()
465 cmd.address = addr; in wilc_sdio_read_reg()
466 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_reg()
472 *data = cmd.data; in wilc_sdio_read_reg()
474 struct sdio_cmd53 cmd; in wilc_sdio_read_reg() local
480 cmd.read_write = 0; in wilc_sdio_read_reg()
481 cmd.function = 0; in wilc_sdio_read_reg()
482 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_read_reg()
483 cmd.block_mode = 0; in wilc_sdio_read_reg()
484 cmd.increment = 1; in wilc_sdio_read_reg()
485 cmd.count = 4; in wilc_sdio_read_reg()
486 cmd.buffer = (u8 *)data; in wilc_sdio_read_reg()
488 cmd.block_size = sdio_priv->block_size; in wilc_sdio_read_reg()
489 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read_reg()
506 struct sdio_cmd53 cmd; in wilc_sdio_read() local
509 cmd.read_write = 0; in wilc_sdio_read()
514 cmd.function = 0; in wilc_sdio_read()
515 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_read()
520 cmd.function = 1; in wilc_sdio_read()
521 cmd.address = WILC_SDIO_F1_DATA_REG; in wilc_sdio_read()
529 cmd.block_mode = 1; in wilc_sdio_read()
530 cmd.increment = 1; in wilc_sdio_read()
531 cmd.count = nblk; in wilc_sdio_read()
532 cmd.buffer = buf; in wilc_sdio_read()
533 cmd.block_size = block_size; in wilc_sdio_read()
539 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read()
551 cmd.block_mode = 0; in wilc_sdio_read()
552 cmd.increment = 1; in wilc_sdio_read()
553 cmd.count = nleft; in wilc_sdio_read()
554 cmd.buffer = buf; in wilc_sdio_read()
556 cmd.block_size = block_size; in wilc_sdio_read()
563 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read()
589 struct sdio_cmd52 cmd; in wilc_sdio_init() local
596 cmd.read_write = 1; in wilc_sdio_init()
597 cmd.function = 0; in wilc_sdio_init()
598 cmd.raw = 1; in wilc_sdio_init()
599 cmd.address = SDIO_FBR_BASE(func->num); in wilc_sdio_init()
600 cmd.data = SDIO_FBR_ENABLE_CSA; in wilc_sdio_init()
601 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
620 cmd.read_write = 1; in wilc_sdio_init()
621 cmd.function = 0; in wilc_sdio_init()
622 cmd.raw = 1; in wilc_sdio_init()
623 cmd.address = SDIO_CCCR_IOEx; in wilc_sdio_init()
624 cmd.data = WILC_SDIO_CCCR_IO_EN_FUNC1; in wilc_sdio_init()
625 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
635 cmd.read_write = 0; in wilc_sdio_init()
636 cmd.function = 0; in wilc_sdio_init()
637 cmd.raw = 0; in wilc_sdio_init()
638 cmd.address = SDIO_CCCR_IORx; in wilc_sdio_init()
641 cmd.data = 0; in wilc_sdio_init()
642 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
648 if (cmd.data == WILC_SDIO_CCCR_IO_EN_FUNC1) in wilc_sdio_init()
669 cmd.read_write = 1; in wilc_sdio_init()
670 cmd.function = 0; in wilc_sdio_init()
671 cmd.raw = 1; in wilc_sdio_init()
672 cmd.address = SDIO_CCCR_IENx; in wilc_sdio_init()
673 cmd.data = WILC_SDIO_CCCR_IEN_MASTER | WILC_SDIO_CCCR_IEN_FUNC1; in wilc_sdio_init()
674 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
707 struct sdio_cmd52 cmd; in wilc_sdio_read_size() local
712 cmd.read_write = 0; in wilc_sdio_read_size()
713 cmd.function = 0; in wilc_sdio_read_size()
714 cmd.raw = 0; in wilc_sdio_read_size()
715 cmd.address = WILC_SDIO_INTERRUPT_DATA_SZ_REG; in wilc_sdio_read_size()
716 cmd.data = 0; in wilc_sdio_read_size()
717 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_size()
718 tmp = cmd.data; in wilc_sdio_read_size()
720 cmd.address = WILC_SDIO_INTERRUPT_DATA_SZ_REG + 1; in wilc_sdio_read_size()
721 cmd.data = 0; in wilc_sdio_read_size()
722 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_size()
723 tmp |= (cmd.data << 8); in wilc_sdio_read_size()
735 struct sdio_cmd52 cmd; in wilc_sdio_read_int() local
743 cmd.function = 1; in wilc_sdio_read_int()
744 cmd.address = WILC_SDIO_EXT_IRQ_FLAG_REG; in wilc_sdio_read_int()
746 cmd.function = 0; in wilc_sdio_read_int()
747 cmd.address = WILC_SDIO_IRQ_FLAG_REG; in wilc_sdio_read_int()
749 cmd.raw = 0; in wilc_sdio_read_int()
750 cmd.read_write = 0; in wilc_sdio_read_int()
751 cmd.data = 0; in wilc_sdio_read_int()
752 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_int()
753 irq_flags = cmd.data; in wilc_sdio_read_int()
754 tmp |= FIELD_PREP(IRG_FLAGS_MASK, cmd.data); in wilc_sdio_read_int()
788 struct sdio_cmd52 cmd; in wilc_sdio_clear_int_ext() local
790 cmd.read_write = 1; in wilc_sdio_clear_int_ext()
791 cmd.function = 0; in wilc_sdio_clear_int_ext()
792 cmd.raw = 0; in wilc_sdio_clear_int_ext()
793 cmd.address = WILC_SDIO_IRQ_CLEAR_FLAG_REG; in wilc_sdio_clear_int_ext()
794 cmd.data = reg; in wilc_sdio_clear_int_ext()
796 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_clear_int_ext()
800 cmd.address, __LINE__); in wilc_sdio_clear_int_ext()
818 struct sdio_cmd52 cmd; in wilc_sdio_clear_int_ext() local
820 cmd.read_write = 1; in wilc_sdio_clear_int_ext()
821 cmd.function = 0; in wilc_sdio_clear_int_ext()
822 cmd.raw = 0; in wilc_sdio_clear_int_ext()
823 cmd.address = WILC_SDIO_IRQ_CLEAR_FLAG_REG; in wilc_sdio_clear_int_ext()
824 cmd.data = BIT(i); in wilc_sdio_clear_int_ext()
826 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_clear_int_ext()
830 cmd.address, __LINE__); in wilc_sdio_clear_int_ext()
859 struct sdio_cmd52 cmd; in wilc_sdio_clear_int_ext() local
861 cmd.read_write = 1; in wilc_sdio_clear_int_ext()
862 cmd.function = 0; in wilc_sdio_clear_int_ext()
863 cmd.raw = 0; in wilc_sdio_clear_int_ext()
864 cmd.address = WILC_SDIO_VMM_TBL_CTRL_REG; in wilc_sdio_clear_int_ext()
865 cmd.data = vmm_ctl; in wilc_sdio_clear_int_ext()
866 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_clear_int_ext()
870 cmd.address, __LINE__); in wilc_sdio_clear_int_ext()