drivers/spi/spi-imx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
From: Carlos Song <carlos.song@nxp.com>
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>
---
Change for V2:
- Change patch name and commit log
- Remove target_max_transfer_bytes from devtype_data
---
drivers/spi/spi-imx.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 64b7e977dcc1..9a1113ea4ba2 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -594,7 +594,7 @@ static int mx51_ecspi_prepare_message(struct spi_imx_data *spi_imx,
* is not functional for imx53 Soc, config SPI burst completed when
* BURST_LENGTH + 1 bits are received
*/
- if (spi_imx->target_mode && is_imx53_ecspi(spi_imx))
+ if (spi_imx->target_mode)
cfg &= ~MX51_ECSPI_CONFIG_SBBCTRL(channel);
else
cfg |= MX51_ECSPI_CONFIG_SBBCTRL(channel);
@@ -682,7 +682,7 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
/* Clear BL field and set the right value */
ctrl &= ~MX51_ECSPI_CTRL_BL_MASK;
- if (spi_imx->target_mode && is_imx53_ecspi(spi_imx))
+ if (spi_imx->target_mode)
ctrl |= (spi_imx->target_burst * 8 - 1)
<< MX51_ECSPI_CTRL_BL_OFFSET;
else {
@@ -1375,7 +1375,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
spi_imx->rx_only = ((t->tx_buf == NULL)
|| (t->tx_buf == spi->controller->dummy_tx));
- if (is_imx53_ecspi(spi_imx) && spi_imx->target_mode) {
+ if (spi_imx->target_mode) {
spi_imx->rx = mx53_ecspi_rx_target;
spi_imx->tx = mx53_ecspi_tx_target;
spi_imx->target_burst = t->len;
@@ -1649,8 +1649,7 @@ static int spi_imx_pio_transfer_target(struct spi_device *spi,
struct spi_imx_data *spi_imx = spi_controller_get_devdata(spi->controller);
int ret = 0;
- if (is_imx53_ecspi(spi_imx) &&
- transfer->len > MX53_MAX_TRANSFER_BYTES) {
+ if (transfer->len > MX53_MAX_TRANSFER_BYTES) {
dev_err(&spi->dev, "Transaction too big, max size is %d bytes\n",
MX53_MAX_TRANSFER_BYTES);
return -EMSGSIZE;
--
2.34.1
On Mon, 27 Oct 2025 19:02:56 +0800, carlos.song@nxp.com wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: imx: add i.MX51 ECSPI target mode support
commit: 4e92abd0a11b91af3742197a9ca962c3c00d0948
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
© 2016 - 2026 Red Hat, Inc.