From patchwork Mon Nov 14 11:15:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 82058 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp954866qge; Mon, 14 Nov 2016 03:16:14 -0800 (PST) X-Received: by 10.99.132.194 with SMTP id k185mr26628844pgd.171.1479122173971; Mon, 14 Nov 2016 03:16:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si12800976pgn.62.2016.11.14.03.16.13; Mon, 14 Nov 2016 03:16:13 -0800 (PST) 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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932354AbcKNLQM (ORCPT + 9 others); Mon, 14 Nov 2016 06:16:12 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37834 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753521AbcKNLQK (ORCPT ); Mon, 14 Nov 2016 06:16:10 -0500 Received: by mail-wm0-f47.google.com with SMTP id t79so91512355wmt.0 for ; Mon, 14 Nov 2016 03:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H98ppNWNQKYHOMg7GNoi35rtXuBu2iCguhfyYK6VJBc=; b=eMnsNPcJpWaPVFVJgf7OuyuP+b1dY1HOncdJgvONaz26GUVEJecjb5GE+mgYS60KXh cv2yhnaJen02rnv2TBvvFMRN5SyZr19MAz0RtK122u4GVwYgUUuNhc1wiPvczxqlAU3S Gy4F3zyazwYTEGEmXS7SS2JdoSQOFnkamHMX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H98ppNWNQKYHOMg7GNoi35rtXuBu2iCguhfyYK6VJBc=; b=Ra1h8WwcYKiyi9MMfz6rN25/tqeZOV9You3CbK5qrr6EijsIHEA96ftxKSAussappI f6AMpY0JkEvVo1I8sXow7Txu95eiBLLJBUewQFE3c8KG+PMzrjhPc4q7X7y/y5gITzEZ nTuM5NogAaM28yKVaja3ZqyDcB2ps/T4ROt7h8zdXt49h9o+lrgmbuwMMO0LTjs4vCl5 I9QO9hPBC+itJQ/r14cLgEEFi7fIqA0n3eghicBeWrAdZ80R43DHePZUsBt3qp+1sS+J ANr0EByeGkxWcVNeJVAKPt6o/0Pz23/4UQ/5lV65xeutMbAJppR+xw19KAtOG3hn25gm eEqw== X-Gm-Message-State: ABUngvfnFcuMWhdR9dbo8RXwBHg19vNLomR/ybkNnAGktBmyalT2gkeO1xbLp7CIsyorKN44 X-Received: by 10.28.52.76 with SMTP id b73mr10790118wma.8.1479122169133; Mon, 14 Nov 2016 03:16:09 -0800 (PST) Received: from localhost.localdomain (host-2-98-102-117.as13285.net. [2.98.102.117]) by smtp.gmail.com with ESMTPSA id gk6sm28069027wjc.21.2016.11.14.03.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Nov 2016 03:16:08 -0800 (PST) From: Srinivas Kandagatla To: svarbanov@mm-sol.com, linux-pci@vger.kernel.org, bhelgaas@google.com Cc: robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, srinivas.kandagatla@linaro.org, devicetree@vger.kernel.org Subject: [PATCH v4 1/3] bus: simple-pm: add support to pm clocks Date: Mon, 14 Nov 2016 11:15:53 +0000 Message-Id: <1479122155-13393-2-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479122155-13393-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1479122155-13393-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch adds support to pm clocks via device tree, so that the clocks can be turned on and off during runtime pm. This patch is required for Qualcomm msm8996 pcie controller which sits on a bus with its own power-domain and clocks. Without this patch the clock associated with the bus are never turned on. Signed-off-by: Srinivas Kandagatla --- drivers/bus/simple-pm-bus.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.10.1 -- 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/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c index c5eb46c..63b7e8c 100644 --- a/drivers/bus/simple-pm-bus.c +++ b/drivers/bus/simple-pm-bus.c @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -22,17 +23,26 @@ static int simple_pm_bus_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); - if (np) + if (np) { + of_pm_clk_add_clks(&pdev->dev); of_platform_populate(np, NULL, NULL, &pdev->dev); + } return 0; } +static const struct dev_pm_ops simple_pm_bus_pm_ops = { + SET_RUNTIME_PM_OPS(pm_clk_suspend, + pm_clk_resume, NULL) +}; + static int simple_pm_bus_remove(struct platform_device *pdev) { dev_dbg(&pdev->dev, "%s\n", __func__); pm_runtime_disable(&pdev->dev); + pm_clk_destroy(&pdev->dev); + return 0; } @@ -48,6 +58,7 @@ static struct platform_driver simple_pm_bus_driver = { .driver = { .name = "simple-pm-bus", .of_match_table = simple_pm_bus_of_match, + .pm = &simple_pm_bus_pm_ops, }, };