All of lore.kernel.org
 help / color / mirror / Atom feed
From: stefan.wahren@i2se.com (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 05/11] staging: vchiq_arm: Fix camera device registration
Date: Thu, 25 Oct 2018 17:29:29 +0200	[thread overview]
Message-ID: <1540481375-15952-6-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1540481375-15952-1-git-send-email-stefan.wahren@i2se.com>

Since the camera driver isn't probed via DT, we need to properly setup DMA.

Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c    | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

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 d7d7c2f0..778a252 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -49,6 +49,7 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/compat.h>
+#include <linux/dma-mapping.h>
 #include <soc/bcm2835/raspberrypi-firmware.h>
 
 #include "vchiq_core.h"
@@ -3588,6 +3589,21 @@ static const struct of_device_id vchiq_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, vchiq_of_match);
 
+static struct platform_device *
+vchiq_register_child(struct platform_device *pdev, const char *name)
+{
+	struct platform_device_info pdevinfo;
+
+	memset(&pdevinfo, 0, sizeof(pdevinfo));
+
+	pdevinfo.parent = &pdev->dev;
+	pdevinfo.name = name;
+	pdevinfo.id = PLATFORM_DEVID_NONE;
+	pdevinfo.dma_mask = DMA_BIT_MASK(32);
+
+	return platform_device_register_full(&pdevinfo);
+}
+
 static int vchiq_probe(struct platform_device *pdev)
 {
 	struct device_node *fw_node;
@@ -3653,9 +3669,7 @@ static int vchiq_probe(struct platform_device *pdev)
 		VCHIQ_VERSION, VCHIQ_VERSION_MIN,
 		MAJOR(vchiq_devid), MINOR(vchiq_devid));
 
-	bcm2835_camera = platform_device_register_data(&pdev->dev,
-						       "bcm2835-camera", -1,
-						       NULL, 0);
+	bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera");
 
 	return 0;
 
-- 
2.7.4

  parent reply	other threads:[~2018-10-25 15:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 15:29 [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload Stefan Wahren
2018-10-25 15:29 ` [PATCH RFC 01/11] staging: bcm2835-camera: Abort probe if there is no camera Stefan Wahren
2018-12-19  8:07   ` Peter Robinson
2018-10-25 15:29 ` [PATCH RFC 02/11] staging: bcm2835-camera: fix module autoloading Stefan Wahren
2018-12-19  7:54   ` Peter Robinson
2018-10-25 15:29 ` [PATCH RFC 03/11] staging: bcm2835-camera: Move module info to the end Stefan Wahren
2018-12-19  7:53   ` Peter Robinson
2018-10-25 15:29 ` [PATCH RFC 04/11] staging: vchiq_arm: Fix platform device unregistration Stefan Wahren
2018-10-26  8:07   ` Dan Carpenter
2018-10-25 15:29 ` Stefan Wahren [this message]
2018-10-25 15:29 ` [PATCH RFC 06/11] staging: vchiq_arm: Register a platform device for audio Stefan Wahren
2018-10-26  8:09   ` Dan Carpenter
2018-10-26  8:18     ` Dan Carpenter
2018-10-25 15:29 ` [PATCH RFC 07/11] staging: bcm2835-audio: Enable compile test Stefan Wahren
2018-10-25 15:29 ` [PATCH RFC 08/11] staging: bcm2835-audio: use module_platform_driver() macro Stefan Wahren
2018-10-25 15:29 ` [PATCH RFX 09/11] staging: bcm2835-audio: Drop DT dependency Stefan Wahren
2018-10-25 15:29 ` [PATCH RFC 10/11] staging: bcm2835-camera: Provide more specific probe error messages Stefan Wahren
2018-10-25 15:29 ` [PATCH RFC 11/11] staging: bcm2835-camera: Add hint about possible faulty config Stefan Wahren
2018-10-26 10:55   ` Nicolas Saenz Julienne
2018-10-26 11:06 ` [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload Nicolas Saenz Julienne
2018-10-28 20:10   ` Stefan Wahren
2019-01-08  7:21 ` Peter Robinson
2019-01-08  8:48   ` Stefan Wahren
2019-01-08  8:56     ` Peter Robinson
2019-01-08 10:20       ` Stefan Wahren
2019-01-10  5:09         ` Peter Robinson
2019-01-10  6:24           ` Stefan Wahren
2019-01-10  6:34             ` Peter Robinson
2019-01-10 18:48               ` Stefan Wahren
2019-01-11  6:10                 ` Peter Robinson
2019-01-11 16:43                   ` Dave Stevenson
2019-01-12  5:26                     ` Peter Robinson
2019-01-10  7:05             ` Peter Robinson
2019-01-08 17:10   ` Dave Stevenson
2019-01-09  8:33     ` Stefan Wahren
2019-01-09 11:58       ` Nicolas Saenz Julienne
2019-01-10  5:22     ` Peter Robinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540481375-15952-6-git-send-email-stefan.wahren@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.