From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0069C3A5A9 for ; Mon, 4 May 2020 09:26:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7EFC20757 for ; Mon, 4 May 2020 09:26:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YF1cIwjY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728439AbgEDJ0x (ORCPT ); Mon, 4 May 2020 05:26:53 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56776 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728401AbgEDJ0v (ORCPT ); Mon, 4 May 2020 05:26:51 -0400 Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4947F304; Mon, 4 May 2020 11:26:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588584407; bh=kA6YRPSNeFZEAYiNKAMVdXCXB8iBJh1FSsBXbLabxA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YF1cIwjY386T5teD5tz/eZo/fhmr0WIwlSLS22a9kQ2ANKWax3ASPFkk/KjCtKtTs 5oYR7xbpS42NtMRshv3wQ50xnFzVixudHsh3BxOBZgF69aTIOMdVxQxcc9zR1JwfHa r2ObMFn2U7bEEpdy0bbaVh4jxYM3Z66U/FxPvkAA= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Kieran Bingham , Jacopo Mondi , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Naushir Patuck , Dave Stevenson , Phil Elwell Subject: [PATCH v2 30/34] staging: vchiq_arm: Give vchiq children DT nodes Date: Mon, 4 May 2020 12:26:07 +0300 Message-Id: <20200504092611.9798-31-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> References: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Phil Elwell vchiq kernel clients are now instantiated as platform drivers rather than using DT, but the children of the vchiq interface may still benefit from access to DT properties. Give them the option of a a sub-node of the vchiq parent for configuration and to allow them to be disabled. Signed-off-by: Phil Elwell Signed-off-by: Jacopo Mondi --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 dd3c8f829daa..2325ab825941 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2734,12 +2734,20 @@ vchiq_register_child(struct platform_device *pdev, const char *name) pdevinfo.id = PLATFORM_DEVID_NONE; pdevinfo.dma_mask = DMA_BIT_MASK(32); + np = of_get_child_by_name(pdev->dev.of_node, name); + + /* Skip the child if it is explicitly disabled */ + if (np && !of_device_is_available(np)) + return NULL; + child = platform_device_register_full(&pdevinfo); if (IS_ERR(child)) { dev_warn(&pdev->dev, "%s not registered\n", name); child = NULL; } + child->dev.of_node = np; + /* * We want the dma-ranges etc to be copied from a device with the * correct dma-ranges for the VPU. -- Regards, Laurent Pinchart