brcm2708: add linux 4.19 support
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0344-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch
1 From 0a0aaf192a20f9c5552c0fca4f5b29c3d31784ab 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 344/703] staging: vchiq_arm: Set up dma ranges on child
5  devices
6
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.
10
11 Call of_dma_configure with the parent (VCHIQ) parameters to be
12 inherited by the child.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
15 ---
16  .../vc04_services/interface/vchiq_arm/vchiq_arm.c   | 13 ++++++++++++-
17  1 file changed, 12 insertions(+), 1 deletion(-)
18
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)
23  {
24         struct platform_device_info pdevinfo;
25 +       struct platform_device *new_dev;
26  
27         memset(&pdevinfo, 0, sizeof(pdevinfo));
28  
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);
32  
33 -       return platform_device_register_full(&pdevinfo);
34 +       new_dev = platform_device_register_full(&pdevinfo);
35 +       if (!new_dev)
36 +               return NULL;
37 +
38 +       /*
39 +        * We want the dma-ranges etc to be copied from the parent VCHIQ device
40 +        * to be passed on to the children too.
41 +        */
42 +       of_dma_configure(&new_dev->dev, pdev->dev.of_node, true);
43 +
44 +       return new_dev;
45  }
46  
47  static int vchiq_probe(struct platform_device *pdev)