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: 6260771 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4735FBF4A7 for ; Thu, 23 Apr 2015 08:46:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A2922038C for ; Thu, 23 Apr 2015 08:46:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 947ED20383 for ; Thu, 23 Apr 2015 08:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755742AbbDWIqE (ORCPT ); Thu, 23 Apr 2015 04:46:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46795 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754634AbbDWIqB (ORCPT ); Thu, 23 Apr 2015 04:46:01 -0400 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Cc: Rajendra Nayak 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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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);