summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/remoteproc_sysfs.c
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2019-08-10 00:20:57 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2019-08-26 23:50:16 +0200
commit6ed756aa0148a5ad0dbdced6f14f22e2f5748d35 (patch)
tree066def8c68bac68032be93823a51ae9e39eb5660 /drivers/remoteproc/remoteproc_sysfs.c
parentremoteproc: qcom: Move glink_ssr notification after stop (diff)
downloadlinux-6ed756aa0148a5ad0dbdced6f14f22e2f5748d35.tar.xz
linux-6ed756aa0148a5ad0dbdced6f14f22e2f5748d35.zip
remoteproc: Add a sysfs interface for name
This patch adds a sysfs interface that provides the name of the remote processor to userspace. This allows the userspace to identify a remote processor as the remoteproc devices themselves are created based on probe order and can change from one boot to another or at runtime. The name is made available in debugfs originally, and is being retained for now. This can be cleaned up after couple of releases once users get familiar with the new interface. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_sysfs.c')
-rw-r--r--drivers/remoteproc/remoteproc_sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index fa4131930106..7f8536b73295 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -113,9 +113,20 @@ static ssize_t state_store(struct device *dev,
}
static DEVICE_ATTR_RW(state);
+/* Expose the name of the remote processor via sysfs */
+static ssize_t name_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct rproc *rproc = to_rproc(dev);
+
+ return sprintf(buf, "%s\n", rproc->name);
+}
+static DEVICE_ATTR_RO(name);
+
static struct attribute *rproc_attrs[] = {
&dev_attr_firmware.attr,
&dev_attr_state.attr,
+ &dev_attr_name.attr,
NULL
};