Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2849198rwd; Mon, 29 May 2023 01:38:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PqhIDrAeo+aXdGC35CCAIKDfkWyKzp2tSKrWIndw/PvAPlRRNHHOBCuGqMvJKGV1vEL6G X-Received: by 2002:a05:6a20:9187:b0:10f:9317:1539 with SMTP id v7-20020a056a20918700b0010f93171539mr6913595pzd.32.1685349480491; Mon, 29 May 2023 01:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685349480; cv=none; d=google.com; s=arc-20160816; b=jK2dL9u9YQcaW1FKmE+LJuSwfAKSrfJmywTwqK/lfItfRqD6C6UyA0HilUsb9SETel E7Sh57BmPVp9j/ugFalaStlnex6Nxi7xsybZ9BT4wohNJSnEEYdvtxu/hEf5YskUu0ha sUU3g71D9OInkcVHRLRF7ihfZoTbxe6tTu6kiAKAQ4lRLk1KLsQW+4KoSZSXJYGFr0R7 WXxwOQ0O3HwT3n5MQDEyVuo9EnvrByNadXgObh/h7yeJiIY9fNhie0cOY+x6rAeBrBPW J0nfHe7y4lhxD87Ws5sS9NJ/TyMvPgIRv+L1FkT/KsK/COl+waBggpgpN53tA1lHQcRI 3WKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=z+6vJ9zaGIlrddWwekztTVVNTWoY7fyIbT1woEoNQSA=; b=iuXGCfcoxMZiby7BC+G9EeomkfL09T4/DdHYudLUIqmIJ9cWN//6m3i0zs5MmUwe/o wqMxpnYD8283bXIr+gPgbFDMy8/XF63TiTGsuKUyJbXHXL8rooIOv6xc3nFK0LNxhlOv P5d+OZZmD+MjGngoRzWZ1tcjQGEYkrvwybHnwQfy5QjkLaOrZqoxjnw/Pt+e7flerGhs Km4Q6Q5UKuAJXwuB6X5x0XTudEJ85aZ7Y3pHsuE5TcmrP0iw2XSGM3T8E76+O6mPDL4F AimffxmT+4Rc1QBP6HfmcOzDEdC+crZa142OtE6hdL8aBdM5Uj6t35H7B8uc7TNvg7KG naVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CevULIUt; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j20-20020a637a54000000b0053592294fc0si8923732pgn.256.2023.05.29.01.37.48; Mon, 29 May 2023 01:38: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=@linaro.org header.s=google header.b=CevULIUt; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjE2ITC (ORCPT + 99 others); Mon, 29 May 2023 04:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbjE2ITB (ORCPT ); Mon, 29 May 2023 04:19:01 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AECB9BB for ; Mon, 29 May 2023 01:18:56 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2af2e1725bdso37386421fa.0 for ; Mon, 29 May 2023 01:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685348335; x=1687940335; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=z+6vJ9zaGIlrddWwekztTVVNTWoY7fyIbT1woEoNQSA=; b=CevULIUtfh0nY4vuRH08Yxw24vpwpTFAzdgVFCNAtb1J0NE0GzFw9nsECTnJ+1s/g6 QPENun5ACL0cilue2pMR+SutPLJuorgv1lxiUMR/UnmPh0uuYM0w7lBi3a/It2Kwsn4d sJrwiHFUZXG3UcXQK8gaCjT5NToBo/xCWtpqu+CydTt1fYu2nJHagyQApdHJFTmeZiX1 tXcBinKL5zbMhXHlNOOJwCUYP9aCJFcWA8/gxeoWnl7CRuwp+xSs0cR+PHZGaSCo+osj qMD7GpAEWw1hOfOegwwxoVVbcesXAVl9nwYZGXNPOxr6m73FMsADtJpVN5IXugLtupDn f+0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685348335; x=1687940335; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z+6vJ9zaGIlrddWwekztTVVNTWoY7fyIbT1woEoNQSA=; b=WTSIN36e6kkXtSXMhRYhHtszWwmsIx/KF6zPQLLPDBZjvXyAv+9Eb4oKdPIJKd8I2t HYaitxgXuPiKoeaHHn5ejekayO9jD/QWWhT5SRvy871xeFHhmIO58DlHlc8Fwx+wO38C MK48fRMInBxM7x3huB/MbZiXv5OzlwfPqBRV9X+Db6rnKzK5xS/KunVVTeukSrOrAGD1 TaBjmhzv7Fpeo+ifKe2hU413G+Z5Ddw0eDyP3i3fZFs8qZa6VDylN9OZAItNNmnv8wYK 6JXm54TNUnD+CsTa/Le/OLff+S2d8FWDyJieMV8AL5ApAi0Ra5gP5wrpJs3gtxkfOTUR aX9Q== X-Gm-Message-State: AC+VfDySld/s4/lCOKJgL1KqQIeUdSY486p+dRhT3mKN6+y+hOGYwVnW ktMF0D3GXPDrChNpkPBL+AWCYQ== X-Received: by 2002:a2e:9f09:0:b0:295:a8e6:6b15 with SMTP id u9-20020a2e9f09000000b00295a8e66b15mr2416620ljk.4.1685348334930; Mon, 29 May 2023 01:18:54 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id s10-20020a2e98ca000000b002aa4713b925sm2341755ljj.21.2023.05.29.01.18.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 May 2023 01:18:54 -0700 (PDT) Message-ID: <2d044f14-65c0-be3f-595f-4ddb46df6fef@linaro.org> Date: Mon, 29 May 2023 10:18:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 3/3] clk: qcom: cbf-msm8996: Add support for MSM8996 Pro Content-Language: en-US To: Yassine Oudjana , Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov Cc: Yassine Oudjana , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230527093934.101335-1-y.oudjana@protonmail.com> <20230527093934.101335-4-y.oudjana@protonmail.com> From: Konrad Dybcio In-Reply-To: <20230527093934.101335-4-y.oudjana@protonmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 27.05.2023 11:39, Yassine Oudjana wrote: > From: Yassine Oudjana > > The CBF PLL on MSM8996 Pro has a /4 post divisor instead of /2. Handle the > difference accordingly. > > Signed-off-by: Yassine Oudjana > --- > drivers/clk/qcom/clk-cbf-8996.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/qcom/clk-cbf-8996.c b/drivers/clk/qcom/clk-cbf-8996.c > index cfd567636f4e..ab988e6f1976 100644 > --- a/drivers/clk/qcom/clk-cbf-8996.c > +++ b/drivers/clk/qcom/clk-cbf-8996.c > @@ -48,7 +48,7 @@ static const u8 cbf_pll_regs[PLL_OFF_MAX_REGS] = { > [PLL_OFF_STATUS] = 0x28, > }; > > -static const struct alpha_pll_config cbfpll_config = { > +static struct alpha_pll_config cbfpll_config = { > .l = 72, > .config_ctl_val = 0x200d4828, > .config_ctl_hi_val = 0x006, > @@ -137,7 +137,7 @@ static int clk_cbf_8996_mux_determine_rate(struct clk_hw *hw, > { > struct clk_hw *parent; > > - if (req->rate < (DIV_THRESHOLD / 2)) > + if (req->rate < (DIV_THRESHOLD / cbf_pll_postdiv.div)) > return -EINVAL; > > if (req->rate < DIV_THRESHOLD) > @@ -265,6 +265,11 @@ static int qcom_msm8996_cbf_probe(struct platform_device *pdev) > /* Switch CBF to use the primary PLL */ > regmap_update_bits(regmap, CBF_MUX_OFFSET, CBF_MUX_PARENT_MASK, 0x1); > > + if (of_device_is_compatible(dev->of_node, "qcom,msm8996pro-cbf")) { If this was a driver for more than 1.5 SoCs, I'd propose using a different mechanism here (match data flags or something), but since there aren't (and hopefully won't ever be) more 8996s (automotive etc. inherit one of these configurations so that doesn't count), I'm willing to say Reviewed-by: Konrad Dybcio Konrad > + cbfpll_config.post_div_val = 0x3 << 8; > + cbf_pll_postdiv.div = 4; > + } > + > for (i = 0; i < ARRAY_SIZE(cbf_msm8996_hw_clks); i++) { > ret = devm_clk_hw_register(dev, cbf_msm8996_hw_clks[i]); > if (ret) > @@ -286,6 +291,7 @@ static int qcom_msm8996_cbf_probe(struct platform_device *pdev) > > static const struct of_device_id qcom_msm8996_cbf_match_table[] = { > { .compatible = "qcom,msm8996-cbf" }, > + { .compatible = "qcom,msm8996pro-cbf" }, > { /* sentinel */ }, > }; > MODULE_DEVICE_TABLE(of, qcom_msm8996_cbf_match_table);