summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e1f83f6)
raw | patch | inline | side by side (parent: e1f83f6)
author | Suman Anna <s-anna@ti.com> | |
Tue, 21 Jul 2020 22:36:13 +0000 (17:36 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Tue, 4 Aug 2020 16:56:56 +0000 (11:56 -0500) |
[ Upstream commit a8aa5ee100df45f4988975822f5af7c2b67ee9e6 ]
Add a new helper function rproc_of_parse_firmware() to the remoteproc
core that can be used by various remoteproc drivers to look up the
the "firmware-name" property from a rproc device node. This property
is already being used by multiple drivers, so this helper can avoid
repeating equivalent code in remoteproc drivers.
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200721223617.20312-3-s-anna@ti.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[s-anna@ti.com: cherry-pick commit 'a8aa5ee100df' from v5.9]
Add a new helper function rproc_of_parse_firmware() to the remoteproc
core that can be used by various remoteproc drivers to look up the
the "firmware-name" property from a rproc device node. This property
is already being used by multiple drivers, so this helper can avoid
repeating equivalent code in remoteproc drivers.
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200721223617.20312-3-s-anna@ti.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[s-anna@ti.com: cherry-pick commit 'a8aa5ee100df' from v5.9]
drivers/remoteproc/remoteproc_core.c | patch | blob | history | |
drivers/remoteproc/remoteproc_internal.h | patch | blob | history |
index 66e00a76547a00aa09c8aeb1e3b85eba3aa2c23f..e641e2e6b4be3eedfe74cf844193f53f1ef5447a 100644 (file)
return rproc->ops->handle_vendor_rsc(rproc, (void *)rsc);
}
+/**
+ * rproc_of_parse_firmware() - parse and return the firmware-name
+ * @dev: pointer on device struct representing a rproc
+ * @index: index to use for the firmware-name retrieval
+ * @fw_name: pointer to a character string, in which the firmware
+ * name is returned on success and unmodified otherwise.
+ *
+ * This is an OF helper function that parses a device's DT node for
+ * the "firmware-name" property and returns the firmware name pointer
+ * in @fw_name on success.
+ *
+ * Return: 0 on success, or an appropriate failure.
+ */
+int rproc_of_parse_firmware(struct device *dev, int index, const char **fw_name)
+{
+ int ret;
+
+ ret = of_property_read_string_index(dev->of_node, "firmware-name",
+ index, fw_name);
+ return ret ? ret : 0;
+}
+EXPORT_SYMBOL(rproc_of_parse_firmware);
+
/*
* A lookup table for resource handlers. The indices are defined in
* enum fw_resource_type.
index 20e3d4cc775ac5d039672487edf0fe35bdbab84d..1487a253d01e9d954a9da9d490016a3e82820dc8 100644 (file)
void rproc_release(struct kref *kref);
irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id);
void rproc_vdev_release(struct kref *ref);
+int rproc_of_parse_firmware(struct device *dev, int index,
+ const char **fw_name);
/* from remoteproc_virtio.c */
int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id);