1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/6.6/target/linux/bcm27xx/patches-6.6/0465-drm-vc4-Use-phys-addresses-for-slave-DMA-config.patch
Ycarus (Yannick Chabanois) 12de1d2995 Add RPI kernel 6.6 support
2024-04-05 20:55:33 +02:00

53 lines
2 KiB
Diff

From b0465659003ba35bb7d6c9a4b670c43ac9632333 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 11 May 2023 16:08:15 +0100
Subject: [PATCH 0465/1002] drm/vc4: Use phys addresses for slave DMA config
Slave addresses for DMA are meant to be supplied as physical addresses
(contrary to what struct snd_dmaengine_dai_dma_data does).
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index b2c1e637d27a..f1d9c27e8794 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2689,7 +2689,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
struct snd_soc_card *card = &vc4_hdmi->audio.card;
struct device *dev = &vc4_hdmi->pdev->dev;
struct platform_device *codec_pdev;
- const __be32 *addr;
+ struct resource *iomem;
int index, len;
int ret;
@@ -2725,20 +2725,15 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
}
/*
- * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve
- * the bus address specified in the DT, because the physical address
- * (the one returned by platform_get_resource()) is not appropriate
- * for DMA transfers.
- * This VC/MMU should probably be exposed to avoid this kind of hacks.
+ * Get the physical address of VC4_HD_MAI_DATA.
*/
index = of_property_match_string(dev->of_node, "reg-names", "hd");
/* Before BCM2711, we don't have a named register range */
if (index < 0)
index = 1;
+ iomem = platform_get_resource(vc4_hdmi->pdev, IORESOURCE_MEM, index);
- addr = of_get_address(dev->of_node, index, NULL, NULL);
-
- vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset;
+ vc4_hdmi->audio.dma_data.addr = iomem->start + mai_data->offset;
vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
vc4_hdmi->audio.dma_data.maxburst = 2;
--
2.44.0