Skip to content

Commit 1cb3ebc

Browse files
Yang Yingliangbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0c8e5af commit 1cb3ebc

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

drivers/spi/spi-sh-msiof.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct sh_msiof_spi_priv {
5454
dma_addr_t rx_dma_addr;
5555
bool native_cs_inited;
5656
bool native_cs_high;
57-
bool slave_aborted;
57+
bool target_aborted;
5858
};
5959

6060
#define MAX_SS 3 /* Maximum number of native chip selects */
@@ -361,7 +361,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, u32 ss,
361361
tmp |= !cs_high << SIMDR1_SYNCAC_SHIFT;
362362
tmp |= lsb_first << SIMDR1_BITLSB_SHIFT;
363363
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)) {
365365
sh_msiof_write(p, SITMDR1, tmp | SITMDR1_PCON);
366366
} else {
367367
sh_msiof_write(p, SITMDR1,
@@ -553,7 +553,7 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
553553
spi_controller_get_devdata(spi->controller);
554554
u32 clr, set, tmp;
555555

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))
557557
return 0;
558558

559559
if (p->native_cs_inited &&
@@ -602,47 +602,47 @@ static int sh_msiof_prepare_message(struct spi_controller *ctlr,
602602

603603
static int sh_msiof_spi_start(struct sh_msiof_spi_priv *p, void *rx_buf)
604604
{
605-
bool slave = spi_controller_is_slave(p->ctlr);
605+
bool target = spi_controller_is_target(p->ctlr);
606606
int ret = 0;
607607

608608
/* setup clock and rx/tx signals */
609-
if (!slave)
609+
if (!target)
610610
ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TSCKE);
611611
if (rx_buf && !ret)
612612
ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_RXE);
613613
if (!ret)
614614
ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TXE);
615615

616616
/* start by setting frame bit */
617-
if (!ret && !slave)
617+
if (!ret && !target)
618618
ret = sh_msiof_modify_ctr_wait(p, 0, SICTR_TFSE);
619619

620620
return ret;
621621
}
622622

623623
static int sh_msiof_spi_stop(struct sh_msiof_spi_priv *p, void *rx_buf)
624624
{
625-
bool slave = spi_controller_is_slave(p->ctlr);
625+
bool target = spi_controller_is_target(p->ctlr);
626626
int ret = 0;
627627

628628
/* shut down frame, rx/tx and clock signals */
629-
if (!slave)
629+
if (!target)
630630
ret = sh_msiof_modify_ctr_wait(p, SICTR_TFSE, 0);
631631
if (!ret)
632632
ret = sh_msiof_modify_ctr_wait(p, SICTR_TXE, 0);
633633
if (rx_buf && !ret)
634634
ret = sh_msiof_modify_ctr_wait(p, SICTR_RXE, 0);
635-
if (!ret && !slave)
635+
if (!ret && !target)
636636
ret = sh_msiof_modify_ctr_wait(p, SICTR_TSCKE, 0);
637637

638638
return ret;
639639
}
640640

641-
static int sh_msiof_slave_abort(struct spi_controller *ctlr)
641+
static int sh_msiof_target_abort(struct spi_controller *ctlr)
642642
{
643643
struct sh_msiof_spi_priv *p = spi_controller_get_devdata(ctlr);
644644

645-
p->slave_aborted = true;
645+
p->target_aborted = true;
646646
complete(&p->done);
647647
complete(&p->done_txdma);
648648
return 0;
@@ -651,9 +651,9 @@ static int sh_msiof_slave_abort(struct spi_controller *ctlr)
651651
static int sh_msiof_wait_for_completion(struct sh_msiof_spi_priv *p,
652652
struct completion *x)
653653
{
654-
if (spi_controller_is_slave(p->ctlr)) {
654+
if (spi_controller_is_target(p->ctlr)) {
655655
if (wait_for_completion_interruptible(x) ||
656-
p->slave_aborted) {
656+
p->target_aborted) {
657657
dev_dbg(&p->pdev->dev, "interrupted\n");
658658
return -EINTR;
659659
}
@@ -699,7 +699,7 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
699699
tx_fifo(p, tx_buf, words, fifo_shift);
700700

701701
reinit_completion(&p->done);
702-
p->slave_aborted = false;
702+
p->target_aborted = false;
703703

704704
ret = sh_msiof_spi_start(p, rx_buf);
705705
if (ret) {
@@ -796,7 +796,7 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
796796
reinit_completion(&p->done);
797797
if (tx)
798798
reinit_completion(&p->done_txdma);
799-
p->slave_aborted = false;
799+
p->target_aborted = false;
800800

801801
/* Now start DMA */
802802
if (rx)
@@ -925,7 +925,7 @@ static int sh_msiof_transfer_one(struct spi_controller *ctlr,
925925
sh_msiof_spi_reset_regs(p);
926926

927927
/* setup clocks (clock already enabled in chipselect()) */
928-
if (!spi_controller_is_slave(p->ctlr))
928+
if (!spi_controller_is_target(p->ctlr))
929929
sh_msiof_spi_set_clk_regs(p, t);
930930

931931
while (ctlr->dma_tx && len > 15) {
@@ -1101,11 +1101,11 @@ static struct sh_msiof_spi_info *sh_msiof_spi_parse_dt(struct device *dev)
11011101
if (!info)
11021102
return NULL;
11031103

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;
11061106

11071107
/* Parse the MSIOF properties */
1108-
if (info->mode == MSIOF_SPI_MASTER)
1108+
if (info->mode == MSIOF_SPI_HOST)
11091109
of_property_read_u32(np, "num-cs", &num_cs);
11101110
of_property_read_u32(np, "renesas,tx-fifo-size",
11111111
&info->tx_fifo_override);
@@ -1279,12 +1279,12 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
12791279
return -ENXIO;
12801280
}
12811281

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));
12851285
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));
12881288
if (ctlr == NULL)
12891289
return -ENOMEM;
12901290

@@ -1347,7 +1347,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
13471347
ctlr->dev.of_node = pdev->dev.of_node;
13481348
ctlr->setup = sh_msiof_spi_setup;
13491349
ctlr->prepare_message = sh_msiof_prepare_message;
1350-
ctlr->slave_abort = sh_msiof_slave_abort;
1350+
ctlr->target_abort = sh_msiof_target_abort;
13511351
ctlr->bits_per_word_mask = chipdata->bits_per_word_mask;
13521352
ctlr->auto_runtime_pm = true;
13531353
ctlr->transfer_one = sh_msiof_transfer_one;

include/linux/spi/sh_msiof.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define __SPI_SH_MSIOF_H__
44

55
enum {
6-
MSIOF_SPI_MASTER,
7-
MSIOF_SPI_SLAVE,
6+
MSIOF_SPI_HOST,
7+
MSIOF_SPI_TARGET,
88
};
99

1010
struct sh_msiof_spi_info {

0 commit comments

Comments
 (0)