linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
	 Dmitry Baryshkov <lumag@kernel.org>,
	 Abhinav Kumar <abhinav.kumar@linux.dev>,
	 Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	 Marijn Suijten <marijn.suijten@somainline.org>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Maxime Ripard <mripard@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	 dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org,  linux-kernel@vger.kernel.org,
	Brian Masney <bmasney@redhat.com>
Subject: [PATCH v2 1/7] drm/msm/dsi_phy_10nm: convert from round_rate() to determine_rate()
Date: Sun, 10 Aug 2025 18:57:25 -0400	[thread overview]
Message-ID: <20250810-drm-msm-phy-clk-round-rate-v2-1-0fd1f7979c83@redhat.com> (raw)
In-Reply-To: <20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series. The change to use clamp_t() was
done manually.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
index af2e30f3f842a0157f161172bfe42059cabe6a8a..ec486ff02c9b5156cdf0902d05464cf57dc9605b 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
@@ -444,21 +444,19 @@ static unsigned long dsi_pll_10nm_vco_recalc_rate(struct clk_hw *hw,
 	return (unsigned long)vco_rate;
 }
 
-static long dsi_pll_10nm_clk_round_rate(struct clk_hw *hw,
-		unsigned long rate, unsigned long *parent_rate)
+static int dsi_pll_10nm_clk_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct dsi_pll_10nm *pll_10nm = to_pll_10nm(hw);
 
-	if      (rate < pll_10nm->phy->cfg->min_pll_rate)
-		return  pll_10nm->phy->cfg->min_pll_rate;
-	else if (rate > pll_10nm->phy->cfg->max_pll_rate)
-		return  pll_10nm->phy->cfg->max_pll_rate;
-	else
-		return rate;
+	req->rate = clamp_t(unsigned long, req->rate,
+			    pll_10nm->phy->cfg->min_pll_rate, pll_10nm->phy->cfg->max_pll_rate);
+
+	return 0;
 }
 
 static const struct clk_ops clk_ops_dsi_pll_10nm_vco = {
-	.round_rate = dsi_pll_10nm_clk_round_rate,
+	.determine_rate = dsi_pll_10nm_clk_determine_rate,
 	.set_rate = dsi_pll_10nm_vco_set_rate,
 	.recalc_rate = dsi_pll_10nm_vco_recalc_rate,
 	.prepare = dsi_pll_10nm_vco_prepare,

-- 
2.50.1


  reply	other threads:[~2025-08-10 22:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 22:57 [PATCH v2 0/7] drm/msm/dsi/phy: convert from clk round_rate() to determine_rate() Brian Masney
2025-08-10 22:57 ` Brian Masney [this message]
2025-08-11 10:30   ` [PATCH v2 1/7] drm/msm/dsi_phy_10nm: convert from " Dmitry Baryshkov
2025-08-11 10:33   ` Konrad Dybcio
2025-08-10 22:57 ` [PATCH v2 2/7] drm/msm/dsi_phy_14nm: " Brian Masney
2025-08-11 10:31   ` Dmitry Baryshkov
2025-08-11 10:33   ` Konrad Dybcio
2025-08-10 22:57 ` [PATCH v2 3/7] drm/msm/dsi_phy_28nm_8960: " Brian Masney
2025-08-11 10:33   ` Dmitry Baryshkov
2025-08-11 10:33   ` Konrad Dybcio
2025-08-10 22:57 ` [PATCH v2 4/7] drm/msm/dsi_phy_28nm: " Brian Masney
2025-08-11 10:33   ` Konrad Dybcio
2025-08-11 10:35   ` Dmitry Baryshkov
2025-08-10 22:57 ` [PATCH v2 5/7] drm/msm/dsi_phy_7nm: " Brian Masney
2025-08-11 10:33   ` Konrad Dybcio
2025-08-11 10:35   ` Dmitry Baryshkov
2025-08-10 22:57 ` [PATCH v2 6/7] drm/msm/hdmi_phy_8996: " Brian Masney
2025-08-11 10:33   ` Konrad Dybcio
2025-08-11 10:35   ` Dmitry Baryshkov
2025-08-10 22:57 ` [PATCH v2 7/7] drm/msm/hdmi_phy_8998: " Brian Masney
2025-08-11 10:33   ` Konrad Dybcio
2025-08-11 10:36   ` Dmitry Baryshkov
2025-08-11  9:02 ` [PATCH v2 0/7] drm/msm/dsi/phy: convert from clk " Konrad Dybcio
2025-08-11 10:32   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250810-drm-msm-phy-clk-round-rate-v2-1-0fd1f7979c83@redhat.com \
    --to=bmasney@redhat.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=mripard@kernel.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sboyd@kernel.org \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).