@@ -54,7 +54,7 @@ struct sh_msiof_spi_priv {
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,7 +361,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, u32 ss,
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,7 +553,7 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
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,47 +602,47 @@ static int sh_msiof_prepare_message(struct spi_controller *ctlr,
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 );
613
613
if (!ret )
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 ;
621
621
}
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,9 +651,9 @@ static int sh_msiof_slave_abort(struct spi_controller *ctlr)
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,7 +699,7 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
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,7 +796,7 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
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,7 +925,7 @@ static int sh_msiof_transfer_one(struct spi_controller *ctlr,
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,11 +1101,11 @@ static struct sh_msiof_spi_info *sh_msiof_spi_parse_dt(struct device *dev)
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,12 +1279,12 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
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,7 +1347,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
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 ;
0 commit comments