From patchwork Thu Jul 27 11:10:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9866651 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 BED046038C for ; Thu, 27 Jul 2017 11:14:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0B36287C8 for ; Thu, 27 Jul 2017 11:14:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2E59287F9; Thu, 27 Jul 2017 11:14:28 +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 0BD92287C8 for ; Thu, 27 Jul 2017 11:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751568AbdG0LKy (ORCPT ); Thu, 27 Jul 2017 07:10:54 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58290 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbdG0LKv (ORCPT ); Thu, 27 Jul 2017 07:10:51 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6302D60911; Thu, 27 Jul 2017 11:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153850; bh=Tyx+Knvac7mUi1HzAemJ8ceIF9kqU9guTaA0Ti8t7+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JB+JYPpyVTfWyN4Wumi93MFKtbDYje1zp4jwrCzTJ6wRisqeqKTGgG9NdbSrbbiMM g8f62WD0zTbmshMude6gFTH2q6w3XccctVtydKr+XVq8apxKMK6HLlgRRAaFmnpB79 s0J15iOpWwjrbIunANECraLA+WF8FVTpxU4CYD08= 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 1032A608D4; Thu, 27 Jul 2017 11:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153850; bh=Tyx+Knvac7mUi1HzAemJ8ceIF9kqU9guTaA0Ti8t7+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JB+JYPpyVTfWyN4Wumi93MFKtbDYje1zp4jwrCzTJ6wRisqeqKTGgG9NdbSrbbiMM g8f62WD0zTbmshMude6gFTH2q6w3XccctVtydKr+XVq8apxKMK6HLlgRRAaFmnpB79 s0J15iOpWwjrbIunANECraLA+WF8FVTpxU4CYD08= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1032A608D4 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 03/12] clk: qcom: support for alpha mode configuration Date: Thu, 27 Jul 2017 16:40:16 +0530 Message-Id: <1501153825-5181-4-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> 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;