From 8b191103d74d981f616990bd93d28358b89efaab Mon Sep 17 00:00:00 2001 From: Phi Bang Nguyen Date: Tue, 13 Feb 2024 15:19:06 +0100 Subject: [PATCH] drivers: dma: pxp: Add support for ARGB8888 format Add support for ARGB8888 pixel format as the camera pipeline on i.MX RT11xx could output images in this format Signed-off-by: Phi Bang Nguyen --- drivers/dma/dma_mcux_pxp.c | 5 +++++ include/zephyr/drivers/dma/dma_mcux_pxp.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dma_mcux_pxp.c b/drivers/dma/dma_mcux_pxp.c index 95ae1949a34..88f8f39f34b 100644 --- a/drivers/dma/dma_mcux_pxp.c +++ b/drivers/dma/dma_mcux_pxp.c @@ -99,6 +99,11 @@ static int dma_mcux_pxp_configure(const struct device *dev, uint32_t channel, output_buffer_cfg.pixelFormat = kPXP_OutputPixelFormatRGB888; bytes_per_pixel = 3; break; + case DMA_MCUX_PXP_FMT_ARGB8888: + ps_buffer_cfg.pixelFormat = kPXP_PsPixelFormatARGB8888; + output_buffer_cfg.pixelFormat = kPXP_OutputPixelFormatARGB8888; + bytes_per_pixel = 4; + break; default: return -ENOTSUP; } diff --git a/include/zephyr/drivers/dma/dma_mcux_pxp.h b/include/zephyr/drivers/dma/dma_mcux_pxp.h index 6144db70238..7cddab2c3ef 100644 --- a/include/zephyr/drivers/dma/dma_mcux_pxp.h +++ b/include/zephyr/drivers/dma/dma_mcux_pxp.h @@ -34,7 +34,8 @@ #define DMA_MCUX_PXP_CMD_ROTATE_180 2 #define DMA_MCUX_PXP_CMD_ROTATE_270 3 -#define DMA_MCUX_PXP_FMT_RGB565 0 -#define DMA_MCUX_PXP_FMT_RGB888 1 +#define DMA_MCUX_PXP_FMT_RGB565 0 +#define DMA_MCUX_PXP_FMT_RGB888 1 +#define DMA_MCUX_PXP_FMT_ARGB8888 2 #endif /* ZEPHYR_INCLUDE_DRIVERS_DMA_MCUX_PXP_H_ */