mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-02 03:03:00 +09:00
rpmsg: core: add support to power domains for devices
[ Upstream commit fe782affd0 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0e890d1cf4
commit
1ed3a93072
@@ -23,6 +23,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"
|
||||
@@ -418,6 +419,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;
|
||||
@@ -459,6 +464,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user