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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 DE51CC433E4 for ; Wed, 29 Jul 2020 17:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C35F120809 for ; Wed, 29 Jul 2020 17:40:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="JfqmNEpL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgG2Rkj (ORCPT ); Wed, 29 Jul 2020 13:40:39 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:22258 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbgG2Rkh (ORCPT ); Wed, 29 Jul 2020 13:40:37 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596044436; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=a8pbIaMcmccol9wdyUafwsFuwnvkkW/9i7k9bh+MNUk=; b=JfqmNEpLW+vwAF5kjLBUAHykP++AZDzrFMYif2kgBHA+vrd6HR4PNWuGpK7D+jr5MDcn7BY6 fvOxaR93qYSPWmXs2Jp1tcP7alkekNAOkJ3DquSP50/D6S5O6C5pXswtMjWfSXSIzKw9IICz +tlYXEfJCWW7/UC34c4QOWW4X3U= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyIzNjUxMiIsICJsaW51eC1kb2NAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n08.prod.us-east-1.postgun.com with SMTP id 5f21b485ca55a5604c70e994 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 29 Jul 2020 17:40:21 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0B70CC433B2; Wed, 29 Jul 2020 17:40:20 +0000 (UTC) Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 05F6BC433AF; Wed, 29 Jul 2020 17:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 05F6BC433AF Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, corbet@lwn.net Cc: Siddharth Gupta , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org Subject: [PATCH v5 2/2] remoteproc: core: Register the character device interface Date: Wed, 29 Jul 2020 10:40:01 -0700 Message-Id: <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> References: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Add the character device during rproc_add. This would create a character device node at /dev/remoteproc. Userspace applications can interact with the remote processor using this interface. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Siddharth Gupta --- drivers/remoteproc/remoteproc_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 277d3bf..7f90eee 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1986,6 +1986,11 @@ int rproc_add(struct rproc *rproc) /* create debugfs entries */ rproc_create_debug_dir(rproc); + /* add char device for this remoteproc */ + ret = rproc_char_device_add(rproc); + if (ret < 0) + return ret; + /* * Remind ourselves the remote processor has been attached to rather * than booted by the remoteproc core. This is important because the @@ -2262,6 +2267,7 @@ int rproc_del(struct rproc *rproc) mutex_unlock(&rproc->lock); rproc_delete_debug_dir(rproc); + rproc_char_device_remove(rproc); /* the rproc is downref'ed as soon as it's removed from the klist */ mutex_lock(&rproc_list_mutex); @@ -2430,6 +2436,7 @@ static int __init remoteproc_init(void) { rproc_init_sysfs(); rproc_init_debugfs(); + rproc_init_cdev(); rproc_init_panic(); return 0; -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project