1 From a42314a829d8a17ccfd533c90339348b09e85de8 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 29 Jan 2019 16:13:25 +0000
4 Subject: [PATCH 341/725] staging: vchiq_arm: Set up dma ranges on child
7 The VCHIQ driver now loads the audio, camera, codec, and vc-sm
8 drivers as platform drivers. However they were not being given
9 the correct DMA configuration.
11 Call of_dma_configure with the parent (VCHIQ) parameters to be
12 inherited by the child.
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
16 .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 13 ++++++++++++-
17 1 file changed, 12 insertions(+), 1 deletion(-)
19 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
20 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
21 @@ -3585,6 +3585,7 @@ static struct platform_device *
22 vchiq_register_child(struct platform_device *pdev, const char *name)
24 struct platform_device_info pdevinfo;
25 + struct platform_device *new_dev;
27 memset(&pdevinfo, 0, sizeof(pdevinfo));
29 @@ -3593,7 +3594,17 @@ vchiq_register_child(struct platform_dev
30 pdevinfo.id = PLATFORM_DEVID_NONE;
31 pdevinfo.dma_mask = DMA_BIT_MASK(32);
33 - return platform_device_register_full(&pdevinfo);
34 + new_dev = platform_device_register_full(&pdevinfo);
39 + * We want the dma-ranges etc to be copied from the parent VCHIQ device
40 + * to be passed on to the children too.
42 + of_dma_configure(&new_dev->dev, pdev->dev.of_node, true);
47 static int vchiq_probe(struct platform_device *pdev)