Skip to content

Commit e51e737

Browse files
committed
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 <[email protected]>
1 parent 5745a67 commit e51e737

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
22622262
struct snd_soc_dai_link *dai_link = &vc4_hdmi->audio.link;
22632263
struct snd_soc_card *card = &vc4_hdmi->audio.card;
22642264
struct device *dev = &vc4_hdmi->pdev->dev;
2265-
const __be32 *addr;
2265+
struct resource *iomem;
22662266
int index, len;
22672267
int ret;
22682268

@@ -2298,22 +2298,18 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
22982298
}
22992299

23002300
/*
2301-
* Get the physical address of VC4_HD_MAI_DATA. We need to retrieve
2302-
* the bus address specified in the DT, because the physical address
2303-
* (the one returned by platform_get_resource()) is not appropriate
2304-
* for DMA transfers.
2305-
* This VC/MMU should probably be exposed to avoid this kind of hacks.
2301+
* Get the physical address of VC4_HD_MAI_DATA.
23062302
*/
23072303
index = of_property_match_string(dev->of_node, "reg-names", "hd");
23082304
/* Before BCM2711, we don't have a named register range */
23092305
if (index < 0)
23102306
index = 1;
23112307

2312-
addr = of_get_address(dev->of_node, index, NULL, NULL);
2313-
if (!addr)
2308+
iomem = platform_get_resource(vc4_hdmi->pdev, IORESOURCE_MEM, index);
2309+
if (!iomem)
23142310
return -EINVAL;
23152311

2316-
vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset;
2312+
vc4_hdmi->audio.dma_data.addr = iomem->start + mai_data->offset;
23172313
vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
23182314
vc4_hdmi->audio.dma_data.maxburst = 2;
23192315

0 commit comments

Comments
 (0)