Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp56844ybb; Tue, 31 Mar 2020 17:05:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt7uebNOLOf0mnPKNUSWX8X0+vs9B7b2KxanvCPqt73/FrOfsY7iztbPxu1e39i+S8S9QKs X-Received: by 2002:a05:6830:1e93:: with SMTP id n19mr15853382otr.153.1585699511650; Tue, 31 Mar 2020 17:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585699511; cv=none; d=google.com; s=arc-20160816; b=NC8F6KvlgZxLHU5jn2uyAHVPJ/gxhopvecGraqJ+keYaP0y/UtKE+EkfNgbQbxj5Un 2iDfv1KX+ywk9ZQHIVvKBfKfnxGoQMhUNi6hHixnN+wZP2VTeIIKyHN96fvMGqUVsp+3 nkdxff5IR3oem/U2sBj0qFenirZHsRAOI0x/JqzlrPOpGefz5UruBLO1qFycTzCu/LKt qXHrPTEKy/x6B5XQBFs7fHNicfYl44eyCsMO9CcFoQu5IFWbHQpPg3a1G2ZfABpmeC5e 3Kcm5N3ozRGXiiZ6o3RZngvvekgk/OA7qOtI7PNKuZFP0WbK2zQ+49nExd9sqp9lh2Q3 BLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=H8EubTh7i79BjoFT6UN3le3v6KCqE0B7/X8zxpL77s8=; b=S5fHwPBpQCcYqsywHX/6TGgXmNRY9tF54BSFLzg9cq/PmUDbmYMUP/U7dL3LSpbtbQ 3Oy7zxZGSj+cxDqC8Qs4AbDASiNUfkHgF7GRgb4dZQc5VwvuiVnPSlFXFBVIwgdEJhER L8zPTJIEVTCKu035J7wtlUkyGQgz7qjWHM6t5eBX6N8Y/J8Et2B/BwiJkY9JTWtKhri0 yNiBfaIp1j3H59+bfmvSq7jakHsixv12u8d9BqQSpQaLvzya/ijFWX42qz+Odm+0qnkf yCwuhUQpwpbodEuhLskllr60crT0FGA8aMQ536dk5bSsy1upt7M2N8bDOT6dRpgn6//i 8T3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=sEd1WeUQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si70261oth.149.2020.03.31.17.04.42; Tue, 31 Mar 2020 17:05:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=sEd1WeUQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731630AbgDAAEP (ORCPT + 99 others); Tue, 31 Mar 2020 20:04:15 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:14928 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731597AbgDAAEO (ORCPT ); Tue, 31 Mar 2020 20:04:14 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1585699453; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=H8EubTh7i79BjoFT6UN3le3v6KCqE0B7/X8zxpL77s8=; b=sEd1WeUQ+t57Enqwu/d0u8IM6thJIkD67DN0Kh8DrU695gw2isNqZ7B7gSgjO/PcwcDeo/UX 4wAWk5GnhbkP0nFs7MJjgQ3CkGryIhaGZVMuL/K8E/IqrpIYw6jQg5AwF2RJA1oG5rl7Mlvk +5ndpH4MEvQqCEKoLP2/KiJIeEU= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e83da75.7facd0458ca8-smtp-out-n04; Wed, 01 Apr 2020 00:04:05 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id EF1D9C433BA; Wed, 1 Apr 2020 00:04:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from rishabhb-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: rishabhb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 20D6AC433BA; Wed, 1 Apr 2020 00:04:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 20D6AC433BA 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=rishabhb@codeaurora.org From: Rishabh Bhatnagar To: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, bjorn.andersson@linaro.org Cc: psodagud@codeaurora.org, tsoni@codeaurora.org, sidgup@codeaurora.org, Rishabh Bhatnagar Subject: [PATCH v2 2/2] remoteproc: core: Register the character device interface Date: Tue, 31 Mar 2020 17:03:58 -0700 Message-Id: <1585699438-14394-2-git-send-email-rishabhb@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1585699438-14394-1-git-send-email-rishabhb@codeaurora.org> References: <1585699438-14394-1-git-send-email-rishabhb@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/remoteproc/remoteproc_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 097f33e..76ba171 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1916,6 +1916,13 @@ 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) { + dev_err(dev, "Failed to add char dev for %s\n", rproc->name); + return ret; + } + /* if rproc is marked always-on, request it to boot */ if (rproc->auto_boot) { ret = rproc_trigger_auto_boot(rproc); @@ -2137,6 +2144,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); @@ -2220,6 +2228,7 @@ static int __init remoteproc_init(void) { rproc_init_sysfs(); rproc_init_debugfs(); + rproc_init_cdev(); return 0; } @@ -2231,6 +2240,7 @@ static void __exit remoteproc_exit(void) rproc_exit_debugfs(); rproc_exit_sysfs(); + rproc_exit_cdev(); } module_exit(remoteproc_exit); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project