[PATCH 2/2] dmaengine: pl08x: Use the channel count from the device tree

From: David Yang

Date: Wed Nov 04 2026 - 10:58:53 EST


The Hi3798MV100 DMAC is a plain PL080 except for the channel count: 4
instead of 8. The part ID does not say, and the driver takes the count
from the matched vendor_data entry. dma-common.yaml already defines
dma-channels for a controller node. Honor it.

Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
---
drivers/dma/amba-pl08x.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 33ad6c42cd7f..9bcb4a3cd5a0 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -2698,6 +2698,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
struct device_node *np = adev->dev.of_node;
struct reset_control *rst;
u32 tsfr_size;
+ u32 channels;
int ret = 0;
int i;

@@ -2759,6 +2760,16 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
vd->dualmaster = !!(val & BIT(9));
}

+ /* Read the channel number from the node if specified */
+ if (!of_property_read_u32(np, "dma-channels", &channels) && channels) {
+ if (channels > vd->channels)
+ dev_warn(&adev->dev,
+ "using %u channels, instead of %u from the node\n",
+ vd->channels, channels);
+ else
+ vd->channels = channels;
+ }
+
/* Initialize memcpy engine */
dma_cap_set(DMA_MEMCPY, pl08x->memcpy.cap_mask);
pl08x->memcpy.dev = &adev->dev;
--
2.53.0