Message ID | 20230509161218.11979-2-quic_jkona@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3017293vqo; Tue, 9 May 2023 09:32:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hnPFzInCI37mRaIvOHt8V/3ATebfcm2VevT6G92r6Ic7l+fXG6gGP9cW742a5HFaNKc2v X-Received: by 2002:a17:902:8481:b0:1a9:826c:8f44 with SMTP id c1-20020a170902848100b001a9826c8f44mr13016918plo.32.1683649920835; Tue, 09 May 2023 09:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683649920; cv=none; d=google.com; s=arc-20160816; b=mZd6ZVLVVeg+8bOuTzIs5AJR1oTWYxuWYzG87p0ebp/BhFFS5PmIGdM56jiS6FjRU7 jxNIdEZTydI8g8dNKxoQwY0ELOoBp3FzlKfX6e4V96BIzI0elUba9kQg3+Ttfzlqk5yY FiVA0NUblNwF30BAvgLU55tPfNOfeyjzV2geTs9MB9qeZ7WjBMPWPQMbSRqv2NJdiZy0 qvA3l9v1gGz28CzFlnikKzBn0UOhwTXQyOqNAdww9tmZEGQfUyMnC2lXTlxla+fNyowx q4tIeIX+ig7e/rzy8T6GweEkd83as2E8to8bcmV3FWKI6johN0DtH2NBw6821J1ssi02 wNrw== 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 :dkim-signature; bh=3nIpmMfn0GgSbYKl2eKouNnVNprFqr1ccl0WObErS48=; b=neC/2tYGCf1Vm2eBz9aeF0D52uMQtkG+6bImdjKMtXTdC5f/bxH2PXpN1DTjn5yozi JQ5YGuB6wUNa0vNTNk7wql4HRWqAsfbSaPeg05q0ctjBG3WJZEvKz5PbDfZDvRQT563n io6Xzi3ANtZyzSNlT/YWYIwyAgzhSqqbD8OJhbXA5VD5zgJ8EnDzV5BHSXWtdTkZtemB +hp9t+SSUUHjt0AaJNnaxDjZk5yoMD/nWseoa3AyhTcZhwDTxm9LB5Hmw9TFYDFX1miv 2VpNM9ksxNAnsL9rt+MaOmEDeIgPWvTY2Fwk4aD+1zYqV3kMVL5d5h2O3DL9M/VZMrvc Tn2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="OuCLtcf/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020a170902ec0200b001a242dbbd27si1791950pld.513.2023.05.09.09.31.48; Tue, 09 May 2023 09:32:00 -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; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="OuCLtcf/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235852AbjEIQNT (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 12:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235879AbjEIQNQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 12:13:16 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44ABE4203; Tue, 9 May 2023 09:13:15 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 349Eegik001624; Tue, 9 May 2023 16:13:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=3nIpmMfn0GgSbYKl2eKouNnVNprFqr1ccl0WObErS48=; b=OuCLtcf/es6+IvdlPuOTDeKqWTAt1DGAh3ON4tQ31IPp24wiq0GPDap5GooloiaOrB68 EPO1lBqzmzalhrckIl+frv9CBYSXTGVEcejUXRxjkQPgWx/XfgJg177EPNSZQUBu9g+y EeaKhTxUPYGN3Km8ypkNiS8jC/7Duz3cRpBm4XjQe/CLDjIJ/9kF39iN5rs26a8ERh6T NwB01cpQ85Y6QvVwic+n+1iT8J95re5Gr/6041pV8pZj3SskSHpMrrXKZTVbUOuCi0EF iTt13mY4n2qHyMDcHnjICzCFKwooIuOw5JE1786VFOoiDyRqkXm0vusD/H7apuWEZB+E pQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qfr5089fs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 May 2023 16:13:11 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 349GDAWn025780 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 May 2023 16:13:10 GMT Received: from hu-jkona-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 9 May 2023 09:13:06 -0700 From: Jagadeesh Kona <quic_jkona@quicinc.com> To: Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Michael Turquette <mturquette@baylibre.com>, Conor Dooley <conor+dt@kernel.org> CC: Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Jagadeesh Kona <quic_jkona@quicinc.com>, "Taniya Das" <quic_tdas@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH 1/4] clk: qcom: clk-alpha-pll: Add support for lucid ole pll ops Date: Tue, 9 May 2023 21:42:15 +0530 Message-ID: <20230509161218.11979-2-quic_jkona@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509161218.11979-1-quic_jkona@quicinc.com> References: <20230509161218.11979-1-quic_jkona@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: FRNaBhGw9h2DooLZqgHeR5pRZCzhNjaZ X-Proofpoint-ORIG-GUID: FRNaBhGw9h2DooLZqgHeR5pRZCzhNjaZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-09_09,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=853 bulkscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 impostorscore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305090133 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765434899237581098?= X-GMAIL-MSGID: =?utf-8?q?1765434899237581098?= |
Series |
Add Video Clock Controller driver for SM8550
|
|
Commit Message
Jagadeesh Kona
May 9, 2023, 4:12 p.m. UTC
From: Taniya Das <quic_tdas@quicinc.com> Add support for lucid ole pll ops to configure and control the lucid ole pll. The lucid ole pll has an additional test control register which is required to be programmed, add support to program the same. Signed-off-by: Taniya Das <quic_tdas@quicinc.com> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> --- drivers/clk/qcom/clk-alpha-pll.c | 2 ++ drivers/clk/qcom/clk-alpha-pll.h | 4 ++++ 2 files changed, 6 insertions(+)
Comments
On 9.05.2023 18:12, Jagadeesh Kona wrote: > From: Taniya Das <quic_tdas@quicinc.com> > > Add support for lucid ole pll ops to configure and control the > lucid ole pll. The lucid ole pll has an additional test control > register which is required to be programmed, add support to > program the same. > > Signed-off-by: Taniya Das <quic_tdas@quicinc.com> > Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> > --- Isn't this commit "write to PLL_TEST_CTL_U2 on LUCID_EVO" instead? Meaninglessly duplicating ops does not seem useful. Konrad > drivers/clk/qcom/clk-alpha-pll.c | 2 ++ > drivers/clk/qcom/clk-alpha-pll.h | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c > index b9f6535a7ba7..f81c7c561352 100644 > --- a/drivers/clk/qcom/clk-alpha-pll.c > +++ b/drivers/clk/qcom/clk-alpha-pll.c > @@ -55,6 +55,7 @@ > #define PLL_TEST_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL]) > #define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U]) > #define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1]) > +#define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2]) > #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) > #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) > #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) > @@ -2096,6 +2097,7 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma > clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val); > clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val); > clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val); > + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val); > > /* Disable PLL output */ > regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0); > diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h > index d07b17186b90..4d9b6d5b7062 100644 > --- a/drivers/clk/qcom/clk-alpha-pll.h > +++ b/drivers/clk/qcom/clk-alpha-pll.h > @@ -125,6 +125,7 @@ struct alpha_pll_config { > u32 test_ctl_val; > u32 test_ctl_hi_val; > u32 test_ctl_hi1_val; > + u32 test_ctl_hi2_val; > u32 main_output_mask; > u32 aux_output_mask; > u32 aux2_output_mask; > @@ -171,6 +172,7 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops; > #define clk_alpha_pll_postdiv_zonda_ops clk_alpha_pll_postdiv_fabia_ops > > extern const struct clk_ops clk_alpha_pll_lucid_evo_ops; > +#define clk_alpha_pll_lucid_ole_ops clk_alpha_pll_lucid_evo_ops > extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops; > #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops > extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops; > @@ -196,6 +198,8 @@ void clk_zonda_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, > const struct alpha_pll_config *config); > void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, > const struct alpha_pll_config *config); > +#define clk_lucid_ole_pll_configure(pll, regmap, config) \ > + clk_lucid_evo_pll_configure(pll, regmap, config) > void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, > const struct alpha_pll_config *config); > void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Hi, Thanks Konrad for your review! On 5/10/2023 1:36 AM, Konrad Dybcio wrote: > > > On 9.05.2023 18:12, Jagadeesh Kona wrote: >> From: Taniya Das <quic_tdas@quicinc.com> >> >> Add support for lucid ole pll ops to configure and control the >> lucid ole pll. The lucid ole pll has an additional test control >> register which is required to be programmed, add support to >> program the same. >> >> Signed-off-by: Taniya Das <quic_tdas@quicinc.com> >> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> >> --- > Isn't this commit "write to PLL_TEST_CTL_U2 on LUCID_EVO" instead? > > Meaninglessly duplicating ops does not seem useful. > > Konrad Though we are reusing same ops for EVO and OLE, PLL_TEST_CTL_U2 register programming is applicable only to OLE PLL type. And PLL type is useful to properly refer respective hardware datasheets. Hence added separate ops for OLE PLL type. >> drivers/clk/qcom/clk-alpha-pll.c | 2 ++ >> drivers/clk/qcom/clk-alpha-pll.h | 4 ++++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c >> index b9f6535a7ba7..f81c7c561352 100644 >> --- a/drivers/clk/qcom/clk-alpha-pll.c >> +++ b/drivers/clk/qcom/clk-alpha-pll.c >> @@ -55,6 +55,7 @@ >> #define PLL_TEST_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL]) >> #define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U]) >> #define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1]) >> +#define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2]) >> #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) >> #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) >> #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) >> @@ -2096,6 +2097,7 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma >> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val); >> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val); >> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val); >> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val); >> >> /* Disable PLL output */ >> regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0); >> diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h >> index d07b17186b90..4d9b6d5b7062 100644 >> --- a/drivers/clk/qcom/clk-alpha-pll.h >> +++ b/drivers/clk/qcom/clk-alpha-pll.h >> @@ -125,6 +125,7 @@ struct alpha_pll_config { >> u32 test_ctl_val; >> u32 test_ctl_hi_val; >> u32 test_ctl_hi1_val; >> + u32 test_ctl_hi2_val; >> u32 main_output_mask; >> u32 aux_output_mask; >> u32 aux2_output_mask; >> @@ -171,6 +172,7 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops; >> #define clk_alpha_pll_postdiv_zonda_ops clk_alpha_pll_postdiv_fabia_ops >> >> extern const struct clk_ops clk_alpha_pll_lucid_evo_ops; >> +#define clk_alpha_pll_lucid_ole_ops clk_alpha_pll_lucid_evo_ops >> extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops; >> #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops >> extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops; >> @@ -196,6 +198,8 @@ void clk_zonda_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >> const struct alpha_pll_config *config); >> void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >> const struct alpha_pll_config *config); >> +#define clk_lucid_ole_pll_configure(pll, regmap, config) \ >> + clk_lucid_evo_pll_configure(pll, regmap, config) >> void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >> const struct alpha_pll_config *config); >> void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, Thanks & Regards, Jagadeesh
On 19.05.2023 14:49, Jagadeesh Kona wrote: > Hi, > > Thanks Konrad for your review! > > On 5/10/2023 1:36 AM, Konrad Dybcio wrote: >> >> >> On 9.05.2023 18:12, Jagadeesh Kona wrote: >>> From: Taniya Das <quic_tdas@quicinc.com> >>> >>> Add support for lucid ole pll ops to configure and control the >>> lucid ole pll. The lucid ole pll has an additional test control >>> register which is required to be programmed, add support to >>> program the same. >>> >>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com> >>> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> >>> --- >> Isn't this commit "write to PLL_TEST_CTL_U2 on LUCID_EVO" instead? >> >> Meaninglessly duplicating ops does not seem useful. >> >> Konrad > > Though we are reusing same ops for EVO and OLE, PLL_TEST_CTL_U2 register programming is applicable only to OLE PLL type. Well, your patch makes it unconditional (modulo programmer error) so I think that makes little sense.. A comment would be enough, imo. Konrad And PLL type is useful to properly refer respective hardware datasheets. Hence added separate ops for OLE PLL type. > > >>> drivers/clk/qcom/clk-alpha-pll.c | 2 ++ >>> drivers/clk/qcom/clk-alpha-pll.h | 4 ++++ >>> 2 files changed, 6 insertions(+) >>> >>> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c >>> index b9f6535a7ba7..f81c7c561352 100644 >>> --- a/drivers/clk/qcom/clk-alpha-pll.c >>> +++ b/drivers/clk/qcom/clk-alpha-pll.c >>> @@ -55,6 +55,7 @@ >>> #define PLL_TEST_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL]) >>> #define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U]) >>> #define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1]) >>> +#define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2]) >>> #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) >>> #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) >>> #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) >>> @@ -2096,6 +2097,7 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma >>> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val); >>> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val); >>> clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val); >>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val); >>> /* Disable PLL output */ >>> regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0); >>> diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h >>> index d07b17186b90..4d9b6d5b7062 100644 >>> --- a/drivers/clk/qcom/clk-alpha-pll.h >>> +++ b/drivers/clk/qcom/clk-alpha-pll.h >>> @@ -125,6 +125,7 @@ struct alpha_pll_config { >>> u32 test_ctl_val; >>> u32 test_ctl_hi_val; >>> u32 test_ctl_hi1_val; >>> + u32 test_ctl_hi2_val; >>> u32 main_output_mask; >>> u32 aux_output_mask; >>> u32 aux2_output_mask; >>> @@ -171,6 +172,7 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops; >>> #define clk_alpha_pll_postdiv_zonda_ops clk_alpha_pll_postdiv_fabia_ops >>> extern const struct clk_ops clk_alpha_pll_lucid_evo_ops; >>> +#define clk_alpha_pll_lucid_ole_ops clk_alpha_pll_lucid_evo_ops >>> extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops; >>> #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops >>> extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops; >>> @@ -196,6 +198,8 @@ void clk_zonda_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >>> const struct alpha_pll_config *config); >>> void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >>> const struct alpha_pll_config *config); >>> +#define clk_lucid_ole_pll_configure(pll, regmap, config) \ >>> + clk_lucid_evo_pll_configure(pll, regmap, config) >>> void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, >>> const struct alpha_pll_config *config); >>> void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, > > Thanks & Regards, > Jagadeesh
Hi Konrad, Thanks for your review! On 5/19/2023 6:39 PM, Konrad Dybcio wrote: > > > On 19.05.2023 14:49, Jagadeesh Kona wrote: >> Hi, >> >> Thanks Konrad for your review! >> >> On 5/10/2023 1:36 AM, Konrad Dybcio wrote: >>> >>> >>> On 9.05.2023 18:12, Jagadeesh Kona wrote: >>>> From: Taniya Das <quic_tdas@quicinc.com> >>>> >>>> Add support for lucid ole pll ops to configure and control the >>>> lucid ole pll. The lucid ole pll has an additional test control >>>> register which is required to be programmed, add support to >>>> program the same. >>>> >>>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com> >>>> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> >>>> --- >>> Isn't this commit "write to PLL_TEST_CTL_U2 on LUCID_EVO" instead? >>> >>> Meaninglessly duplicating ops does not seem useful. >>> >>> Konrad >> >> Though we are reusing same ops for EVO and OLE, PLL_TEST_CTL_U2 register programming is applicable only to OLE PLL type. > Well, your patch makes it unconditional (modulo programmer error) so > I think that makes little sense.. A comment would be enough, imo. > > Konrad Yes, will remove the duplicate definitions and will reuse the existing ops. > And PLL type is useful to properly refer respective hardware datasheets. Hence added separate ops for OLE PLL type. >> Thanks & Regards, Jagadeesh
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index b9f6535a7ba7..f81c7c561352 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -55,6 +55,7 @@ #define PLL_TEST_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL]) #define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U]) #define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1]) +#define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2]) #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) @@ -2096,6 +2097,7 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val); clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val); clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val); + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val); /* Disable PLL output */ regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0); diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index d07b17186b90..4d9b6d5b7062 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -125,6 +125,7 @@ struct alpha_pll_config { u32 test_ctl_val; u32 test_ctl_hi_val; u32 test_ctl_hi1_val; + u32 test_ctl_hi2_val; u32 main_output_mask; u32 aux_output_mask; u32 aux2_output_mask; @@ -171,6 +172,7 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops; #define clk_alpha_pll_postdiv_zonda_ops clk_alpha_pll_postdiv_fabia_ops extern const struct clk_ops clk_alpha_pll_lucid_evo_ops; +#define clk_alpha_pll_lucid_ole_ops clk_alpha_pll_lucid_evo_ops extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops; #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops; @@ -196,6 +198,8 @@ void clk_zonda_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, const struct alpha_pll_config *config); void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, const struct alpha_pll_config *config); +#define clk_lucid_ole_pll_configure(pll, regmap, config) \ + clk_lucid_evo_pll_configure(pll, regmap, config) void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, const struct alpha_pll_config *config); void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,