| /drivers/spi/ |
| A D | spi-mem-nodm.c | 24 if (op->data.nbytes) { in spi_mem_exec_op() 31 op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in spi_mem_exec_op() 40 if (op->addr.nbytes) { in spi_mem_exec_op() 45 pos += op->addr.nbytes; in spi_mem_exec_op() 48 if (op->dummy.nbytes) in spi_mem_exec_op() 93 len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in spi_mem_adjust_op_size() 99 op->data.nbytes = min(op->data.nbytes, in spi_mem_adjust_op_size() 102 op->data.nbytes = min(op->data.nbytes, in spi_mem_adjust_op_size() 106 if (!op->data.nbytes) in spi_mem_adjust_op_size() 152 if (op->addr.nbytes && in spi_mem_supports_op() [all …]
|
| A D | spi-mem.c | 51 if (!op->data.nbytes) in spi_controller_dma_map_mem_op_data() 97 if (!op->data.nbytes) in spi_controller_dma_unmap_mem_op_data() 177 if (op->addr.nbytes && op->addr.buswidth == 8 && op->addr.nbytes % 2) in spi_mem_dtr_supports_op() 180 if (op->dummy.nbytes && op->dummy.buswidth == 8 && op->dummy.nbytes % 2) in spi_mem_dtr_supports_op() 310 tmpbufsize = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in spi_mem_exec_op() 347 memset(tmpbuf + op->addr.nbytes + 1, 0xff, op->dummy.nbytes); in spi_mem_exec_op() 389 op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in spi_mem_exec_op() 478 len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in spi_mem_adjust_op_size() 484 op->data.nbytes = min(op->data.nbytes, in spi_mem_adjust_op_size() 487 op->data.nbytes = min(op->data.nbytes, in spi_mem_adjust_op_size() [all …]
|
| A D | mtk_snor.c | 151 if (op->addr.nbytes == 4) { in mtk_snor_set_addr() 167 if (!op->data.nbytes) in mtk_snor_adjust_op_size() 170 if (op->addr.nbytes == 3 || op->addr.nbytes == 4) { in mtk_snor_adjust_op_size() 174 op->data.nbytes = 0x400000; in mtk_snor_adjust_op_size() 177 op->data.nbytes = 1; in mtk_snor_adjust_op_size() 187 op->data.nbytes = 1; in mtk_snor_adjust_op_size() 211 if (op->addr.nbytes == 4) in mtk_snor_setup_bus() 270 rdlen = op->data.nbytes; in mtk_snor_read_bounce() 394 tx_len = 1 + op->addr.nbytes + op->dummy.nbytes; in mtk_snor_cmd_program() 397 tx_len += op->data.nbytes; in mtk_snor_cmd_program() [all …]
|
| A D | mtk_spim.c | 375 if (op->addr.nbytes && op->dummy.nbytes && in mtk_spim_supports_op() 379 if (op->addr.nbytes + op->dummy.nbytes > 16) in mtk_spim_supports_op() 467 if (op->addr.nbytes || op->dummy.nbytes) in mtk_spim_exec_op() 468 reg_val |= (op->addr.nbytes + op->dummy.nbytes) << in mtk_spim_exec_op() 481 if (op->addr.nbytes || op->dummy.nbytes) { in mtk_spim_exec_op() 507 tx_size = 1 + op->addr.nbytes + op->dummy.nbytes; in mtk_spim_exec_op() 528 if (op->dummy.nbytes) in mtk_spim_exec_op() 533 memcpy(tx_tmp_buf + op->dummy.nbytes + op->addr.nbytes + 1, in mtk_spim_exec_op() 614 if (!op->data.nbytes) in mtk_spim_adjust_op_size() 618 opcode_len = 1 + op->addr.nbytes + op->dummy.nbytes; in mtk_spim_adjust_op_size() [all …]
|
| A D | npcm_fiu_spi.c | 244 1, op->addr.nbytes, op->dummy.nbytes, op->data.nbytes); in npcm_fiu_uma_operation() 254 if (op->addr.nbytes) { in npcm_fiu_uma_operation() 260 if (op->dummy.nbytes) in npcm_fiu_uma_operation() 276 if (nbytes) in npcm_fiu_uma_operation() 278 if (nbytes > DW_SIZE) in npcm_fiu_uma_operation() 280 if (nbytes > DW_SIZE * 2) in npcm_fiu_uma_operation() 282 if (nbytes > DW_SIZE * 3) in npcm_fiu_uma_operation() 297 if (nbytes) in npcm_fiu_uma_operation() 299 if (nbytes > DW_SIZE) in npcm_fiu_uma_operation() 301 if (nbytes > DW_SIZE * 2) in npcm_fiu_uma_operation() [all …]
|
| A D | fsl_qspi.c | 367 if (op->addr.nbytes) in fsl_qspi_supports_op() 370 if (op->dummy.nbytes) in fsl_qspi_supports_op() 373 if (op->data.nbytes) in fsl_qspi_supports_op() 383 if (op->addr.nbytes + in fsl_qspi_supports_op() 389 if (op->dummy.nbytes && in fsl_qspi_supports_op() 418 if (op->addr.nbytes) { in fsl_qspi_prepare_lut() 440 if (op->dummy.nbytes) { in fsl_qspi_prepare_lut() 448 if (op->data.nbytes) { in fsl_qspi_prepare_lut() 543 if (op->addr.nbytes) in fsl_qspi_read_ahb() 652 if (op->addr.nbytes) in fsl_qspi_exec_op() [all …]
|
| A D | mtk_snfi_spi.c | 58 u32 nbytes; in mtk_snfi_adjust_op_size() local 66 nbytes = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in mtk_snfi_adjust_op_size() 68 if (nbytes + op->data.nbytes <= SNFI_GPRAM_SIZE) in mtk_snfi_adjust_op_size() 71 if (nbytes >= SNFI_GPRAM_SIZE) in mtk_snfi_adjust_op_size() 74 op->data.nbytes = SNFI_GPRAM_SIZE - nbytes; in mtk_snfi_adjust_op_size() 214 addr_sh = (op->addr.nbytes - 1) * 8; in mtk_snfi_exec_op() 221 for (i = 0; i < op->dummy.nbytes; i++) in mtk_snfi_exec_op() 225 if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) { in mtk_snfi_exec_op() 227 len += op->data.nbytes; in mtk_snfi_exec_op() 234 if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_IN) in mtk_snfi_exec_op() [all …]
|
| A D | nxp_fspi.c | 403 if (op->addr.nbytes) in nxp_fspi_supports_op() 406 if (op->dummy.nbytes) in nxp_fspi_supports_op() 409 if (op->data.nbytes) in nxp_fspi_supports_op() 418 if (op->addr.nbytes > 4) in nxp_fspi_supports_op() 499 if (op->addr.nbytes) { in nxp_fspi_prepare_lut() 507 if (op->dummy.nbytes) { in nxp_fspi_prepare_lut() 520 if (op->data.nbytes) { in nxp_fspi_prepare_lut() 634 u32 len = op->data.nbytes; in nxp_fspi_read_ahb() 667 if (i < op->data.nbytes) { in nxp_fspi_fill_txfifo() 689 int len = op->data.nbytes; in nxp_fspi_read_rxfifo() [all …]
|
| A D | adi_spi3.c | 595 if ((op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes) > in adi_spi_mem_exec_op() 601 (8 * (op->cmd.nbytes - i - 1)); in adi_spi_mem_exec_op() 605 memset(tmpbuf + op->addr.nbytes + op->cmd.nbytes, 0xff, in adi_spi_mem_exec_op() 606 op->dummy.nbytes); in adi_spi_mem_exec_op() 611 if (op->cmd.nbytes) { in adi_spi_mem_exec_op() 618 if (op->addr.nbytes) { in adi_spi_mem_exec_op() 621 op->addr.nbytes); in adi_spi_mem_exec_op() 626 if (op->dummy.nbytes) { in adi_spi_mem_exec_op() 629 op->addr.nbytes, in adi_spi_mem_exec_op() 638 op->data.nbytes); in adi_spi_mem_exec_op() [all …]
|
| A D | rockchip_sfc.c | 325 if (unlikely(op->dummy.nbytes && !op->addr.nbytes)) { in rockchip_sfc_adjust_op_work() 330 op->addr.nbytes = op->dummy.nbytes; in rockchip_sfc_adjust_op_work() 334 op->dummy.nbytes = 0; in rockchip_sfc_adjust_op_work() 373 if (op->addr.nbytes) { in rockchip_sfc_xfer_setup() 374 if (op->addr.nbytes == 4) { in rockchip_sfc_xfer_setup() 376 } else if (op->addr.nbytes == 3) { in rockchip_sfc_xfer_setup() 387 if (op->dummy.nbytes) { in rockchip_sfc_xfer_setup() 407 if (!len && op->addr.nbytes) in rockchip_sfc_xfer_setup() 415 op->addr.nbytes, op->addr.buswidth, in rockchip_sfc_xfer_setup() 422 if (op->addr.nbytes) in rockchip_sfc_xfer_setup() [all …]
|
| A D | spi-sifive.c | 283 if (!op->addr.nbytes && !op->dummy.nbytes && !op->data.nbytes) in sifive_spi_exec_op() 295 op_len = op->addr.nbytes + op->dummy.nbytes; in sifive_spi_exec_op() 299 if (op->addr.nbytes) { in sifive_spi_exec_op() 301 for (i = 0; i < op->addr.nbytes; i++) in sifive_spi_exec_op() 303 (8 * (op->addr.nbytes - i - 1)); in sifive_spi_exec_op() 305 pos += op->addr.nbytes; in sifive_spi_exec_op() 308 if (op->dummy.nbytes) in sifive_spi_exec_op() 309 memset(op_buf + pos, 0xff, op->dummy.nbytes); in sifive_spi_exec_op() 312 if (!op->data.nbytes) in sifive_spi_exec_op() 325 if (op->data.nbytes) { in sifive_spi_exec_op() [all …]
|
| A D | spi-mxic.c | 292 unsigned int nbytes = len - pos; in mxic_spi_data_xfer() local 297 if (nbytes > 4) in mxic_spi_data_xfer() 298 nbytes = 4; in mxic_spi_data_xfer() 324 data >>= (8 * (4 - nbytes)); in mxic_spi_data_xfer() 332 pos += nbytes; in mxic_spi_data_xfer() 345 if (op->addr.nbytes > 7) in mxic_spi_mem_supports_op() 377 if (op->addr.nbytes) in mxic_spi_mem_exec_op() 386 if (op->dummy.nbytes) { in mxic_spi_mem_exec_op() 387 dummy_bytes = op->dummy.nbytes / in mxic_spi_mem_exec_op() 393 if (op->data.nbytes) { in mxic_spi_mem_exec_op() [all …]
|
| A D | atmel-quadspi.c | 524 if (op->dummy.nbytes) in atmel_qspi_set_cfg() 580 if (op->data.nbytes) { in atmel_qspi_set_cfg() 583 if (op->addr.nbytes) in atmel_qspi_set_cfg() 595 if (op->addr.nbytes && !op->data.nbytes) in atmel_qspi_set_cfg() 621 if (op->data.nbytes) { in atmel_qspi_transfer() 688 if (op->data.nbytes) { in atmel_qspi_sama7g5_set_cfg() 690 if (op->addr.nbytes) in atmel_qspi_sama7g5_set_cfg() 702 if (op->addr.nbytes && !op->data.nbytes) in atmel_qspi_sama7g5_set_cfg() 709 if (op->data.nbytes) in atmel_qspi_sama7g5_set_cfg() 726 if (!op->data.nbytes) { in atmel_qspi_sama7g5_transfer() [all …]
|
| A D | stm32_qspi.c | 180 u32 len = op->data.nbytes, sr; in _stm32_qspi_poll() 212 op->data.nbytes); in stm32_qspi_mm() 221 if (!op->data.nbytes) in _stm32_qspi_tx() 249 op->addr.val, op->data.nbytes); in stm32_qspi_exec_op() 251 addr_max = op->addr.val + op->data.nbytes + 1; in stm32_qspi_exec_op() 260 if (op->data.nbytes) in stm32_qspi_exec_op() 261 writel(op->data.nbytes - 1, &priv->regs->dlr); in stm32_qspi_exec_op() 268 if (op->addr.nbytes) { in stm32_qspi_exec_op() 274 if (op->dummy.buswidth && op->dummy.nbytes) in stm32_qspi_exec_op() 275 ccr |= (op->dummy.nbytes * 8 / op->dummy.buswidth in stm32_qspi_exec_op() [all …]
|
| A D | microchip_coreqspi.c | 202 cmd_bytes = op->cmd.nbytes + op->addr.nbytes; in mchp_coreqspi_config_op() 203 total_bytes = cmd_bytes + op->data.nbytes; in mchp_coreqspi_config_op() 329 qspi->tx_len = op->cmd.nbytes; in mchp_coreqspi_exec_op() 335 if (op->addr.nbytes) { in mchp_coreqspi_exec_op() 336 for (i = 0; i < op->addr.nbytes; i++) in mchp_coreqspi_exec_op() 340 qspi->tx_len = op->addr.nbytes; in mchp_coreqspi_exec_op() 345 if (op->data.nbytes) { in mchp_coreqspi_exec_op() 350 qspi->tx_len = op->data.nbytes; in mchp_coreqspi_exec_op() 355 qspi->rx_len = op->data.nbytes; in mchp_coreqspi_exec_op() 397 if (op->data.nbytes > MAX_DATA_CMD_LEN) in mchp_coreqspi_adjust_op_size() [all …]
|
| A D | ca_sflash.c | 367 unsigned int data_cnt = op->data.nbytes; in _ca_sflash_access_data() 369 u8 addr_cnt = op->addr.nbytes; in _ca_sflash_access_data() 422 u8 dummy_cnt = op->dummy.nbytes; in _ca_sflash_issue_cmd() 423 u8 addr_cnt = op->addr.nbytes; in _ca_sflash_issue_cmd() 425 unsigned int data_cnt = op->data.nbytes; in _ca_sflash_issue_cmd() 495 op->addr.nbytes, op->data.nbytes, op->data.dir); in ca_sflash_exec_op() 497 if (op->data.nbytes == 0 && op->addr.nbytes == 0) { in ca_sflash_exec_op() 499 } else if (op->data.nbytes == 0 && op->addr.nbytes > 0) { in ca_sflash_exec_op() 501 } else if (op->data.nbytes > 0) { in ca_sflash_exec_op()
|
| A D | xilinx_spi.c | 342 if (op->addr.nbytes) { in xilinx_spi_mem_exec_op() 346 for (i = 0; i < op->addr.nbytes; i++) in xilinx_spi_mem_exec_op() 348 (8 * (op->addr.nbytes - i - 1)); in xilinx_spi_mem_exec_op() 351 op->addr.nbytes); in xilinx_spi_mem_exec_op() 355 if (op->dummy.nbytes) { in xilinx_spi_mem_exec_op() 356 dummy_len = (op->dummy.nbytes * op->data.buswidth) / in xilinx_spi_mem_exec_op() 363 if (op->data.nbytes) { in xilinx_spi_mem_exec_op() 366 op->data.buf.in, op->data.nbytes); in xilinx_spi_mem_exec_op() 369 NULL, op->data.nbytes); in xilinx_spi_mem_exec_op() 406 if (op->addr.nbytes && in xilinx_qspi_mem_exec_op() [all …]
|
| A D | designware_spi.c | 590 u8 op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; in dw_spi_exec_op() 601 op->data.nbytes); in dw_spi_exec_op() 612 if (op->addr.nbytes) { in dw_spi_exec_op() 613 for (i = 0; i < op->addr.nbytes; i++) in dw_spi_exec_op() 615 (8 * (op->addr.nbytes - i - 1)); in dw_spi_exec_op() 617 pos += op->addr.nbytes; in dw_spi_exec_op() 619 if (op->dummy.nbytes) in dw_spi_exec_op() 620 memset(op_buf + pos, 0xff, op->dummy.nbytes); in dw_spi_exec_op() 637 priv->rx_end = priv->rx + op->data.nbytes; in dw_spi_exec_op() 655 priv->tx_end = priv->tx + op->data.nbytes; in dw_spi_exec_op() [all …]
|
| A D | renesas_rpc_spi.c | 292 if (op->addr.nbytes == 4) { in rpc_spi_mem_exec_op() 296 } else if (op->addr.nbytes == 3) { in rpc_spi_mem_exec_op() 304 if (op->dummy.nbytes) in rpc_spi_mem_exec_op() 307 writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_DRDMCR); in rpc_spi_mem_exec_op() 312 memcpy_fromio(din, (void *)(priv->extr + offset), op->data.nbytes); in rpc_spi_mem_exec_op() 326 if (op->addr.nbytes == 4) in rpc_spi_mem_exec_op() 328 else if (op->addr.nbytes == 3) in rpc_spi_mem_exec_op() 335 if (op->dummy.nbytes) { in rpc_spi_mem_exec_op() 336 writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_SMDMCR); in rpc_spi_mem_exec_op() 343 if (dout && op->data.nbytes) { in rpc_spi_mem_exec_op() [all …]
|
| A D | cadence_qspi_apb.c | 394 if (op->cmd.nbytes != 2) in cadence_qspi_setup_opcode_ext() 465 unsigned int rxlen = op->data.nbytes; in cadence_qspi_apb_command_read() 496 if (op->addr.nbytes) { in cadence_qspi_apb_command_read() 501 reg |= (((op->addr.nbytes - 1) & in cadence_qspi_apb_command_read() 556 unsigned int txlen = op->data.nbytes; in cadence_qspi_apb_command_write() 569 if (op->addr.nbytes) { in cadence_qspi_apb_command_write() 574 reg |= (((op->addr.nbytes - 1) & in cadence_qspi_apb_command_write() 665 reg |= (op->addr.nbytes - 1); in cadence_qspi_apb_read_setup() 772 size_t len = op->data.nbytes; in cadence_qspi_apb_read_execute() 842 reg |= (op->addr.nbytes - 1); in cadence_qspi_apb_write_setup() [all …]
|
| A D | octeon_spi.c | 451 if (!op->data.nbytes && !op->addr.nbytes && !op->dummy.nbytes) in octeon_spi_exec_op() 459 if (op->addr.nbytes) { in octeon_spi_exec_op() 461 buf = (u8 *)calloc(1, op->addr.nbytes + op->dummy.nbytes); in octeon_spi_exec_op() 467 for (temp = 0; temp < op->addr.nbytes; temp++) in octeon_spi_exec_op() 468 buf[i++] = *(u8 *)(addr + op->addr.nbytes - 1 - temp); in octeon_spi_exec_op() 469 for (temp = 0; temp < op->dummy.nbytes; temp++) in octeon_spi_exec_op() 476 if (!op->data.nbytes) in octeon_spi_exec_op() 484 if (!op->data.nbytes) in octeon_spi_exec_op() 497 ret = octeontx2_spi_xfer(slave->dev, (op->data.nbytes * 8), tx, rx, in octeon_spi_exec_op()
|
| A D | spi-sn-f-ospi.c | 121 return (op->dummy.nbytes * 8) / op->dummy.buswidth; in f_ospi_get_dummy_cycle() 275 mode = f_ospi_get_mode(ospi, op->addr.buswidth, op->addr.nbytes); in f_ospi_config_indir_protocol() 278 mode = f_ospi_get_mode(ospi, op->data.buswidth, op->data.nbytes); in f_ospi_config_indir_protocol() 294 switch (op->data.nbytes & 0x3) { in f_ospi_config_indir_protocol() 301 val = OSPI_DAT_SIZE_EN | (op->data.nbytes - 1); in f_ospi_config_indir_protocol() 305 val = OSPI_DAT_SIZE_EN | (op->data.nbytes - 1); in f_ospi_config_indir_protocol() 328 prot |= FIELD_PREP(OSPI_PROT_ADDR_SIZE_MASK, op->addr.nbytes); in f_ospi_config_indir_protocol() 415 for (i = 0; i < op->data.nbytes; i++) { in f_ospi_indir_read() 468 for (i = 0; i < op->data.nbytes; i++) { in f_ospi_indir_write() 552 if (op->addr.nbytes > 4) in f_ospi_supports_op() [all …]
|
| A D | airoha_snfi_spi.c | 533 max_len = 1 + op->addr.nbytes + op->dummy.nbytes; in airoha_snand_adjust_op_size() 537 if (op->data.nbytes > 160 - max_len) in airoha_snand_adjust_op_size() 538 op->data.nbytes = 160 - max_len; in airoha_snand_adjust_op_size() 552 return (!op->addr.nbytes || op->addr.buswidth == 1) && in airoha_snand_supports_op() 553 (!op->dummy.nbytes || op->dummy.buswidth == 1) && in airoha_snand_supports_op() 554 (!op->data.nbytes || op->data.buswidth == 1); in airoha_snand_supports_op() 585 for (i = ARRAY_SIZE(data) - op->addr.nbytes; in airoha_snand_exec_op() 595 for (i = 0; i < op->dummy.nbytes; i++) { in airoha_snand_exec_op() 605 op->data.nbytes); in airoha_snand_exec_op() 610 op->data.nbytes); in airoha_snand_exec_op()
|
| /drivers/sm/ |
| A D | meson-sm.c | 86 s32 nbytes; in meson_sm_call_read() local 92 ret = meson_sm_call(dev, cmd_index, &nbytes, args); in meson_sm_call_read() 96 if (nbytes < 0 || nbytes > size) in meson_sm_call_read() 104 ret = nbytes; in meson_sm_call_read() 105 if (!nbytes) in meson_sm_call_read() 106 nbytes = size; in meson_sm_call_read() 108 memcpy(buffer, priv->sm_shmem_out, nbytes); in meson_sm_call_read() 117 s32 nbytes; in meson_sm_call_write() local 125 ret = meson_sm_call(dev, cmd_index, &nbytes, args); in meson_sm_call_write() 129 if (nbytes <= 0 || nbytes > size) in meson_sm_call_write() [all …]
|
| /drivers/mtd/nand/spi/ |
| A D | core.c | 288 while (nbytes) { in spinand_read_from_cache_op() 290 op.data.nbytes = nbytes; in spinand_read_from_cache_op() 300 nbytes -= op.data.nbytes; in spinand_read_from_cache_op() 384 while (nbytes) { in spinand_write_to_cache_op() 386 op.data.nbytes = nbytes; in spinand_write_to_cache_op() 397 nbytes -= op.data.nbytes; in spinand_write_to_cache_op() 405 if (nbytes) { in spinand_write_to_cache_op() 925 while (nbytes) { in spinand_select_op_variant() 926 op.data.nbytes = nbytes; in spinand_select_op_variant() 934 nbytes -= op.data.nbytes; in spinand_select_op_variant() [all …]
|