Lines Matching refs:cmd
63 static int wilc_sdio_cmd52(struct wilc *wilc, struct sdio_cmd52 *cmd) in wilc_sdio_cmd52() argument
71 func->num = cmd->function; in wilc_sdio_cmd52()
72 if (cmd->read_write) { /* write */ in wilc_sdio_cmd52()
73 if (cmd->raw) { in wilc_sdio_cmd52()
74 sdio_writeb(func, cmd->data, cmd->address, &ret); in wilc_sdio_cmd52()
75 data = sdio_readb(func, cmd->address, &ret); in wilc_sdio_cmd52()
76 cmd->data = data; in wilc_sdio_cmd52()
78 sdio_writeb(func, cmd->data, cmd->address, &ret); in wilc_sdio_cmd52()
81 data = sdio_readb(func, cmd->address, &ret); in wilc_sdio_cmd52()
82 cmd->data = data; in wilc_sdio_cmd52()
92 static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd) in wilc_sdio_cmd53() argument
97 u8 *buf = cmd->buffer; in wilc_sdio_cmd53()
101 func->num = cmd->function; in wilc_sdio_cmd53()
102 func->cur_blksize = cmd->block_size; in wilc_sdio_cmd53()
103 if (cmd->block_mode) in wilc_sdio_cmd53()
104 size = cmd->count * cmd->block_size; in wilc_sdio_cmd53()
106 size = cmd->count; in wilc_sdio_cmd53()
108 if (cmd->use_global_buf) { in wilc_sdio_cmd53()
115 if (cmd->read_write) { /* write */ in wilc_sdio_cmd53()
116 if (cmd->use_global_buf) in wilc_sdio_cmd53()
117 memcpy(buf, cmd->buffer, size); in wilc_sdio_cmd53()
119 ret = sdio_memcpy_toio(func, cmd->address, buf, size); in wilc_sdio_cmd53()
121 ret = sdio_memcpy_fromio(func, buf, cmd->address, size); in wilc_sdio_cmd53()
123 if (cmd->use_global_buf) in wilc_sdio_cmd53()
124 memcpy(cmd->buffer, buf, size); in wilc_sdio_cmd53()
203 struct sdio_cmd52 cmd; in wilc_sdio_reset() local
207 cmd.read_write = 1; in wilc_sdio_reset()
208 cmd.function = 0; in wilc_sdio_reset()
209 cmd.raw = 0; in wilc_sdio_reset()
210 cmd.address = SDIO_CCCR_ABORT; in wilc_sdio_reset()
211 cmd.data = WILC_SDIO_CCCR_ABORT_RESET; in wilc_sdio_reset()
212 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_reset()
291 struct sdio_cmd52 cmd; in wilc_sdio_set_func0_csa_address() local
297 cmd.read_write = 1; in wilc_sdio_set_func0_csa_address()
298 cmd.function = 0; in wilc_sdio_set_func0_csa_address()
299 cmd.raw = 0; in wilc_sdio_set_func0_csa_address()
300 cmd.address = WILC_SDIO_FBR_CSA_REG; in wilc_sdio_set_func0_csa_address()
301 cmd.data = (u8)adr; in wilc_sdio_set_func0_csa_address()
302 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
305 cmd.address); in wilc_sdio_set_func0_csa_address()
309 cmd.address = WILC_SDIO_FBR_CSA_REG + 1; in wilc_sdio_set_func0_csa_address()
310 cmd.data = (u8)(adr >> 8); in wilc_sdio_set_func0_csa_address()
311 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
314 cmd.address); in wilc_sdio_set_func0_csa_address()
318 cmd.address = WILC_SDIO_FBR_CSA_REG + 2; in wilc_sdio_set_func0_csa_address()
319 cmd.data = (u8)(adr >> 16); in wilc_sdio_set_func0_csa_address()
320 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_func0_csa_address()
323 cmd.address); in wilc_sdio_set_func0_csa_address()
334 struct sdio_cmd52 cmd; in wilc_sdio_set_block_size() local
337 cmd.read_write = 1; in wilc_sdio_set_block_size()
338 cmd.function = 0; in wilc_sdio_set_block_size()
339 cmd.raw = 0; in wilc_sdio_set_block_size()
340 cmd.address = SDIO_FBR_BASE(func_num) + SDIO_CCCR_BLKSIZE; in wilc_sdio_set_block_size()
341 cmd.data = (u8)block_size; in wilc_sdio_set_block_size()
342 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_block_size()
345 cmd.address); in wilc_sdio_set_block_size()
349 cmd.address = SDIO_FBR_BASE(func_num) + SDIO_CCCR_BLKSIZE + 1; in wilc_sdio_set_block_size()
350 cmd.data = (u8)(block_size >> 8); in wilc_sdio_set_block_size()
351 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_set_block_size()
354 cmd.address); in wilc_sdio_set_block_size()
375 struct sdio_cmd52 cmd; in wilc_sdio_write_reg() local
377 cmd.read_write = 1; in wilc_sdio_write_reg()
378 cmd.function = 0; in wilc_sdio_write_reg()
379 cmd.raw = 0; in wilc_sdio_write_reg()
380 cmd.address = addr; in wilc_sdio_write_reg()
381 cmd.data = data; in wilc_sdio_write_reg()
382 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_write_reg()
387 struct sdio_cmd53 cmd; in wilc_sdio_write_reg() local
396 cmd.read_write = 1; in wilc_sdio_write_reg()
397 cmd.function = 0; in wilc_sdio_write_reg()
398 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_write_reg()
399 cmd.block_mode = 0; in wilc_sdio_write_reg()
400 cmd.increment = 1; in wilc_sdio_write_reg()
401 cmd.count = sizeof(u32); in wilc_sdio_write_reg()
402 cmd.buffer = (u8 *)&data; in wilc_sdio_write_reg()
403 cmd.use_global_buf = true; in wilc_sdio_write_reg()
404 cmd.block_size = sdio_priv->block_size; in wilc_sdio_write_reg()
405 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write_reg()
419 struct sdio_cmd53 cmd; in wilc_sdio_write() local
422 cmd.read_write = 1; in wilc_sdio_write()
427 cmd.function = 0; in wilc_sdio_write()
428 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_write()
433 cmd.function = 1; in wilc_sdio_write()
434 cmd.address = WILC_SDIO_F1_DATA_REG; in wilc_sdio_write()
441 cmd.use_global_buf = false; in wilc_sdio_write()
443 cmd.block_mode = 1; in wilc_sdio_write()
444 cmd.increment = 1; in wilc_sdio_write()
445 cmd.count = nblk; in wilc_sdio_write()
446 cmd.buffer = buf; in wilc_sdio_write()
447 cmd.block_size = block_size; in wilc_sdio_write()
453 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write()
465 cmd.block_mode = 0; in wilc_sdio_write()
466 cmd.increment = 1; in wilc_sdio_write()
467 cmd.count = nleft; in wilc_sdio_write()
468 cmd.buffer = buf; in wilc_sdio_write()
470 cmd.block_size = block_size; in wilc_sdio_write()
477 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_write()
495 struct sdio_cmd52 cmd; in wilc_sdio_read_reg() local
497 cmd.read_write = 0; in wilc_sdio_read_reg()
498 cmd.function = 0; in wilc_sdio_read_reg()
499 cmd.raw = 0; in wilc_sdio_read_reg()
500 cmd.address = addr; in wilc_sdio_read_reg()
501 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_reg()
507 *data = cmd.data; in wilc_sdio_read_reg()
509 struct sdio_cmd53 cmd; in wilc_sdio_read_reg() local
515 cmd.read_write = 0; in wilc_sdio_read_reg()
516 cmd.function = 0; in wilc_sdio_read_reg()
517 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_read_reg()
518 cmd.block_mode = 0; in wilc_sdio_read_reg()
519 cmd.increment = 1; in wilc_sdio_read_reg()
520 cmd.count = sizeof(u32); in wilc_sdio_read_reg()
521 cmd.buffer = (u8 *)data; in wilc_sdio_read_reg()
522 cmd.use_global_buf = true; in wilc_sdio_read_reg()
524 cmd.block_size = sdio_priv->block_size; in wilc_sdio_read_reg()
525 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read_reg()
542 struct sdio_cmd53 cmd; in wilc_sdio_read() local
545 cmd.read_write = 0; in wilc_sdio_read()
550 cmd.function = 0; in wilc_sdio_read()
551 cmd.address = WILC_SDIO_FBR_DATA_REG; in wilc_sdio_read()
556 cmd.function = 1; in wilc_sdio_read()
557 cmd.address = WILC_SDIO_F1_DATA_REG; in wilc_sdio_read()
564 cmd.use_global_buf = false; in wilc_sdio_read()
566 cmd.block_mode = 1; in wilc_sdio_read()
567 cmd.increment = 1; in wilc_sdio_read()
568 cmd.count = nblk; in wilc_sdio_read()
569 cmd.buffer = buf; in wilc_sdio_read()
570 cmd.block_size = block_size; in wilc_sdio_read()
576 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read()
588 cmd.block_mode = 0; in wilc_sdio_read()
589 cmd.increment = 1; in wilc_sdio_read()
590 cmd.count = nleft; in wilc_sdio_read()
591 cmd.buffer = buf; in wilc_sdio_read()
593 cmd.block_size = block_size; in wilc_sdio_read()
600 ret = wilc_sdio_cmd53(wilc, &cmd); in wilc_sdio_read()
629 struct sdio_cmd52 cmd; in wilc_sdio_init() local
636 cmd.read_write = 1; in wilc_sdio_init()
637 cmd.function = 0; in wilc_sdio_init()
638 cmd.raw = 1; in wilc_sdio_init()
639 cmd.address = SDIO_FBR_BASE(1); in wilc_sdio_init()
640 cmd.data = SDIO_FBR_ENABLE_CSA; in wilc_sdio_init()
641 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
660 cmd.read_write = 1; in wilc_sdio_init()
661 cmd.function = 0; in wilc_sdio_init()
662 cmd.raw = 1; in wilc_sdio_init()
663 cmd.address = SDIO_CCCR_IOEx; in wilc_sdio_init()
664 cmd.data = WILC_SDIO_CCCR_IO_EN_FUNC1; in wilc_sdio_init()
665 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
675 cmd.read_write = 0; in wilc_sdio_init()
676 cmd.function = 0; in wilc_sdio_init()
677 cmd.raw = 0; in wilc_sdio_init()
678 cmd.address = SDIO_CCCR_IORx; in wilc_sdio_init()
681 cmd.data = 0; in wilc_sdio_init()
682 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
688 if (cmd.data == WILC_SDIO_CCCR_IO_EN_FUNC1) in wilc_sdio_init()
709 cmd.read_write = 1; in wilc_sdio_init()
710 cmd.function = 0; in wilc_sdio_init()
711 cmd.raw = 1; in wilc_sdio_init()
712 cmd.address = SDIO_CCCR_IENx; in wilc_sdio_init()
713 cmd.data = WILC_SDIO_CCCR_IEN_MASTER | WILC_SDIO_CCCR_IEN_FUNC1; in wilc_sdio_init()
714 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_init()
739 struct sdio_cmd52 cmd; in wilc_sdio_read_size() local
744 cmd.read_write = 0; in wilc_sdio_read_size()
745 cmd.function = 0; in wilc_sdio_read_size()
746 cmd.raw = 0; in wilc_sdio_read_size()
747 cmd.address = WILC_SDIO_INTERRUPT_DATA_SZ_REG; in wilc_sdio_read_size()
748 cmd.data = 0; in wilc_sdio_read_size()
749 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_size()
750 tmp = cmd.data; in wilc_sdio_read_size()
752 cmd.address = WILC_SDIO_INTERRUPT_DATA_SZ_REG + 1; in wilc_sdio_read_size()
753 cmd.data = 0; in wilc_sdio_read_size()
754 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_size()
755 tmp |= (cmd.data << 8); in wilc_sdio_read_size()
767 struct sdio_cmd52 cmd; in wilc_sdio_read_int() local
775 cmd.function = 1; in wilc_sdio_read_int()
776 cmd.address = WILC_SDIO_EXT_IRQ_FLAG_REG; in wilc_sdio_read_int()
778 cmd.function = 0; in wilc_sdio_read_int()
779 cmd.address = WILC_SDIO_IRQ_FLAG_REG; in wilc_sdio_read_int()
781 cmd.raw = 0; in wilc_sdio_read_int()
782 cmd.read_write = 0; in wilc_sdio_read_int()
783 cmd.data = 0; in wilc_sdio_read_int()
784 wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_read_int()
785 irq_flags = cmd.data; in wilc_sdio_read_int()
786 tmp |= FIELD_PREP(IRG_FLAGS_MASK, cmd.data); in wilc_sdio_read_int()
817 struct sdio_cmd52 cmd; in wilc_sdio_clear_int_ext() local
819 cmd.read_write = 1; in wilc_sdio_clear_int_ext()
820 cmd.function = 0; in wilc_sdio_clear_int_ext()
821 cmd.raw = 0; in wilc_sdio_clear_int_ext()
822 cmd.address = WILC_SDIO_IRQ_CLEAR_FLAG_REG; in wilc_sdio_clear_int_ext()
823 cmd.data = reg; in wilc_sdio_clear_int_ext()
825 ret = wilc_sdio_cmd52(wilc, &cmd); in wilc_sdio_clear_int_ext()
829 cmd.address, __LINE__); in wilc_sdio_clear_int_ext()