mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: kernel@stlinux.com, ohad@wizery.com, devicetree@vger.kernel.org,
	Lee Jones <lee.jones@linaro.org>
Subject: [PATCH 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs
Date: Wed, 26 Aug 2015 14:08:03 +0100	[thread overview]
Message-ID: <1440594483-29601-5-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1440594483-29601-1-git-send-email-lee.jones@linaro.org>

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/remoteproc/remoteproc_debugfs.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index 9d30809..9620962 100644
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -88,8 +88,33 @@ static ssize_t rproc_state_read(struct file *filp, char __user *userbuf,
 	return simple_read_from_buffer(userbuf, count, ppos, buf, i);
 }
 
+static ssize_t rproc_state_write(struct file *filp, const char __user *userbuf,
+				 size_t count, loff_t *ppos)
+{
+	struct rproc *rproc = filp->private_data;
+	char buf[2];
+	int ret;
+
+	ret = copy_from_user(buf, userbuf, 1);
+	if (ret)
+		return -EFAULT;
+
+	switch (buf[0]) {
+	case '1':
+		ret = rproc_boot(rproc);
+		if (ret)
+			dev_warn(&rproc->dev, "Boot failed: %d\n", ret);
+		break;
+	default:
+		rproc_shutdown(rproc);
+	}
+
+	return count;
+}
+
 static const struct file_operations rproc_state_ops = {
 	.read = rproc_state_read,
+	.write = rproc_state_write,
 	.open = simple_open,
 	.llseek	= generic_file_llseek,
 };
-- 
1.9.1


  parent reply	other threads:[~2015-08-26 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 13:07 [PATCH 0/4] remoteproc: Add driver for STMicroelectronics platforms Lee Jones
2015-08-26 13:08 ` [PATCH 1/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Lee Jones
2015-08-26 15:59   ` Nathan Lynch
2015-08-26 16:40     ` Lee Jones
2015-08-26 13:08 ` [PATCH 2/4] remoteproc: Supply controller driver for ST's Remote Processors Lee Jones
2015-08-26 17:07   ` Nathan Lynch
2015-08-27  6:45     ` Lee Jones
2015-08-26 13:08 ` [PATCH 3/4] ARM: STiH407: Add nodes for RemoteProc Lee Jones
2015-08-26 13:08 ` Lee Jones [this message]
2015-08-26 17:08   ` [PATCH 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Nathan Lynch
2015-08-27  6:44     ` Lee Jones

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=1440594483-29601-5-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@stlinux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ohad@wizery.com \
    /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

all inboxes | Powered by JetHome®