2504a07083ef18681dda5d653df3f00984bb8be8
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0603-drm-vc4-Use-reg-names-to-configure-HDMI-audio.patch
1 From 7a463d59a0539cdf79ee6f1fe6c52f0a487ee63e Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 25 Mar 2020 18:11:41 +0000
4 Subject: [PATCH] drm/vc4: Use reg-names to configure HDMI audio.
5
6 HDMI audio configuration was using fixed index numbers to
7 load in DT register settings.
8 Switch to using reg-names for flexibility and to match Pi4.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
14
15 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
16 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
17 @@ -1097,6 +1097,7 @@ static int vc4_hdmi_audio_init(struct vc
18 struct snd_soc_card *card = &vc4_hdmi->audio.card;
19 struct device *dev = &vc4_hdmi->pdev->dev;
20 const __be32 *addr;
21 + int index;
22 int ret;
23 int len;
24
25 @@ -1122,7 +1123,9 @@ static int vc4_hdmi_audio_init(struct vc
26 * for DMA transfers.
27 * This VC/MMU should probably be exposed to avoid this kind of hacks.
28 */
29 - addr = of_get_address(dev->of_node, 1, NULL, NULL);
30 + index = of_property_match_string(dev->of_node, "reg-names", "hd");
31 + addr = of_get_address(dev->of_node, index, NULL, NULL);
32 +
33 vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset;
34 vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
35 vc4_hdmi->audio.dma_data.maxburst = 2;