Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <srinivas.kandagatla@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

authored by

Srinivas Kandagatla and committed by
Bjorn Andersson
fe782aff 82eca590

+7
+7
drivers/rpmsg/rpmsg_core.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/rpmsg.h> 17 17 #include <linux/of_device.h> 18 + #include <linux/pm_domain.h> 18 19 #include <linux/slab.h> 19 20 20 21 #include "rpmsg_internal.h" ··· 450 449 struct rpmsg_endpoint *ept = NULL; 451 450 int err; 452 451 452 + err = dev_pm_domain_attach(dev, true); 453 + if (err) 454 + goto out; 455 + 453 456 if (rpdrv->callback) { 454 457 strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE); 455 458 chinfo.src = rpdev->src; ··· 494 489 err = rpdev->ops->announce_destroy(rpdev); 495 490 496 491 rpdrv->remove(rpdev); 492 + 493 + dev_pm_domain_detach(dev, true); 497 494 498 495 if (rpdev->ept) 499 496 rpmsg_destroy_ept(rpdev->ept);