aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0341-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch
blob: c73141de27bd831195fabcbe5a215f96ed46b447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From a42314a829d8a17ccfd533c90339348b09e85de8 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Tue, 29 Jan 2019 16:13:25 +0000
Subject: [PATCH 341/725] staging: vchiq_arm: Set up dma ranges on child
 devices

The VCHIQ driver now loads the audio, camera, codec, and vc-sm
drivers as platform drivers. However they were not being given
the correct DMA configuration.

Call of_dma_configure with the parent (VCHIQ) parameters to be
inherited by the child.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -3585,6 +3585,7 @@ static struct platform_device *
 vchiq_register_child(struct platform_device *pdev, const char *name)
 {
 	struct platform_device_info pdevinfo;
+	struct platform_device *new_dev;
 
 	memset(&pdevinfo, 0, sizeof(pdevinfo));
 
@@ -3593,7 +3594,17 @@ vchiq_register_child(struct platform_dev
 	pdevinfo.id = PLATFORM_DEVID_NONE;
 	pdevinfo.dma_mask = DMA_BIT_MASK(32);
 
-	return platform_device_register_full(&pdevinfo);
+	new_dev = platform_device_register_full(&pdevinfo);
+	if (!new_dev)
+		return NULL;
+
+	/*
+	 * We want the dma-ranges etc to be copied from the parent VCHIQ device
+	 * to be passed on to the children too.
+	 */
+	of_dma_configure(&new_dev->dev, pdev->dev.of_node, true);
+
+	return new_dev;
 }
 
 static int vchiq_probe(struct platform_device *pdev)