Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1356601imi; Sat, 23 Jul 2022 03:28:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sF3FXoFGxaVuMhuebbS9IubAmJw826WantP+nptdw9VOf7WhR0Z5lEqXesrR3iJ+UWfM3p X-Received: by 2002:a05:6402:2743:b0:43a:7f92:8e30 with SMTP id z3-20020a056402274300b0043a7f928e30mr3665286edd.168.1658572109002; Sat, 23 Jul 2022 03:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658572108; cv=none; d=google.com; s=arc-20160816; b=nVyn475SedINQHXM3FJP+ZD7ZRriWwcL0PhddkFEplqlPWZoznZHlDuRj+4+TKXJ5E eDTuLlOHxRegTmpZcpUtWcCHLIhtroc+EQ44L9rLfUfAIQ/jLS17pLHDYPrvtwgYFKyO xWNjNDThMo09Eac5Ua8QtPD56Jqf2mwuXjaAZETnIcDcqeHBIMuF4ThCXFungBlnXeGs zQSe5S7w/gv6CU2H2ZX9xFM1LcXVGcS3jtPiai+5zfIk3uXn8DNUYEQv/jGymvrkG2tg QPA89eOaOHSa69XIoVqI8WKYs3AGOeL+XsvArLpGl/DgNMIT9X5fMBTHHGl/rwfA8ydW hv+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QdtkzoRpj8UwcD/H82RNB7sTLDsVmKJjoIgn8OZbfgc=; b=hRq2/CmqVvJyAlkvMe1ftBIrJgMcEqWWhjZOcTsnGXCVPEMEd8itGN0YlhCHGkMsRC RVI9TLR5jfGfm4Gix6nLRjDuS63DPzO3cukvqJo2T7Kkc2MV9Jen34hK7hJ7V7VPAL68 03itpLAzJnUGh0XXYZHqOcR7YUBEv+CLvEDMNH5CYvGbZZ80G4+i0hXcGReIXhbwSPCU zZQY7BQdAuf4nkuMvktB/DfoxavulVJ/CSPizZEiIhXYW5/w6/Z4swn4A8YC8aw36WrA oS5Cp7qdkwY8KlEDedWrZvu0RGkJbFjLDD2T+ar4tXR92L2LymMG6FBKYoU08IO6R2Q/ 3Hxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l26-20020a170906231a00b0072397249ecbsi6675548eja.928.2022.07.23.03.28.04; Sat, 23 Jul 2022 03:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238878AbiGWKIn (ORCPT + 99 others); Sat, 23 Jul 2022 06:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238758AbiGWKIV (ORCPT ); Sat, 23 Jul 2022 06:08:21 -0400 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [IPv6:2001:4b7a:2000:18::162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF80C5D7D for ; Sat, 23 Jul 2022 03:01:47 -0700 (PDT) Received: from localhost.localdomain (abxj77.neoplus.adsl.tpnet.pl [83.9.3.77]) by m-r1.th.seeweb.it (Postfix) with ESMTPA id 25D192067B; Sat, 23 Jul 2022 12:01:40 +0200 (CEST) From: Konrad Dybcio To: ~postmarketos/upstreaming@lists.sr.ht Cc: martin.botka@somainline.org, angelogioacchino.delregno@somainline.org, marijn.suijten@somainline.org, jamipkettunen@somainline.org, Konrad Dybcio , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] clk: qcom: alpha: Add support for programming the PLL_FSM_LEGACY_MODE bit Date: Sat, 23 Jul 2022 12:01:33 +0200 Message-Id: <20220723100135.91784-1-konrad.dybcio@somainline.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is used on at least SM6375 and its variations. Signed-off-by: Konrad Dybcio --- No changes since v1/v2 drivers/clk/qcom/clk-alpha-pll.c | 5 +++++ drivers/clk/qcom/clk-alpha-pll.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index b42684703fbb..ea157723906a 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -27,6 +27,7 @@ # define PLL_VOTE_FSM_RESET BIT(21) # define PLL_UPDATE BIT(22) # define PLL_UPDATE_BYPASS BIT(23) +# define PLL_FSM_LEGACY_MODE BIT(24) # define PLL_OFFLINE_ACK BIT(28) # define ALPHA_PLL_ACK_LATCH BIT(29) # define PLL_ACTIVE_FLAG BIT(30) @@ -1102,6 +1103,10 @@ void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, regmap_update_bits(regmap, PLL_USER_CTL(pll), mask, val); } + if (pll->flags & SUPPORTS_FSM_LEGACY_MODE) + regmap_update_bits(regmap, PLL_MODE(pll), PLL_FSM_LEGACY_MODE, + PLL_FSM_LEGACY_MODE); + regmap_update_bits(regmap, PLL_MODE(pll), PLL_UPDATE_BYPASS, PLL_UPDATE_BYPASS); diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index 447efb82fe59..b15a62cb8e36 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -70,9 +70,10 @@ struct clk_alpha_pll { const struct pll_vco *vco_table; size_t num_vco; -#define SUPPORTS_OFFLINE_REQ BIT(0) -#define SUPPORTS_FSM_MODE BIT(2) +#define SUPPORTS_OFFLINE_REQ BIT(0) +#define SUPPORTS_FSM_MODE BIT(2) #define SUPPORTS_DYNAMIC_UPDATE BIT(3) +#define SUPPORTS_FSM_LEGACY_MODE BIT(4) u8 flags; struct clk_regmap clkr; -- 2.37.1