From patchwork Thu Apr 23 08:45:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 6260911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE3DC9F313 for ; Thu, 23 Apr 2015 08:49:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E9D520172 for ; Thu, 23 Apr 2015 08:49:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B2B520383 for ; Thu, 23 Apr 2015 08:49:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YlCnR-0004yT-Vk; Thu, 23 Apr 2015 08:47:45 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YlCmA-0004H4-C5 for linux-arm-kernel@bombadil.infradead.org; Thu, 23 Apr 2015 08:46:26 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YlCm8-0003b3-55 for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2015 08:46:24 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id CF9F01406DC; Thu, 23 Apr 2015 08:46:00 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id BD42A140709; Thu, 23 Apr 2015 08:46:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from blr-ubuntu-34.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BFE941406DC; Thu, 23 Apr 2015 08:45:58 +0000 (UTC) From: Rajendra Nayak To: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [RFC/RFT 2/6] clk: qcom: Add runtime support to handle clocks using PM clocks Date: Thu, 23 Apr 2015 14:15:40 +0530 Message-Id: <1429778744-13352-3-git-send-email-rnayak@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1429778744-13352-1-git-send-email-rnayak@codeaurora.org> References: <1429778744-13352-1-git-send-email-rnayak@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150423_044624_266166_B687CFB4 X-CRM114-Status: GOOD ( 15.84 ) X-Spam-Score: -1.9 (-) Cc: Rajendra Nayak X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add runtime PM support to handle (core and iface) clocks for devices without a controllable power domain. Once the drivers for these devices are converted to use runtime PM apis, all clock handling (for core and iface) from these drivers can then be removed. Signed-off-by: Rajendra Nayak --- drivers/clk/qcom/gdsc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index 480ebf6..92b0f6d 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "gdsc.h" @@ -226,3 +227,22 @@ void gdsc_unregister(struct device *dev) { of_genpd_del_provider(dev->of_node); } + +static struct dev_pm_domain default_qcom_pm_domain = { + .ops = { + USE_PM_CLK_RUNTIME_OPS + USE_PLATFORM_PM_SLEEP_OPS + }, +}; + +static struct pm_clk_notifier_block qcom_pm_notifier = { + .pm_domain = &default_qcom_pm_domain, + .con_ids = { "core", "iface" }, +}; + +static int __init qcom_pm_runtime_init(void) +{ + pm_clk_add_notifier(&platform_bus_type, &qcom_pm_notifier); + return 0; +} +core_initcall(qcom_pm_runtime_init);