From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60394C83F17 for ; Thu, 10 Jul 2025 17:43:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCBC910E943; Thu, 10 Jul 2025 17:43:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="gIxkbYzh"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66BD510E11D for ; Thu, 10 Jul 2025 17:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaCFEBEkzEIEZX6+yQZzsmVx8NsnWbygGYV4RPX8K+w=; b=gIxkbYzhzJu9VXAhX0wu0qWinqNz/xR4w9iiOZTxiv+FyLatwWf3B6i73Rwg9HJFIsU6Fq XgljN4s7m+HJu5Kow/8aEnc2/vbjHtl+19UvZLc8tQCiPaobidwJYcfwVNuNY9M1W1CTq7 NWrJnlIh52wp7Z0cEjnEhOI8kby0kq0= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-nfLixFPxO9qxRIK6IpPMzw-1; Thu, 10 Jul 2025 13:43:37 -0400 X-MC-Unique: nfLixFPxO9qxRIK6IpPMzw-1 X-Mimecast-MFC-AGG-ID: nfLixFPxO9qxRIK6IpPMzw_1752169416 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6fb2910dd04so20320546d6.0 for ; Thu, 10 Jul 2025 10:43:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169416; x=1752774216; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaCFEBEkzEIEZX6+yQZzsmVx8NsnWbygGYV4RPX8K+w=; b=hACxTLJhN67NVHHAlE0X/SV1JRzckegxbI+x7cheEs2it9dhrGgD6vlfCrY8iH4jgS +6c5eE3BWhrDHw0rBsfm8Rl4ewk0+LpIRJVmmYD2+zh58gLDTyoh3k7BZpULtSwBPDVm dQSfCwjwKGOaDgwnbxvS6RI6mncYnnCCqHp7DyTdE14qiLWnQzBRoHG5Lu3W+Yfeygoz /Qt2uxi8LvC5HnITLn6Xp0uneeWMxGXYybFaBXr8YD/dCszQzcwKeixChLXQwRCGuPtW do5X6wShGRfKV2ZwInkYXdq9jnJWNisMNscM62Kv4skGpxMukLqgMOuo5P9kAEslC60E 81Qw== X-Gm-Message-State: AOJu0YywHUONz7Zp2D0ZEvj7Jz+W/SFiNmqegFN3DftDatzO4Ry8azGO bHpC9awkVmXBCmUfqh6q+K9chsQ3P7VMXntkFPnJWXgjQd9xF3qJ/Zi96Bj9VXvwdsIS2TnZzvO SktVQTEwoEjHjACjnSdsZ+wwuf8ip7fThhF69GKRRbF0miXaxa4ROp1L2xHTAONSOwCd/1A== X-Gm-Gg: ASbGncsoNJYIhN6970ugy8y8hvcfd9RpPbVmMd7zfDY2z4BUggfup7bKVIG368Np79a iuARxlZx+9GEd9JyEQ1mpy7YOkuWS7PK66D0JCO8Pzr0DNO40zfo4wYXODVDwkz+vUqqNU+kkUj nsjlx9r4Emme92A+yq+SzVKIeepRHyjYijpI4HTkbOvIFzJ92yGKOOdQz2SmQ2Yo64h3Z1LhUNj 31zLPdlCdio3I223S+PnnvBehKa8MJgS1WEK3rkh2DuWkiMoBkGTEaLCGAl38qjG9Bm3ePKlFr0 +D182htxmM7MT7CBcHsnXETUAE7DLvt5eI35ZKlYsHvexPRIhARNWHzYwgtR X-Received: by 2002:ad4:5f89:0:b0:704:7f0e:ca9d with SMTP id 6a1803df08f44-704a3885c2emr3440226d6.24.1752169416341; Thu, 10 Jul 2025 10:43:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSS2Rzm0JfKmIyrTldYCoa+GfaWxjePB16xygyyHje51M4cEE7holVyPZ8C5FzqtnGtvcUbQ== X-Received: by 2002:ad4:5f89:0:b0:704:7f0e:ca9d with SMTP id 6a1803df08f44-704a3885c2emr3439666d6.24.1752169415753; Thu, 10 Jul 2025 10:43:35 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-70497d71419sm10652876d6.86.2025.07.10.10.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:34 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:07 -0400 Subject: [PATCH 6/9] drm/stm/dw_mipi_dsi-stm: convert from round_rate() to determine_rate() MIME-Version: 1.0 Message-Id: <20250710-drm-clk-round-rate-v1-6-601b9ea384c3@redhat.com> References: <20250710-drm-clk-round-rate-v1-0-601b9ea384c3@redhat.com> In-Reply-To: <20250710-drm-clk-round-rate-v1-0-601b9ea384c3@redhat.com> To: Philipp Zabel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Linus Walleij , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Stephen Boyd Cc: dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, Brian Masney X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752169393; l=2405; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=zHcO3z3+e99osmKzMokPyvWC6/DSceppfY/05RlRXYo=; b=QXQyVz/ESQN/1lpuOY+kiAZj2ii+/13EpYKJAuvi9VgjSVMZZp3cWkyo089YF/6/d4LrccG+3 IcOoOTC43L3AvbwBhN/wVyDOB1m1IcbEamuqRU2PQsvtkEzD5/kz2nO X-Developer-Key: i=bmasney@redhat.com; a=ed25519; pk=x20f2BQYftANnik+wvlm4HqLqAlNs/npfVcbhHPOK2U= X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Q0IhsBvWy3r94F6-gs-q5hm_nkXZWAEuIV0VT9BpLa8_1752169416 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Signed-off-by: Brian Masney --- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 2c7bc064bc66c6a58903a207cbe8091a14231c2b..58eae6804cc82d174323744206be7046568b905c 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -274,8 +274,8 @@ static unsigned long dw_mipi_dsi_clk_recalc_rate(struct clk_hw *hw, return (unsigned long)pll_out_khz * 1000; } -static long dw_mipi_dsi_clk_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int dw_mipi_dsi_clk_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct dw_mipi_dsi_stm *dsi = clk_to_dw_mipi_dsi_stm(hw); unsigned int idf, ndiv, odf, pll_in_khz, pll_out_khz; @@ -283,14 +283,14 @@ static long dw_mipi_dsi_clk_round_rate(struct clk_hw *hw, unsigned long rate, DRM_DEBUG_DRIVER("\n"); - pll_in_khz = (unsigned int)(*parent_rate / 1000); + pll_in_khz = (unsigned int)(req->best_parent_rate / 1000); /* Compute best pll parameters */ idf = 0; ndiv = 0; odf = 0; - ret = dsi_pll_get_params(dsi, pll_in_khz, rate / 1000, + ret = dsi_pll_get_params(dsi, pll_in_khz, req->rate / 1000, &idf, &ndiv, &odf); if (ret) DRM_WARN("Warning dsi_pll_get_params(): bad params\n"); @@ -298,7 +298,9 @@ static long dw_mipi_dsi_clk_round_rate(struct clk_hw *hw, unsigned long rate, /* Get the adjusted pll out value */ pll_out_khz = dsi_pll_get_clkout_khz(pll_in_khz, idf, ndiv, odf); - return pll_out_khz * 1000; + req->rate = pll_out_khz * 1000; + + return 0; } static int dw_mipi_dsi_clk_set_rate(struct clk_hw *hw, unsigned long rate, @@ -351,7 +353,7 @@ static const struct clk_ops dw_mipi_dsi_stm_clk_ops = { .disable = dw_mipi_dsi_clk_disable, .is_enabled = dw_mipi_dsi_clk_is_enabled, .recalc_rate = dw_mipi_dsi_clk_recalc_rate, - .round_rate = dw_mipi_dsi_clk_round_rate, + .determine_rate = dw_mipi_dsi_clk_determine_rate, .set_rate = dw_mipi_dsi_clk_set_rate, }; -- 2.50.0