[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240524182702.1317935-18-dave.stevenson@raspberrypi.com>
Date: Fri, 24 May 2024 19:27:01 +0100
From: Dave Stevenson <dave.stevenson@...pberrypi.com>
To: Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Vinod Koul <vkoul@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Ulf Hansson <ulf.hansson@...aro.org>,
Mark Brown <broonie@...nel.org>,
Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Vladimir Murzin <vladimir.murzin@....com>,
Phil Elwell <phil@...pberrypi.com>,
Stefan Wahren <wahrenst@....net>,
Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: devicetree@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
dmaengine@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
linux-mmc@...r.kernel.org,
linux-spi@...r.kernel.org,
iommu@...ts.linux.dev,
linux-sound@...r.kernel.org,
Dave Stevenson <dave.stevenson@...pberrypi.com>
Subject: [PATCH 17/18] ASoC: bcm2835-i2s: Use phys addresses for DAI DMA
From: Phil Elwell <phil@...pberrypi.com>
Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.
Signed-off-by: Phil Elwell <phil@...pberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@...pberrypi.com>
---
sound/soc/bcm/bcm2835-i2s.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c
index 9bda6499e66e..2d0fe53245f0 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>
@@ -830,8 +829,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);
@@ -846,7 +844,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);
@@ -855,19 +853,11 @@ 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);
-
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.34.1
Powered by blists - more mailing lists