bcm27xx-userland: update to latest version
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0429-staging-vchiq_arm-Give-vchiq-children-DT-nodes.patch
1 From 9f93264df7a631132f2dacd150d0cc6cb7d20fc4 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Mon, 3 Feb 2020 17:30:46 +0000
4 Subject: [PATCH] staging: vchiq_arm: Give vchiq children DT nodes
5
6 vchiq kernel clients are now instantiated as platform drivers rather
7 than using DT, but the children of the vchiq interface may still
8 benefit from access to DT properties. Give them the option of a
9 a sub-node of the vchiq parent for configuration and to allow
10 them to be disabled.
11
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
13 ---
14 .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++++++
15 1 file changed, 8 insertions(+)
16
17 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
18 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
19 @@ -3190,12 +3190,20 @@ vchiq_register_child(struct platform_dev
20 pdevinfo.id = PLATFORM_DEVID_NONE;
21 pdevinfo.dma_mask = DMA_BIT_MASK(32);
22
23 + np = of_get_child_by_name(pdev->dev.of_node, name);
24 +
25 + /* Skip the child if it is explicitly disabled */
26 + if (np && !of_device_is_available(np))
27 + return NULL;
28 +
29 child = platform_device_register_full(&pdevinfo);
30 if (IS_ERR(child)) {
31 dev_warn(&pdev->dev, "%s not registered\n", name);
32 child = NULL;
33 }
34
35 + child->dev.of_node = np;
36 +
37 /*
38 * We want the dma-ranges etc to be copied from a device with the
39 * correct dma-ranges for the VPU.