From nobody Sun Oct 5 03:35:56 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A892528C84A for ; Mon, 11 Aug 2025 10:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909813; cv=none; b=AqLrn2jb7QvB8CulScH+72rVGcqT3aFlV1pKfZsIVxN23f7awJnB+z5sq9mGfm/4KBcgb1pA22ArmhHN60b4Jq+UdUS9NJ6+X0728TkREGTJDLCR3WZFSG1QWUloqc4UKVtudK/bEnAU/PURxPeIeDTEn1tL9wiLSOyc0GRU7Vw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909813; c=relaxed/simple; bh=juKzshMtQ4DF/h+L6Akp+woYewfsK6BXt/oa5cMlZgg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tSOoM2aSLKJyOu6avcRrqPzQ/rr7wCAaWi/9KawpcwaqvWAr/JveIhBr0afDYwIrtealeK3kBjEY48hbjPc1CQhjRFrTierDVu7MenRxsKTnBPnnywhzWtNGKR6icpJc9svjsqsbQFgquyKjwJNL5igUG8Lvm7DM7aBeXeeJhTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jISHvdsY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jISHvdsY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909810; 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=JStqtZIS8blwztj2LAAjIqKUEnudWLKj0xcXYk/QJ50=; b=jISHvdsYD6jcN7/wvI7KnETLgeVyEt8rq00LMA7opD7JpD2RNXUei2xFUrah4/AXn3PIje 4Z0tMauhQi5rYOvvK/NJ4HFUmbijTJGASrzoMMYJtMnOy2xOJ7ZSVDfFdznWiJoB6PqGOs nDuX7zhdhWOU9VJoz+gIpKRtfCnCIRw= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-yVjwwjbEPI247FfWIOfuAg-1; Mon, 11 Aug 2025 06:56:49 -0400 X-MC-Unique: yVjwwjbEPI247FfWIOfuAg-1 X-Mimecast-MFC-AGG-ID: yVjwwjbEPI247FfWIOfuAg_1754909809 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7e665a0cddcso990524985a.0 for ; Mon, 11 Aug 2025 03:56:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909808; x=1755514608; 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=JStqtZIS8blwztj2LAAjIqKUEnudWLKj0xcXYk/QJ50=; b=iuhFBSkqGPyWJwTBao9oLCx7sS724Vunjwdj2495SGTay+lJi0wh/8rZDsjBeOMXj/ 0qoRy03/DXdqhU09G4QhmETsyT9yZtr1psAvGnJHt6H4j/pci/KuO54eNYQqApg80SAq vWFT8DbzztqXk9dq2xQYpSraIEjCUJP/VmmWZXM8+neEYUyQSqiGCm62vfl6XzZpmCSa rbH1kRgBmnMZj9/fedjHyVRZBMGAUy9e8sZp2Widx43FbNdDP06Cug5JoXP6Uo0+bi2/ oxVg80Cfx1A2UqDaBWll6Uz6Ujv1SfK6LNf+QnqVx076lIUrfelETthiUzzUrIsf8Ze6 weuA== X-Forwarded-Encrypted: i=1; AJvYcCUTWASGeJ9xzbM+cyiB0R+L0ZF7zsO9JiAWoyWrnyo6bXH6Hqc6yGnzi2HUtu8vUKOeXSivkC0/4CwPlec=@vger.kernel.org X-Gm-Message-State: AOJu0Yxq2qoGrMAtOEuD2Raag/zwKEsnmZkzWA5Ej3Ei0t0EkahiwVKo GXSLlRN2w/GW2mS52GLIfTUdNQ+1+G+T9wD+VKknhy2I0zpdexoUJCiJ3QrFjsQaGCjEjVV1A+1 sGULsTjWbDEDUPQEiw7gXDUeoAKXAIHyNO/JlTW24dw+jTg8xo5+KXUQ2apR3DtlvcQ== X-Gm-Gg: ASbGncvPnhw2eImESZ1D/U2mcv9oUZx/QxQTNpTfCpa83o6VfuuWIgJOA910xahIT9X HZsIeL6ZDed3Zfff+sdRgVLi6Jtn342O10N3oZPMU5li/C2VyZXf9yUh6o+jxfUp6d74BHnsNVL du7wC1Hy+hSfkrCrQ7AkbZ8kycdS40hAFSq5RvPbXUFrsr5Z0wi3A+kyWjI65CGAY5cJr/orlmT TiTvJoidHxYYP1gg4+i2cuZaJOsn6Ms666Nmv71/Xz1fU970vbOk4gCVC0JrK6Vt9uXZvvYUAEV HqYTJmVPA3dDraaEJSkDKiImgBQZge470s6a3hIvTTMeohtNaExZo7OFVL/HKJUkM+UtnOKjgNe O9Ak= X-Received: by 2002:a05:620a:a00e:b0:7e3:60cf:c037 with SMTP id af79cd13be357-7e82c75b89cmr1125685785a.34.1754909808546; Mon, 11 Aug 2025 03:56:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhnLELhezGJADLmdApayEoevKdtEKOKSDSvgPhqkzq4hJSUIbUnZL0k2iE8nto9nf3DAncrQ== X-Received: by 2002:a05:620a:a00e:b0:7e3:60cf:c037 with SMTP id af79cd13be357-7e82c75b89cmr1125683685a.34.1754909808062; Mon, 11 Aug 2025 03:56:48 -0700 (PDT) Received: from [192.168.1.15] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e698de2df7sm1273446485a.80.2025.08.11.03.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:47 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:11 -0400 Subject: [PATCH v2 7/9] drm/stm/lvds: convert from round_rate() to determine_rate() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250811-drm-clk-round-rate-v2-7-4a91ccf239cf@redhat.com> References: <20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com> In-Reply-To: <20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@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: linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, imx@lists.linux.dev, 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=1754909781; l=2162; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=juKzshMtQ4DF/h+L6Akp+woYewfsK6BXt/oa5cMlZgg=; b=srQL2Syf3qoqHVxtrhYtzT2hxKDJiG2H0/4WtgjDA8OLuly+icCFFE04ANS8bywbgRo5Semzj RZvKazBg3coDcnWyiIki4FOxz5OPAdab1K8jRW40iEHpLbopisMgRC3 X-Developer-Key: i=bmasney@redhat.com; a=ed25519; pk=x20f2BQYftANnik+wvlm4HqLqAlNs/npfVcbhHPOK2U= 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. Acked-by: Raphael Gallais-Pou Signed-off-by: Brian Masney Acked-by: Yannick Fertre --- drivers/gpu/drm/stm/lvds.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/stm/lvds.c b/drivers/gpu/drm/stm/lvds.c index 07788e8d3d8302a3951e97d64736b721033998d3..fe38c0984b2b552e1ccaef4d1e5= 89b9d86a40ee3 100644 --- a/drivers/gpu/drm/stm/lvds.c +++ b/drivers/gpu/drm/stm/lvds.c @@ -682,8 +682,8 @@ static unsigned long lvds_pixel_clk_recalc_rate(struct = clk_hw *hw, return (unsigned long)lvds->pixel_clock_rate; } =20 -static long lvds_pixel_clk_round_rate(struct clk_hw *hw, unsigned long rat= e, - unsigned long *parent_rate) +static int lvds_pixel_clk_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct stm_lvds *lvds =3D container_of(hw, struct stm_lvds, lvds_ck_px); unsigned int pll_in_khz, bdiv =3D 0, mdiv =3D 0, ndiv =3D 0; @@ -703,7 +703,7 @@ static long lvds_pixel_clk_round_rate(struct clk_hw *hw= , unsigned long rate, mode =3D list_first_entry(&connector->modes, struct drm_display_mode, head); =20 - pll_in_khz =3D (unsigned int)(*parent_rate / 1000); + pll_in_khz =3D (unsigned int)(req->best_parent_rate / 1000); =20 if (lvds_is_dual_link(lvds->link_type)) multiplier =3D 2; @@ -719,14 +719,16 @@ static long lvds_pixel_clk_round_rate(struct clk_hw *= hw, unsigned long rate, lvds->pixel_clock_rate =3D (unsigned long)pll_get_clkout_khz(pll_in_khz, = bdiv, mdiv, ndiv) * 1000 * multiplier / 7; =20 - return lvds->pixel_clock_rate; + req->rate =3D lvds->pixel_clock_rate; + + return 0; } =20 static const struct clk_ops lvds_pixel_clk_ops =3D { .enable =3D lvds_pixel_clk_enable, .disable =3D lvds_pixel_clk_disable, .recalc_rate =3D lvds_pixel_clk_recalc_rate, - .round_rate =3D lvds_pixel_clk_round_rate, + .determine_rate =3D lvds_pixel_clk_determine_rate, }; =20 static const struct clk_init_data clk_data =3D { --=20 2.50.1