From patchwork Fri Nov 24 14:36:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud POULIQUEN X-Patchwork-Id: 10074137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13EB560375 for ; Fri, 24 Nov 2017 14:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05EE72A306 for ; Fri, 24 Nov 2017 14:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF05C2A354; Fri, 24 Nov 2017 14:39:19 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D4862A306 for ; Fri, 24 Nov 2017 14:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbdKXOjS (ORCPT ); Fri, 24 Nov 2017 09:39:18 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:3681 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753201AbdKXOjS (ORCPT ); Fri, 24 Nov 2017 09:39:18 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAOEYJiO004910; Fri, 24 Nov 2017 15:38:51 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2edqjjj0r1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 24 Nov 2017 15:38:51 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5FA533A; Fri, 24 Nov 2017 14:38:51 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4C7FE5239; Fri, 24 Nov 2017 14:38:51 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.352.0; Fri, 24 Nov 2017 15:38:51 +0100 Received: from localhost (10.201.23.162) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.352.0; Fri, 24 Nov 2017 15:38:51 +0100 From: Arnaud Pouliquen To: Bjorn Andersson CC: , , "Loic PALLARDY" , Fabien DESSENNE , Suman Anna Subject: [RFC 5/6] remoteproc: Add posibility to probe a sub device. Date: Fri, 24 Nov 2017 15:36:41 +0100 Message-ID: <1511534202-12995-6-git-send-email-arnaud.pouliquen@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511534202-12995-1-git-send-email-arnaud.pouliquen@st.com> References: <1511534202-12995-1-git-send-email-arnaud.pouliquen@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.162] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-24_05:, , signatures=0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabien Dessenne When a remote processor registers, populate the device tree to probe a potential sub-device. This capability is added to be able to add a resource manger for the remote processor. Signed-off-by: Fabien Dessenne Signed-off-by: Arnaud Pouliquen Signed-off-by: Loic Pallardy --- drivers/remoteproc/remoteproc_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 870b1fb..3f39def 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "remoteproc_internal.h" @@ -1343,6 +1344,11 @@ int rproc_add(struct rproc *rproc) return ret; } + /* add resource manager device */ + ret = devm_of_platform_populate(dev->parent); + if (ret < 0) + return ret; + /* expose to rproc_get_by_phandle users */ mutex_lock(&rproc_list_mutex); list_add(&rproc->node, &rproc_list); @@ -1551,6 +1557,8 @@ int rproc_del(struct rproc *rproc) list_del(&rproc->node); mutex_unlock(&rproc_list_mutex); + of_platform_depopulate(rproc->dev.parent); + device_del(&rproc->dev); return 0;