[PATCH v3 17/28] ASoC: bcm2835-i2s: Pass the CPU physical address of the FIFO to the DMA engine

From: Andrea della Porta

Date: Mon Nov 23 2026 - 09:55:00 EST


The address of the DMA slave is handed to the DMA engine through the
dma_slave_config, where it is meant to be a CPU physical address that
the DMA controller driver translates into its own view of the bus. The
driver instead reads the untranslated address out of its reg property,
which only happens to be what the BCM2835 DMA controller expects because
the DMA engine driver used the address verbatim.

Now that the DMA engine driver translates slave addresses itself, use the
CPU physical address of the register resource, which also gets rid of
the open coded parsing of the DT node.

Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
---
sound/soc/bcm/bcm2835-i2s.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c
index 208977828254..ad95412cc8b5 100644
--- a/sound/soc/bcm/bcm2835-i2s.c
+++ b/sound/soc/bcm/bcm2835-i2s.c
@@ -30,7 +30,6 @@
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
-#include <linux/of_address.h>
#include <linux/slab.h>

#include <sound/core.h>
@@ -843,8 +842,7 @@ static int bcm2835_i2s_probe(struct platform_device *pdev)
struct bcm2835_i2s_dev *dev;
int ret;
void __iomem *base;
- const __be32 *addr;
- dma_addr_t dma_base;
+ struct resource *res;

dev = devm_kzalloc(&pdev->dev, sizeof(*dev),
GFP_KERNEL);
@@ -859,7 +857,7 @@ static int bcm2835_i2s_probe(struct platform_device *pdev)
"could not get clk\n");

/* Request ioarea */
- base = devm_platform_ioremap_resource(pdev, 0);
+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(base))
return PTR_ERR(base);

@@ -868,19 +866,12 @@ static int bcm2835_i2s_probe(struct platform_device *pdev)
if (IS_ERR(dev->i2s_regmap))
return PTR_ERR(dev->i2s_regmap);

- /* Set the DMA address - we have to parse DT ourselves */
- addr = of_get_address(pdev->dev.of_node, 0, NULL, NULL);
- if (!addr) {
- dev_err(&pdev->dev, "could not get DMA-register address\n");
- return -EINVAL;
- }
- dma_base = be32_to_cpup(addr);
-
+ /* Set the DMA address, the DMA engine translates it */
dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr =
- dma_base + BCM2835_I2S_FIFO_A_REG;
+ res->start + BCM2835_I2S_FIFO_A_REG;

dev->dma_data[SNDRV_PCM_STREAM_CAPTURE].addr =
- dma_base + BCM2835_I2S_FIFO_A_REG;
+ res->start + BCM2835_I2S_FIFO_A_REG;

/* Set the bus width */
dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr_width =
--
2.51.0