brcm2708: add linux 4.19 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0230-staging-vchiq_arm-Fix-camera-device-registration.patch
1 From 1134ea85e8c3870ee3d31bb6acb4326d0f674d6a Mon Sep 17 00:00:00 2001
2 From: Stefan Wahren <stefan.wahren@i2se.com>
3 Date: Mon, 22 Oct 2018 15:16:51 +0200
4 Subject: [PATCH 230/703] staging: vchiq_arm: Fix camera device registration
5
6 Since the camera driver isn't probed via DT, we need to properly setup DMA.
7
8 Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.")
9 Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
10 ---
11 .../interface/vchiq_arm/vchiq_arm.c | 20 ++++++++++++++++---
12 1 file changed, 17 insertions(+), 3 deletions(-)
13
14 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
15 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
16 @@ -49,6 +49,7 @@
17 #include <linux/of.h>
18 #include <linux/platform_device.h>
19 #include <linux/compat.h>
20 +#include <linux/dma-mapping.h>
21 #include <soc/bcm2835/raspberrypi-firmware.h>
22
23 #include "vchiq_core.h"
24 @@ -3578,6 +3579,21 @@ void vchiq_platform_conn_state_changed(V
25 }
26 }
27
28 +static struct platform_device *
29 +vchiq_register_child(struct platform_device *pdev, const char *name)
30 +{
31 + struct platform_device_info pdevinfo;
32 +
33 + memset(&pdevinfo, 0, sizeof(pdevinfo));
34 +
35 + pdevinfo.parent = &pdev->dev;
36 + pdevinfo.name = name;
37 + pdevinfo.id = PLATFORM_DEVID_NONE;
38 + pdevinfo.dma_mask = DMA_BIT_MASK(32);
39 +
40 + return platform_device_register_full(&pdevinfo);
41 +}
42 +
43 static int vchiq_probe(struct platform_device *pdev)
44 {
45 struct device_node *fw_node;
46 @@ -3637,9 +3653,7 @@ static int vchiq_probe(struct platform_d
47 VCHIQ_VERSION, VCHIQ_VERSION_MIN,
48 MAJOR(vchiq_devid), MINOR(vchiq_devid));
49
50 - bcm2835_camera = platform_device_register_data(&pdev->dev,
51 - "bcm2835-camera", -1,
52 - NULL, 0);
53 + bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera");
54
55 return 0;
56