From patchwork Thu Dec 6 18:28:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10716575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BACA109C for ; Thu, 6 Dec 2018 18:30:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0FEB2F0D3 for ; Thu, 6 Dec 2018 18:30:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E942F0F0; Thu, 6 Dec 2018 18:30:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB51C2F0DD for ; Thu, 6 Dec 2018 18:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NgABWu4GRYKy/lijhCcDhHoYii2Jm/QwlleXvChqrZU=; b=fcBKQmWiro0F2T8Fo69y0mfLRT 9Htlfa+C1k5iX+MdTkveb7RYKuRUd2wz9VBCS7ZS73vBPfnhOrojkIvPc5OEbB9pPyyhXmuKOCKeX mOMDcsCci6gtqe6K95ePv6qYpOYyVfgRF2zy2r7SH38WAE88aI3AoM3qCoAMLQdQArmKJoZdGHwSm wjwl9ZkPpG02EGNxJLb9dJgyc3ApSct/uEp4GEKq8QtyQtdLWtdSXoe86B+TErLz5FAaklttn6odw quxbXcza9sx8AITrF0UFIdZNc8s8Gms9xa23JnB7wt8JjQ0+VujU16zPHg7r8hLwBkvhUStad9tKe GwpnE/qA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUyPW-0005c1-Cl; Thu, 06 Dec 2018 18:30:06 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUyOv-0004op-8B for linux-arm-kernel@lists.infradead.org; Thu, 06 Dec 2018 18:29:32 +0000 Received: from localhost.localdomain ([37.4.249.153]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1My6xz-1hPQQl0J2N-00zVej; Thu, 06 Dec 2018 19:29:08 +0100 From: Stefan Wahren To: Greg Kroah-Hartman Subject: [PATCH 04/10] staging: vchiq_arm: Fix camera device registration Date: Thu, 6 Dec 2018 19:28:54 +0100 Message-Id: <1544120940-13716-5-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544120940-13716-1-git-send-email-stefan.wahren@i2se.com> References: <1544120940-13716-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:RNRNSadj1RZ7N0BB46g43eo8zHPBOZ2r0T7RdX4o8WKt2QdxAFq K13hprJK3vI3c91hc7EmexEbjsm1+/hQNxELBlsUxo4zkAe7i1X0omqaI0a5NQ1WdPPcIsc XzDkAFOEkgo2qDodXzINNOyy/874cmqLTubTwPs6GGPTN4UBDXNyU1iuk5D4sZzB1UAncRJ zY4tWnCqWGclN6Oqen9Zg== X-UI-Out-Filterresults: notjunk:1;V03:K0:q2AQONZiF9k=:RfmJ336hL9J4YbW/0KhHqh IqwUORzWl2OYOBp7xNqQEFHqWmIU6d6mdzdGzV4pop4G3F9uIkvc4GyL7OSFfNub45jLo5Fy0 2CoHTH1r+VzLlnDubJA6WFebKWklxERzI6N4SxKJetBBjPIrkfrrRD99YWLBJzFWpzu4ZY+6r bMtdJIXUpVbTGXYzEWO8vfX7yN8LAjlCgq3gdL1rPLtcqCper6pkGpcsE8BLUqOR/Dt3mDJoW 5H2wsaaLiRWgEzIr1/gNM3+7TIzDpF7kEfS7WGvhEVss3IvO+NbtAkdgkVY3ZZlZn+LqZ78dZ GxQ2ePenRP84jUn8YWpbquAqTvrB1e/AtHndPo7mO26fLCPn726ZhRj4h6Imo+oq8K85OfQwo +wnN0okzxNarLLieurlsQNV79JmN6dcdTQr4pNwnmq7KvUCtISvrhFEHIIk/KuQ8pP6bmMg4Z otW5muf10OHoqNRx6vNVhZf27e7sjN6BKogTi9wt+IEMTB4GJVz+qoq0vNqQjzeHLoqn1hhDd hwTAWU/gAc1N2/9EVjYsVId1Ou09+U4taNUgTwUBUNCbMaeDlLlRqWW4XDGNUeRixEEiOY5uu FDf96U82izST978h5w89c2wYXSEHE2HBGsxK/n1qu7tq1FRjYxVLUl8rAEZiqnu5G9SOaIbKL PGmm+bRfjMQGolrZM5UGtozrnTV2AkHJDfqUtnQA/rMn9c1fxOGXXObJA85RoQG1x3F2XSaC2 1d6mKBH8p8C5TcvYbY5VIdnq6XVMO4Q36ckSW/qWHk0ubd3He7dwHXGNv0A= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181206_102929_591775_D85A2FCD X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Stefan Wahren , Takashi Iwai , Eric Anholt , linux-arm-kernel@lists.infradead.org, Dave Stevenson , Nicolas Saenz Julienne MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 27 +++++++++++++++++++--- 1 file changed, 24 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 0caee2d..f2c1dcd 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 #include #include +#include #include #include "vchiq_core.h" @@ -3479,6 +3480,28 @@ 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; + struct platform_device *child; + + memset(&pdevinfo, 0, sizeof(pdevinfo)); + + pdevinfo.parent = &pdev->dev; + pdevinfo.name = name; + pdevinfo.id = PLATFORM_DEVID_NONE; + pdevinfo.dma_mask = DMA_BIT_MASK(32); + + child = platform_device_register_full(&pdevinfo); + if (IS_ERR(child)) { + dev_warn(&pdev->dev, "%s not registered\n", name); + child = NULL; + } + + return child; +} + static int vchiq_probe(struct platform_device *pdev) { struct device_node *fw_node; @@ -3529,9 +3552,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;