From patchwork Tue Aug 8 18:24:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9888947 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 59D6F601EB for ; Tue, 8 Aug 2017 18:28:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C0B5289AB for ; Tue, 8 Aug 2017 18:28:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 409BB289E0; Tue, 8 Aug 2017 18:28:37 +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=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 E5513289AB for ; Tue, 8 Aug 2017 18:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752464AbdHHSYj (ORCPT ); Tue, 8 Aug 2017 14:24:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36954 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbdHHSYg (ORCPT ); Tue, 8 Aug 2017 14:24:36 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5ABA6605A8; Tue, 8 Aug 2017 18:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1502216675; bh=Tyx+Knvac7mUi1HzAemJ8ceIF9kqU9guTaA0Ti8t7+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YiniA+WNB/quz0Cd2yt15OATBNeeEDwxOjgR7rZYBqpKzGpIFcmP6+M/dpRqJP+vs A2UK+Yto1ikL2J7fh6HOOqtPCKBqoF2OeNI0xMnrNLr/IVM23vGcuIXBCK4GsCMkTY khDFpMC2Zs60tGwJZtVD5313oo1XTJNQQoIZBsU0= 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 BC7346043F; Tue, 8 Aug 2017 18:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1502216674; bh=Tyx+Knvac7mUi1HzAemJ8ceIF9kqU9guTaA0Ti8t7+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vnq21ZpsjL6MYnDtdeEb5Gupalr96Wbdx7rjoUUqp1+717WIqX468mWhGCDqdUYdL AAytKONqxBhLyj1N0oB4rxBZHH6idm+1+WK/q6y+aciTSIdurYnX1Mz3LUphs09t66 P3YhXMzWY9TUSvtsSdAptjr1V8YmsHvqhVS+C2ow= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BC7346043F 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 v2 02/12] clk: qcom: support for alpha mode configuration Date: Tue, 8 Aug 2017 23:54:07 +0530 Message-Id: <1502216657-3342-3-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502216657-3342-1-git-send-email-absahu@codeaurora.org> References: <1502216657-3342-1-git-send-email-absahu@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 current configuration does not fully configure PLL alpha mode and values so this patch 1. Configures PLL_ALPHA_VAL_U for PLL which supports 40 bit alpha. 2. Adds alpha enable and alpha mode configuration support. Signed-off-by: Abhishek Sahu --- drivers/clk/qcom/clk-alpha-pll.c | 5 +++++ drivers/clk/qcom/clk-alpha-pll.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index e6cde2d..6291048 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -123,6 +123,9 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, regmap_write(regmap, off + PLL_CONFIG_CTL_U, config->config_ctl_hi_val); + if (!(pll->flags & SUPPORTS_16BIT_ALPHA)) + regmap_write(regmap, off + PLL_ALPHA_VAL_U, config->alpha_hi); + val = config->main_output_mask; val |= config->aux_output_mask; val |= config->aux2_output_mask; @@ -130,6 +133,8 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, val |= config->pre_div_val; val |= config->post_div_val; val |= config->vco_val; + val |= config->alpha_en_mask; + val |= config->alpha_mode_mask; mask = config->main_output_mask; mask |= config->aux_output_mask; diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index bbd6aa9..39686db 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -59,12 +59,15 @@ struct clk_alpha_pll_postdiv { struct alpha_pll_config { u32 l; u32 alpha; + u32 alpha_hi; u32 config_ctl_val; u32 config_ctl_hi_val; u32 main_output_mask; u32 aux_output_mask; u32 aux2_output_mask; u32 early_output_mask; + u32 alpha_en_mask; + u32 alpha_mode_mask; u32 pre_div_val; u32 pre_div_mask; u32 post_div_val;