linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rpmsg: core: add support to power domains for devices
@ 2018-06-15  9:59 Srinivas Kandagatla
  2018-09-25  0:25 ` Suman Anna
  0 siblings, 1 reply; 9+ messages in thread
From: Srinivas Kandagatla @ 2018-06-15  9:59 UTC (permalink / raw)
  To: ohad, bjorn.andersson
  Cc: linux-remoteproc, linux-arm-msm, linux-kernel, Srinivas Kandagatla

Some of the rpmsg devices need to switch on power domains to communicate
with remote processor. For example on Qualcomm DB820c platform LPASS
power domain needs to switched on for any kind of audio services.
This patch adds the missing power domain support in rpmsg core.

Without this patch attempting to play audio via QDSP on DB820c would
reboot the system.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/rpmsg/rpmsg_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index b714a543a91d..8122807db380 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/rpmsg.h>
 #include <linux/of_device.h>
+#include <linux/pm_domain.h>
 #include <linux/slab.h>
 
 #include "rpmsg_internal.h"
@@ -449,6 +450,10 @@ static int rpmsg_dev_probe(struct device *dev)
 	struct rpmsg_endpoint *ept = NULL;
 	int err;
 
+	err = dev_pm_domain_attach(dev, true);
+	if (err)
+		goto out;
+
 	if (rpdrv->callback) {
 		strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE);
 		chinfo.src = rpdev->src;
@@ -490,6 +495,8 @@ static int rpmsg_dev_remove(struct device *dev)
 
 	rpdrv->remove(rpdev);
 
+	dev_pm_domain_detach(dev, true);
+
 	if (rpdev->ept)
 		rpmsg_destroy_ept(rpdev->ept);
 
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-26 17:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15  9:59 [PATCH] rpmsg: core: add support to power domains for devices Srinivas Kandagatla
2018-09-25  0:25 ` Suman Anna
2018-09-25  8:29   ` Srinivas Kandagatla
2018-09-25 17:20     ` Suman Anna
2018-09-25 17:25   ` Arnaud Pouliquen
2018-09-25 19:02     ` Suman Anna
2018-09-26 12:48       ` Arnaud Pouliquen
2018-09-26 13:06         ` Srinivas Kandagatla
2018-09-26 17:14           ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).