From: Rishabh Bhatnagar <rishabhb@codeaurora.org>
To: linux-remoteproc-owner@vger.kernel.org,
linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org,
mathieu.poirier@linaro.org
Cc: psodagud@codeaurora.org, tsoni@codeaurora.org,
sidgup@codeaurora.org,
Rishabh Bhatnagar <rishabhb@codeaurora.org>
Subject: [PATCH 2/2] remoteproc: core: Register the character device interface
Date: Fri, 20 Mar 2020 16:36:17 -0700 [thread overview]
Message-ID: <1584747377-14824-3-git-send-email-rishabhb@codeaurora.org> (raw)
In-Reply-To: <1584747377-14824-1-git-send-email-rishabhb@codeaurora.org>
Add the character device during rproc_add. This would create
a character device node at /dev/subsys_<rproc_name>. Userspace
applications can interact with the remote processor using this
interface rather than using sysfs node. To distinguish between
different remote processor nodes the device name has been changed
to include the rproc name appended to "subsys_" string.
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
---
drivers/remoteproc/remoteproc_core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 097f33e..48a3932 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1907,6 +1907,12 @@ int rproc_add(struct rproc *rproc)
struct device *dev = &rproc->dev;
int ret;
+ ret = rproc_char_device_add(rproc);
+ if (ret) {
+ pr_err("error while adding character device\n");
+ return ret;
+ }
+
ret = device_add(dev);
if (ret < 0)
return ret;
@@ -2044,7 +2050,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
return NULL;
}
- dev_set_name(&rproc->dev, "remoteproc%d", rproc->index);
+ dev_set_name(&rproc->dev, "subsys_%s", rproc->name);
atomic_set(&rproc->power, 0);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2020-03-20 23:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 23:36 [PATCH 0/2] Add character device interface to remoteproc Rishabh Bhatnagar
2020-03-20 23:36 ` [PATCH 1/2] remoteproc: Add userspace char device driver Rishabh Bhatnagar
2020-03-25 4:10 ` Bjorn Andersson
2020-03-20 23:36 ` Rishabh Bhatnagar [this message]
2020-03-25 4:22 ` [PATCH 2/2] remoteproc: core: Register the character device interface Bjorn Andersson
-- strict thread matches above, loose matches on Subject: below --
2020-03-26 16:50 [PATCH 0/2] Add character device interface to remoteproc Rishabh Bhatnagar
2020-03-26 16:50 ` [PATCH 2/2] remoteproc: core: Register the character device interface Rishabh Bhatnagar
2020-03-30 22:13 ` Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1584747377-14824-3-git-send-email-rishabhb@codeaurora.org \
--to=rishabhb@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc-owner@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=psodagud@codeaurora.org \
--cc=sidgup@codeaurora.org \
--cc=tsoni@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox