From patchwork Thu Jul 27 11:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9866645 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 185A06038C for ; Thu, 27 Jul 2017 11:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ADD028758 for ; Thu, 27 Jul 2017 11:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3FBD287C8; Thu, 27 Jul 2017 11:13:20 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 AF18C28758 for ; Thu, 27 Jul 2017 11:13:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbdG0LK4 (ORCPT ); Thu, 27 Jul 2017 07:10:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58238 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbdG0LKs (ORCPT ); Thu, 27 Jul 2017 07:10:48 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 625FC6089A; Thu, 27 Jul 2017 11:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153847; bh=N2Sr+KVekr/sZnvwlDxth5MTy+O9ogiciCT4ZyrB9xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f1pCd84rLcHCZ8ToeejnIE/aUxLlFMsHdGOudHFNMfRjbiwK+5sXXXoamATnXzqHN 9l3usWuiOQ9Hr6NAJYBPl1OAt+FtYCIFzV0oWjMOujQb1gAD7y8N5vn60NBICj0Y95 wDIquYROcjXe+zs3GkWl9m3FfiQ04CIAunmfyvm4= Received: from absahu-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: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8555560998; Thu, 27 Jul 2017 11:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153846; bh=N2Sr+KVekr/sZnvwlDxth5MTy+O9ogiciCT4ZyrB9xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mcZ+b1cpa8M6Jlx0OltZ37aaKr9EaO4dusT30NMnoOfe/mStyWoBqajPDiyVaeR8g wpEeBMXGhG3smqpGL4VL4rpIBMyOOS1XMX7sQDb50GYWxnbyMOQiqHaMi5BNFy7c5N z5dsrmJFprkVxni6dTMA86woiCwUOkbuw7JN8EC8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8555560998 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=absahu@codeaurora.org From: Abhishek Sahu To: sboyd@codeaurora.org, mturquette@baylibre.com Cc: andy.gross@linaro.org, david.brown@linaro.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Sahu Subject: [RFC 02/12] clk: qcom: flag for 64 bit CONFIG_CTL Date: Thu, 27 Jul 2017 16:40:15 +0530 Message-Id: <1501153825-5181-3-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501153825-5181-1-git-send-email-absahu@codeaurora.org> References: <1501153825-5181-1-git-send-email-absahu@codeaurora.org> MIME-Version: 1.0 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 Some of the Alpha PLL’s (like Spark, Brammo PLL) do not have CONFIG_CTL_U register. This patch adds the flag for PLL’s which have CONFIG_CTL_U register and checks the same while doing PLL initial configuration. Signed-off-by: Abhishek Sahu --- drivers/clk/qcom/clk-alpha-pll.c | 5 ++++- drivers/clk/qcom/clk-alpha-pll.h | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index 47a1da3..e6cde2d 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -118,7 +118,10 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, regmap_write(regmap, off + PLL_L_VAL, config->l); regmap_write(regmap, off + PLL_ALPHA_VAL, config->alpha); regmap_write(regmap, off + PLL_CONFIG_CTL, config->config_ctl_val); - regmap_write(regmap, off + PLL_CONFIG_CTL_U, config->config_ctl_hi_val); + + if (pll->flags & SUPPORTS_64BIT_CONFIG_CTL) + regmap_write(regmap, off + PLL_CONFIG_CTL_U, + config->config_ctl_hi_val); val = config->main_output_mask; val |= config->aux_output_mask; diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index d6e1ee2..bbd6aa9 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -34,9 +34,10 @@ struct clk_alpha_pll { const struct pll_vco *vco_table; size_t num_vco; -#define SUPPORTS_OFFLINE_REQ BIT(0) -#define SUPPORTS_16BIT_ALPHA BIT(1) -#define SUPPORTS_FSM_MODE BIT(2) +#define SUPPORTS_OFFLINE_REQ BIT(0) +#define SUPPORTS_16BIT_ALPHA BIT(1) +#define SUPPORTS_FSM_MODE BIT(2) +#define SUPPORTS_64BIT_CONFIG_CTL BIT(3) u8 flags; struct clk_regmap clkr;