From: Dave Stevenson Date: Tue, 29 Jan 2019 16:13:25 +0000 (+0000) Subject: staging: vchiq_arm: Set up dma ranges on child devices X-Git-Tag: accepted/tizen/unified/20190614.051536~337 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe3d48724cf1c1ae1e8bb496556bf9b0c902010d;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 40e8e04..b955fe7 100644 --- 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_device *pdev, const char *name) 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)