From patchwork Fri Jun 15 09:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 138667 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp631261lji; Fri, 15 Jun 2018 02:59:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJR4hTCsRduIaSHKFxeA8TO8NH+zbGCY6ninPygMcuSx9eRuSXlJvFuE06Q72CSlQHvKmMk X-Received: by 2002:a63:77c9:: with SMTP id s192-v6mr955465pgc.140.1529056789161; Fri, 15 Jun 2018 02:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529056789; cv=none; d=google.com; s=arc-20160816; b=jN1GUHHY+vWOBihUPfsw7jQFKkEVUGe84CQv8BD19kK2WTipmruzZNfDlCEg73TKtv A5L36qMGZhXd4aNH6gIq5FFs5/AzKcCWpwxPLOtWLFTlIOqiJSNYk3wS1FaZrC5S6VHG JN/35s8iJbYrGwj9jRA64RVsTB2RX9RdHNlN+Mjuf9hLnRpB/JyhJnL42oF4cTtZZGXw b5epS1MFcOzq/UwHSYK5fxE1cJ7rLY2CEUtBMT6wE4yTcgrkPJvDEQZq/9FNXbphILPF 3FOjNkw0GCOuJLTxYSAke8ZNXpvEiDwEdGyvXJEhavmtaZwsC1SJlAJueg5Rc6MFJAHz TrnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=EyiTchVI5zQZD4AHkoHjV3OZnPDdfY7ABHnbYFGyeLQ=; b=gACCHW6IVEf0cmujSFml/ptuw41dAkact1B/LIUAMKJ3f9C1IQ5MdzKZ5dahZkyum9 X6s3BsW8Og/2rt5Z47aGnvV4MLqFazJ3JKpNjVrQ0R0IHscoUNK++9GDIvoLRqWYIZT7 W5Z7qX4YLNA5FfSEZf68Td3koQT57sACOCAGl+a4lMf2A6Ws0jyU5JO2HmQTd03wnpkj qH918C8p6NX2bOwfIFN2/92eDArgKouNiWY8Q14oyPJ+9x7TmXGji1i0D80Po+lH9mbQ RvQyWO75bwZHBWSG5l/l5I3DX7OwEg2yzIdI4Jt/ykKmX5ozwvVVV/bvrTMZwS2ruorZ Ag0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="dX/5FjoE"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si7547231plc.415.2018.06.15.02.59.48; Fri, 15 Jun 2018 02:59:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="dX/5FjoE"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936212AbeFOJ7r (ORCPT + 13 others); Fri, 15 Jun 2018 05:59:47 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41841 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934900AbeFOJ7p (ORCPT ); Fri, 15 Jun 2018 05:59:45 -0400 Received: by mail-wr0-f196.google.com with SMTP id h10-v6so9302340wrq.8 for ; Fri, 15 Jun 2018 02:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=u9uuGzmf4enrIny/JvPD087s+CCtQ/fCgWXfahiRIa4=; b=dX/5FjoEXsJtbIDxwy4OI5yHoJmNSg2JPyuU3kOvx3LdrqFSSZB3mUhhWWGM7JG8FD 9KZ06YL3nKTvvVd8A6NfqOl1DnkbhNkUtThNGBii3wTIx1i8BPdEbng5x6w3avDFzeyl 5qtVigcWmWe+tqfFsaPpY+rKg9zlip141vMRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u9uuGzmf4enrIny/JvPD087s+CCtQ/fCgWXfahiRIa4=; b=gco/k8NDWPz3aF/YZoObOvJxSzhq0oRXblGkNOEYTRrVUBDv6nrW5qvOZV+fjjcTvs nPGKTcUQm2M+bsC0qjJKOL90XU654t5O42CDtcJGfQ4fGT8jKKaF35U1Sk6EsEwMrxXj 7dS13youJKW/o+xFW0PY2uOisJThO5LVbSLoDXFatcY4BnA91Pg6V6Zggw9/5HZCXh0m sFjFCrgB6zUVm39MRiPAYyvcCVYDDn3TZb2r9z2mHugIdfuc9oE2DQniiWVEjZRuoRzd dvlMAG3P/HoUhwTYChp+uuBVu9YpCGP8MIdnyYWRLfx/A1BTIEjF3hDx+dHPyjkZsvU8 sXJw== X-Gm-Message-State: APt69E0rVTZfzXUnbLJwTrCPwmIvb0sMHrXAun/QNvzgzgKnzk8Mo4Bp djNMd0xtwp+5lDB7n7h7WGccmQ== X-Received: by 2002:adf:fd88:: with SMTP id d8-v6mr981113wrr.276.1529056784183; Fri, 15 Jun 2018 02:59:44 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id p3-v6sm7502812wrn.31.2018.06.15.02.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jun 2018 02:59:43 -0700 (PDT) From: Srinivas Kandagatla To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH] rpmsg: core: add support to power domains for devices Date: Fri, 15 Jun 2018 10:59:39 +0100 Message-Id: <20180615095939.1331-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/rpmsg/rpmsg_core.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #include #include +#include #include #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);