diff mbox series

[2/4] dmaengine: imx-sdma: Support 24bit/3bytes for sg mode

Message ID 20240303-sdma_upstream-v1-2-869cd0165b09@nxp.com (mailing list archive)
State Superseded
Headers show
Series dmaengine: fsl-sdma: Some improvement for fsl-sdma | expand

Commit Message

Frank Li March 4, 2024, 4:32 a.m. UTC
From: Shengjiu Wang <shengjiu.wang@nxp.com>

Update 3bytes buswidth that is supported by sdma.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/dma/imx-sdma.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Joy Zou March 7, 2024, 9:05 a.m. UTC | #1
> -----Original Message-----
> From: Frank Li <frank.li@nxp.com>
> Sent: 2024年3月4日 12:33
> To: Vinod Koul <vkoul@kernel.org>; Shawn Guo <shawnguo@kernel.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> dl-linux-imx <linux-imx@nxp.com>
> Cc: dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; imx@lists.linux.dev; Frank Li
> <frank.li@nxp.com>; S.J. Wang <shengjiu.wang@nxp.com>; Vipul Kumar
> <vipul_kumar@mentor.com>; Srikanth Krishnakar
> <Srikanth_Krishnakar@mentor.com>; Robin Gong <yibin.gong@nxp.com>
> Subject: [PATCH 2/4] dmaengine: imx-sdma: Support 24bit/3bytes for sg
> mode
> 
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> Update 3bytes buswidth that is supported by sdma.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
> Acked-by: Robin Gong <yibin.gong@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Joy Zou <joy.zou@nxp.com>
BR
Joy Zou
> ---
>  drivers/dma/imx-sdma.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index
> 9a6d8f1e9ff63..ef45420485dac 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -176,6 +176,7 @@
> 
>  #define SDMA_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE)
> | \
>  				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
> +				 BIT(DMA_SLAVE_BUSWIDTH_3_BYTES) | \
>  				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
> 
>  #define SDMA_DMA_DIRECTIONS	(BIT(DMA_DEV_TO_MEM) | \
> @@ -1659,6 +1660,9 @@ static struct dma_async_tx_descriptor
> *sdma_prep_slave_sg(
>  			if (count & 3 || sg->dma_address & 3)
>  				goto err_bd_out;
>  			break;
> +		case DMA_SLAVE_BUSWIDTH_3_BYTES:
> +			bd->mode.command = 3;
> +			break;
>  		case DMA_SLAVE_BUSWIDTH_2_BYTES:
>  			bd->mode.command = 2;
>  			if (count & 1 || sg->dma_address & 1)
> 
> --
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 9a6d8f1e9ff63..ef45420485dac 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -176,6 +176,7 @@ 
 
 #define SDMA_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
 				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
+				 BIT(DMA_SLAVE_BUSWIDTH_3_BYTES) | \
 				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
 
 #define SDMA_DMA_DIRECTIONS	(BIT(DMA_DEV_TO_MEM) | \
@@ -1659,6 +1660,9 @@  static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
 			if (count & 3 || sg->dma_address & 3)
 				goto err_bd_out;
 			break;
+		case DMA_SLAVE_BUSWIDTH_3_BYTES:
+			bd->mode.command = 3;
+			break;
 		case DMA_SLAVE_BUSWIDTH_2_BYTES:
 			bd->mode.command = 2;
 			if (count & 1 || sg->dma_address & 1)