From patchwork Thu Jul 27 11:10:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9866625 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 861326038C for ; Thu, 27 Jul 2017 11:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7801328758 for ; Thu, 27 Jul 2017 11:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CF22287C8; Thu, 27 Jul 2017 11:12: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=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 26BB428758 for ; Thu, 27 Jul 2017 11:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbdG0LMY (ORCPT ); Thu, 27 Jul 2017 07:12:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58668 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdG0LLO (ORCPT ); Thu, 27 Jul 2017 07:11:14 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4A2A3609C6; Thu, 27 Jul 2017 11:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153874; bh=PHkEnjeR/imtY34ieoUt5o3ul1nTO/RZ1YmnxI318pY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nhCZt7YMgiLvwZhXLIOYgiIP8r9JC2YM74b1kP5ZvvdeTmPQ99Nx0nkkjQqVTBaI0 gskFpXc8D6ptOrcXqmYBs1MZ1KZK0k9mxXarjYYTIlyYff9alODV4o3NTq4Wd1nxIw UOOz5xJANEbdBkeow4BvUVnGQnUikOALxwflr/dQ= 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 A82D66090C; Thu, 27 Jul 2017 11:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501153873; bh=PHkEnjeR/imtY34ieoUt5o3ul1nTO/RZ1YmnxI318pY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4I2vOIdsadZssM83uwy1yLYO0C48HPpjn/T+p+QvjpbZ48NiWk20Yf4KYUXI0EOa tA52RjlLl95zr2PnPlZbfdTwFn25MOjO/CJ4wfDQ6wCJPWF50AQxIY1pywANcQXUlB mLhy61ZMGXuOxOXQvp47D7IeguxeRwxWWIQFDjrA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A82D66090C 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 09/12] clk: qcom: support for Brammo PLL Date: Thu, 27 Jul 2017 16:40:22 +0530 Message-Id: <1501153825-5181-10-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 Brammo PLL does not allow configuration of VCO and it supports the dynamic update in which the frequency can be changed dynamically without turning off the PLL. Signed-off-by: Abhishek Sahu --- drivers/clk/qcom/clk-alpha-pll.c | 12 ++++++++++++ drivers/clk/qcom/clk-alpha-pll.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index d17d83a..e37a3ab 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -52,6 +52,7 @@ #define PLL_HUAYRA_N_MASK 0xff #define PLL_HUAYRA_ALPHA_WIDTH 16 +#define PLL_BRAMMO_ALPHA_BITWIDTH 40 /* * Even though 40 bits are present, use only 32 for ease of calculation. */ @@ -105,6 +106,17 @@ [ALPHA_PLL_STATUS] = 0x24, }; +const u8 brammo_pll_offsets[] = { + [ALPHA_PLL_MODE] = 0x00, + [ALPHA_PLL_L_VAL] = 0x04, + [ALPHA_PLL_ALPHA_VAL] = 0x08, + [ALPHA_PLL_ALPHA_VAL_U] = 0x0c, + [ALPHA_PLL_USER_CTL] = 0x10, + [ALPHA_PLL_CONFIG_CTL] = 0x18, + [ALPHA_PLL_TEST_CTL] = 0x1c, + [ALPHA_PLL_STATUS] = 0x24, +}; + static int wait_for_pll(struct clk_alpha_pll *pll, u32 mask, bool inverse, const char *action) { diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index c98e7469..891d14b 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -64,6 +64,7 @@ struct clk_alpha_pll { #define CLK_HUAYRA_PLL_FLAGS (HAVE_NO_VCO_CONF | SUPPORTS_DYNAMIC_UPDATE | \ SUPPORTS_64BIT_CONFIG_CTL | \ SUPPORTS_16BIT_ALPHA) +#define CLK_BRAMMO_PLL_FLAGS (HAVE_NO_VCO_CONF | SUPPORTS_DYNAMIC_UPDATE) /** * struct clk_alpha_pll_postdiv - phase locked loop (PLL) post-divider @@ -102,6 +103,7 @@ struct alpha_pll_config { extern const u8 alpha_pll_offsets[]; extern const u8 huayra_pll_offsets[]; +extern const u8 brammo_pll_offsets[]; extern const struct clk_ops clk_alpha_pll_ops; extern const struct clk_ops clk_alpha_pll_hwfsm_ops;