Skip to content

Commit

Permalink
rpmsg: core: add support to power domains for devices
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Srinivas Kandagatla authored and Bjorn Andersson committed Jul 31, 2018
1 parent 82eca59 commit fe782af
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/rpmsg/rpmsg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit fe782af

Please sign in to comment.