Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1703808imw; Sat, 16 Jul 2022 12:48:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tFUVGJIurWaP3sLgQDJ+f2o6s6vTYbSdmZzUG4+9PjNv8+bLigxl6X99tKG5I5pE7VfPeD X-Received: by 2002:a05:6402:4411:b0:437:b723:72 with SMTP id y17-20020a056402441100b00437b7230072mr27515380eda.38.1658000912062; Sat, 16 Jul 2022 12:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658000912; cv=none; d=google.com; s=arc-20160816; b=cMhmHdaNxHR1br65Q66+AJ2jcJWjdWPPVx0M1jCQmsI/1aQkFDWz14pQhCDrvHx993 ZDjqH1bfu6K6p/B2pgp/S2ZDcKEvs3NuFVFRKJWO9oQoDMmxN/3P3RoNFvNR22mx6p4u 5UgGqUFpQJuN0j+38zR9kbf9VmlnfHTmRlbK9KI6SFrTPJm2L32kvAhcjKlp7s8dUpMs oFYLkPr2X+IejbsWFhllyPq0aQnXtTRNYT0edQPNOJQRc8Fuw2Ib8vT6FwxroqmgtBrB 8dWT7bNJ5VBxwiAZ42Ltly7pS0zSK+wZYJoqPXGKruhMsJ71csOwe4p3zXo9h875W2eb ovvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aWAVVvzyPMTq1GlpY1ZZlOLWs/t/puSCHFOnoiTPOQo=; b=J7jrcWya8h5YRqfV3SWeejo4yYYvfoR7CHzqlmNohXS3AloxWHtF7lAMAzwrFc1oxi +14NyU1xexdlN/5YbrOu7oCjDt91HfMh9Y9OvdBS21aKfdDBAD0jqEf69J/CoUDdg6iG X/UgVpOuU/FEnIWRF8cMJtx6Q87jlmL4wEGtd1srbbdKwPMFHFqMuXRUSP9gQeo1b0lj zrMV2W830fr8Jwwdh7rZzskdjSyb7Mnje/vwvUGvopMbW4dfnFy5QzdqqmkmYW3Wwnw3 HfBUw7UmHgXLV+bEFw98FCNB8IBIVhDRNz4E7u5J+G9OII6JnAmgDu3QP5tbPLiNWz+9 npMA== 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 q13-20020a1709064c8d00b0072ed9ed7276si9506017eju.203.2022.07.16.12.48.07; Sat, 16 Jul 2022 12:48:32 -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 S229776AbiGPTWu (ORCPT + 99 others); Sat, 16 Jul 2022 15:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbiGPTWt (ORCPT ); Sat, 16 Jul 2022 15:22:49 -0400 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [5.144.164.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DFF117E3E; Sat, 16 Jul 2022 12:22: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 9913B1F986; Sat, 16 Jul 2022 21:22:43 +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 , Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] clk: qcom: alpha: Add support for programming the PLL_FSM_LEGACY_MODE bit Date: Sat, 16 Jul 2022 21:22:35 +0200 Message-Id: <20220716192237.452823-2-konrad.dybcio@somainline.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716192237.452823-1-konrad.dybcio@somainline.org> References: <20220716192237.452823-1-konrad.dybcio@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 --- 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.0