From patchwork Sat Jul 21 18:15:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taniya Das X-Patchwork-Id: 10539049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF437A6AB for ; Sun, 22 Jul 2018 00:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3600828B21 for ; Sat, 21 Jul 2018 18:15:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27D2F28B45; Sat, 21 Jul 2018 18:15:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A882428B21 for ; Sat, 21 Jul 2018 18:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbeGUTJE (ORCPT ); Sat, 21 Jul 2018 15:09:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54520 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbeGUTJD (ORCPT ); Sat, 21 Jul 2018 15:09:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 424C460B1E; Sat, 21 Jul 2018 18:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532196927; bh=+3J8fdutGWhw3xn9P/ApyA69ixoM6Oh7GFOy0rTJkLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ce+qe2EB8VNcLJzSPgD3CvDbyuZsjFVyDcJgjBAWCRMj7T8ihqexnqiTSuvMIJ0IQ FQbnjREXsGEYz64qptF/l+zcR/fw1H9fIsMelKw/Z9RfnR5QRona0Wf0R0v1pb1pQK MV+1ht8R+K43LB6fA3PomI7w81c6UX2FcGRGIaf8= Received: from tdas-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0D95B60AD9; Sat, 21 Jul 2018 18:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532196926; bh=+3J8fdutGWhw3xn9P/ApyA69ixoM6Oh7GFOy0rTJkLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RDeAd7u/8pisV3QwFtlFwEAqbQrFRVYHy8pGo7CKOm38OJArTd2vFQoE4NoOJ5dEJ FDm//EigMhL2z1FHsrOX2aol2r0WZHObZEXuZRAgMjaqIh+k0gr+wLDAbtyV13/RTO Q4yJx5jxdO03WlD1JRWl/z3LV/I3HK2dsH9DPIRE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0D95B60AD9 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tdas@codeaurora.org From: Taniya Das To: Stephen Boyd , Michael Turquette Cc: Andy Gross , David Brown , Rajendra Nayak , Amit Nischal , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, grahamr@qti.qualcomm.com, Taniya Das Subject: [RFC PATCH 2/4] clk: qcom: Initialize the power domain class for each clock Date: Sat, 21 Jul 2018 23:45:00 +0530 Message-Id: <1532196902-28570-3-git-send-email-tdas@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532196902-28570-1-git-send-email-tdas@codeaurora.org> References: <1532196902-28570-1-git-send-email-tdas@codeaurora.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The power domain class is being initialized for clocks which has an associated power domains before registering the clocks with the clock framework. Signed-off-by: Taniya Das --- drivers/clk/qcom/clk-regmap.h | 5 +++++ drivers/clk/qcom/common.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/clk/qcom/clk-regmap.h b/drivers/clk/qcom/clk-regmap.h index 90d95cd..6265d91 100644 --- a/drivers/clk/qcom/clk-regmap.h +++ b/drivers/clk/qcom/clk-regmap.h @@ -17,22 +17,27 @@ #include struct regmap; +struct clk_powerdomain_class; /** * struct clk_regmap - regmap supporting clock * @hw: handle between common and hardware-specific interfaces * @regmap: regmap to use for regmap helpers and/or by providers + * @pd: power domain scaling requirement class * @enable_reg: register when using regmap enable/disable ops * @enable_mask: mask when using regmap enable/disable ops * @enable_is_inverted: flag to indicate set enable_mask bits to disable * when using clock_enable_regmap and friends APIs. + * @rate_max: maximum clock rate in Hz supported at each power domain. */ struct clk_regmap { struct clk_hw hw; struct regmap *regmap; + struct clk_powerdomain_class *pd; unsigned int enable_reg; unsigned int enable_mask; bool enable_is_inverted; + unsigned long *rate_max; }; #define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index 39ce64c..b0684bf 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -1,14 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved. */ #include @@ -20,6 +12,7 @@ #include #include "common.h" +#include "clk-pd.h" #include "clk-rcg.h" #include "clk-regmap.h" #include "reset.h" @@ -263,6 +256,10 @@ int qcom_cc_really_probe(struct platform_device *pdev, if (!rclks[i]) continue; + ret = clk_power_domain_class_init(dev, rclks[i]->pd); + if (ret) + return ret; + ret = devm_clk_register_regmap(dev, rclks[i]); if (ret) return ret;