Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: sh-msiof: switch to use modern name

Change legacy name master/slave to modern name host/target.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Yang Yingliang and committed by
Mark Brown
1cb3ebc4 0c8e5afc

+27 -27
+25 -25
drivers/spi/spi-sh-msiof.c
··· 54 54 dma_addr_t rx_dma_addr; 55 55 bool native_cs_inited; 56 56 bool native_cs_high; 57 - bool slave_aborted; 57 + bool target_aborted; 58 58 }; 59 59 60 60 #define MAX_SS 3 /* Maximum number of native chip selects */ ··· 361 361 tmp |= !cs_high << SIMDR1_SYNCAC_SHIFT; 362 362 tmp |= lsb_first << SIMDR1_BITLSB_SHIFT; 363 363 tmp |= sh_msiof_spi_get_dtdl_and_syncdl(p); 364 - if (spi_controller_is_slave(p->ctlr)) { 364 + if (spi_controller_is_target(p->ctlr)) { 365 365 sh_msiof_write(p, SITMDR1, tmp | SITMDR1_PCON); 366 366 } else { 367 367 sh_msiof_write(p, SITMDR1, ··· 553 553 spi_controller_get_devdata(spi->controller); 554 554 u32 clr, set, tmp; 555 555 556 - if (spi_get_csgpiod(spi, 0) || spi_controller_is_slave(p->ctlr)) 556 + if (spi_get_csgpiod(spi, 0) || spi_controller_is_target(p->ctlr)) 557 557 return 0; 558 558 559 559 if (p->native_cs_inited && ··· 602 602 603 603 static int sh_msiof_spi_start(struct sh_msiof_spi_priv *p, void *rx_buf) 604 604 { 605 - bool slave = spi_controller_is_slave(p->ctlr); 605 + bool target = spi_controller_is_target(p->ctlr); 606 606 int ret = 0; 607 607 608 608 /* setup clock and rx/tx signals */ 609 - if (!slave) 609 + if (!target) 610 610 ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TSCKE); 611 611 if (rx_buf && !ret) 612 612 ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_RXE); ··· 614 614 ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TXE); 615 615 616 616 /* start by setting frame bit */ 617 - if (!ret && !slave) 617 + if (!ret && !target) 618 618 ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TFSE); 619 619 620 620 return ret; ··· 622 622 623 623 static int sh_msiof_spi_stop(struct sh_msiof_spi_priv *p, void *rx_buf) 624 624 { 625 - bool slave = spi_controller_is_slave(p->ctlr); 625 + bool target = spi_controller_is_target(p->ctlr); 626 626 int ret = 0; 627 627 628 628 /* shut down frame, rx/tx and clock signals */ 629 - if (!slave) 629 + if (!target) 630 630 ret = sh_msiof_modify_ctr_wait(p, SICTR_TFSE, 0); 631 631 if (!ret) 632 632 ret = sh_msiof_modify_ctr_wait(p, SICTR_TXE, 0); 633 633 if (rx_buf && !ret) 634 634 ret = sh_msiof_modify_ctr_wait(p, SICTR_RXE, 0); 635 - if (!ret && !slave) 635 + if (!ret && !target) 636 636 ret = sh_msiof_modify_ctr_wait(p, SICTR_TSCKE, 0); 637 637 638 638 return ret; 639 639 } 640 640 641 - static int sh_msiof_slave_abort(struct spi_controller *ctlr) 641 + static int sh_msiof_target_abort(struct spi_controller *ctlr) 642 642 { 643 643 struct sh_msiof_spi_priv *p = spi_controller_get_devdata(ctlr); 644 644 645 - p->slave_aborted = true; 645 + p->target_aborted = true; 646 646 complete(&p->done); 647 647 complete(&p->done_txdma); 648 648 return 0; ··· 651 651 static int sh_msiof_wait_for_completion(struct sh_msiof_spi_priv *p, 652 652 struct completion *x) 653 653 { 654 - if (spi_controller_is_slave(p->ctlr)) { 654 + if (spi_controller_is_target(p->ctlr)) { 655 655 if (wait_for_completion_interruptible(x) || 656 - p->slave_aborted) { 656 + p->target_aborted) { 657 657 dev_dbg(&p->pdev->dev, "interrupted\n"); 658 658 return -EINTR; 659 659 } ··· 699 699 tx_fifo(p, tx_buf, words, fifo_shift); 700 700 701 701 reinit_completion(&p->done); 702 - p->slave_aborted = false; 702 + p->target_aborted = false; 703 703 704 704 ret = sh_msiof_spi_start(p, rx_buf); 705 705 if (ret) { ··· 796 796 reinit_completion(&p->done); 797 797 if (tx) 798 798 reinit_completion(&p->done_txdma); 799 - p->slave_aborted = false; 799 + p->target_aborted = false; 800 800 801 801 /* Now start DMA */ 802 802 if (rx) ··· 925 925 sh_msiof_spi_reset_regs(p); 926 926 927 927 /* setup clocks (clock already enabled in chipselect()) */ 928 - if (!spi_controller_is_slave(p->ctlr)) 928 + if (!spi_controller_is_target(p->ctlr)) 929 929 sh_msiof_spi_set_clk_regs(p, t); 930 930 931 931 while (ctlr->dma_tx && len > 15) { ··· 1101 1101 if (!info) 1102 1102 return NULL; 1103 1103 1104 - info->mode = of_property_read_bool(np, "spi-slave") ? MSIOF_SPI_SLAVE 1105 - : MSIOF_SPI_MASTER; 1104 + info->mode = of_property_read_bool(np, "spi-slave") ? MSIOF_SPI_TARGET 1105 + : MSIOF_SPI_HOST; 1106 1106 1107 1107 /* Parse the MSIOF properties */ 1108 - if (info->mode == MSIOF_SPI_MASTER) 1108 + if (info->mode == MSIOF_SPI_HOST) 1109 1109 of_property_read_u32(np, "num-cs", &num_cs); 1110 1110 of_property_read_u32(np, "renesas,tx-fifo-size", 1111 1111 &info->tx_fifo_override); ··· 1279 1279 return -ENXIO; 1280 1280 } 1281 1281 1282 - if (info->mode == MSIOF_SPI_SLAVE) 1283 - ctlr = spi_alloc_slave(&pdev->dev, 1284 - sizeof(struct sh_msiof_spi_priv)); 1282 + if (info->mode == MSIOF_SPI_TARGET) 1283 + ctlr = spi_alloc_target(&pdev->dev, 1284 + sizeof(struct sh_msiof_spi_priv)); 1285 1285 else 1286 - ctlr = spi_alloc_master(&pdev->dev, 1287 - sizeof(struct sh_msiof_spi_priv)); 1286 + ctlr = spi_alloc_host(&pdev->dev, 1287 + sizeof(struct sh_msiof_spi_priv)); 1288 1288 if (ctlr == NULL) 1289 1289 return -ENOMEM; 1290 1290 ··· 1347 1347 ctlr->dev.of_node = pdev->dev.of_node; 1348 1348 ctlr->setup = sh_msiof_spi_setup; 1349 1349 ctlr->prepare_message = sh_msiof_prepare_message; 1350 - ctlr->slave_abort = sh_msiof_slave_abort; 1350 + ctlr->target_abort = sh_msiof_target_abort; 1351 1351 ctlr->bits_per_word_mask = chipdata->bits_per_word_mask; 1352 1352 ctlr->auto_runtime_pm = true; 1353 1353 ctlr->transfer_one = sh_msiof_transfer_one;
+2 -2
include/linux/spi/sh_msiof.h
··· 3 3 #define __SPI_SH_MSIOF_H__ 4 4 5 5 enum { 6 - MSIOF_SPI_MASTER, 7 - MSIOF_SPI_SLAVE, 6 + MSIOF_SPI_HOST, 7 + MSIOF_SPI_TARGET, 8 8 }; 9 9 10 10 struct sh_msiof_spi_info {