Skip to content

Commit fe782af

Browse files
Srinivas-Kandagatlaandersson
authored andcommitted
rpmsg: core: add support to power domains for devices
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 <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 82eca59 commit fe782af

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/rpmsg/rpmsg_core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/module.h>
1616
#include <linux/rpmsg.h>
1717
#include <linux/of_device.h>
18+
#include <linux/pm_domain.h>
1819
#include <linux/slab.h>
1920

2021
#include "rpmsg_internal.h"
@@ -449,6 +450,10 @@ static int rpmsg_dev_probe(struct device *dev)
449450
struct rpmsg_endpoint *ept = NULL;
450451
int err;
451452

453+
err = dev_pm_domain_attach(dev, true);
454+
if (err)
455+
goto out;
456+
452457
if (rpdrv->callback) {
453458
strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE);
454459
chinfo.src = rpdev->src;
@@ -490,6 +495,8 @@ static int rpmsg_dev_remove(struct device *dev)
490495

491496
rpdrv->remove(rpdev);
492497

498+
dev_pm_domain_detach(dev, true);
499+
493500
if (rpdev->ept)
494501
rpmsg_destroy_ept(rpdev->ept);
495502

0 commit comments

Comments
 (0)