Skip to content

Commit 4e92abd

Browse files
NXP-CarlosSongbroonie
authored andcommitted
spi: imx: add i.MX51 ECSPI target mode support
ECSPI in i.MX51 and i.MX53 support target mode. Current code only support i.MX53. Remove is_imx53_ecspi() check for target mode to support i.MX51. Signed-off-by: Carlos Song <carlos.song@nxp.com> Link: https://patch.msgid.link/20251027110256.543314-1-carlos.song@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 55d03b5 commit 4e92abd

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/spi/spi-imx.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ static int mx51_ecspi_prepare_message(struct spi_imx_data *spi_imx,
586586
* is not functional for imx53 Soc, config SPI burst completed when
587587
* BURST_LENGTH + 1 bits are received
588588
*/
589-
if (spi_imx->target_mode && is_imx53_ecspi(spi_imx))
589+
if (spi_imx->target_mode)
590590
cfg &= ~MX51_ECSPI_CONFIG_SBBCTRL(channel);
591591
else
592592
cfg |= MX51_ECSPI_CONFIG_SBBCTRL(channel);
@@ -674,7 +674,7 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
674674

675675
/* Clear BL field and set the right value */
676676
ctrl &= ~MX51_ECSPI_CTRL_BL_MASK;
677-
if (spi_imx->target_mode && is_imx53_ecspi(spi_imx))
677+
if (spi_imx->target_mode)
678678
ctrl |= (spi_imx->target_burst * 8 - 1)
679679
<< MX51_ECSPI_CTRL_BL_OFFSET;
680680
else {
@@ -1367,7 +1367,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
13671367
spi_imx->rx_only = ((t->tx_buf == NULL)
13681368
|| (t->tx_buf == spi->controller->dummy_tx));
13691369

1370-
if (is_imx53_ecspi(spi_imx) && spi_imx->target_mode) {
1370+
if (spi_imx->target_mode) {
13711371
spi_imx->rx = mx53_ecspi_rx_target;
13721372
spi_imx->tx = mx53_ecspi_tx_target;
13731373
spi_imx->target_burst = t->len;
@@ -1641,8 +1641,7 @@ static int spi_imx_pio_transfer_target(struct spi_device *spi,
16411641
struct spi_imx_data *spi_imx = spi_controller_get_devdata(spi->controller);
16421642
int ret = 0;
16431643

1644-
if (is_imx53_ecspi(spi_imx) &&
1645-
transfer->len > MX53_MAX_TRANSFER_BYTES) {
1644+
if (transfer->len > MX53_MAX_TRANSFER_BYTES) {
16461645
dev_err(&spi->dev, "Transaction too big, max size is %d bytes\n",
16471646
MX53_MAX_TRANSFER_BYTES);
16481647
return -EMSGSIZE;

0 commit comments

Comments
 (0)