1 From 3fde6b7152cb9153e404a17b731188acadf1ddd9 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
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
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++++++
15 1 file changed, 8 insertions(+)
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 @@ -1785,12 +1785,20 @@ vchiq_register_child(struct platform_dev
20 pdevinfo.id = PLATFORM_DEVID_NONE;
21 pdevinfo.dma_mask = DMA_BIT_MASK(32);
23 + np = of_get_child_by_name(pdev->dev.of_node, name);
25 + /* Skip the child if it is explicitly disabled */
26 + if (np && !of_device_is_available(np))
29 child = platform_device_register_full(&pdevinfo);
31 dev_warn(&pdev->dev, "%s not registered\n", name);
35 + child->dev.of_node = np;
38 * We want the dma-ranges etc to be copied from a device with the
39 * correct dma-ranges for the VPU.