From nobody Tue Oct 7 09:55:06 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 AC12C2F0C76 for ; Thu, 10 Jul 2025 17:43:23 +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=1752169405; cv=none; b=FACsvSXLz78y9ihBhVzxQXhSUxdiVZH1KAtHxYRZm+zS5iAyM9plQ4s5thVI6TMs3BsRa5sFuk8+72DJ6a+IJlerdsyLMeYjk8tZFKU+mtK+mn5cnSVKNuWi+sqkthi4D1D2IApStU+qP7ktVhV+8YMUoZA3TYFPkf//hHxSiDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169405; c=relaxed/simple; bh=JMQuzI07hiKrV1ATnFggAmht1J6rMxSCqpxpi2ExgQM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mrj5eHpU4RsMizeyMfWwba/BP0x/LkeKhtIoAkTl2hWtpJSYvReu30rPaJaqPQ2x8IvaRcb2iB0mp50+ezwBaBAf4sQ8pHS+D6M2F6hC9u55meneM+AheFqRV9Blc17cIRd/hwl0HmgEYHvs1P+aqU55vK0cvnaqAk7tramkKTE= 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=B+6OjqfQ; 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="B+6OjqfQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169402; 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=uSQAcfejxg7NhusLP2Sc0sAULtF+i3/IlJefnecYrRg=; b=B+6OjqfQc7p8lwXolVXwYI/sb1mmSew49ZKRY/KEFppN5CIQOX2tXqR15/HBHj8Iyhiy/w zPjmigVnLuQuNw8K+YqgZwb4FkLf9h76UTuRQVA41ahpiwjgsdo6BcLdBctGGtqYANHUlm R6LGc/pNG5eddjJzwH+hFdoOer6ePn8= 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-616-ian5DboBPhe7rL4j23T74g-1; Thu, 10 Jul 2025 13:43:21 -0400 X-MC-Unique: ian5DboBPhe7rL4j23T74g-1 X-Mimecast-MFC-AGG-ID: ian5DboBPhe7rL4j23T74g_1752169401 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7c5e2872e57so206680885a.0 for ; Thu, 10 Jul 2025 10:43:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169401; x=1752774201; 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=uSQAcfejxg7NhusLP2Sc0sAULtF+i3/IlJefnecYrRg=; b=fNjLq3ftdEwytxiETOP9Dl8PD3DRbuWSKWhsEP/9/r+lmTQWjpyD3fkQ3+KFAjpU7v wYEISL7jpw2ck3GSfPc0xDazegAvax6kvFjrNMxjHz9iLnq+JvbGsDlEinRDjS7fbDym na7ENE/FiYZMB/KRMlAouWkhOArq4BLdkJR/xr+bzbl3N7RfWUpMpdiMeMd6T11ogs2Z f1MUGODhLMAWFxIyy2XcXxh5qXJb8yAMzgKxRbOr+BmpWfjFwlyNhgQEYCh67vYnkao2 HdH4EN4iplNYkXjcB+By1CMbJtB7lebFiJWVAC+97TLxj9T5yDBqPlvdlgc6p7bKD/vs 0hlQ== X-Forwarded-Encrypted: i=1; AJvYcCVnvFScfwL0SVbjYPbfg3uzPBzW3xWlUYKvrSX/cryb03WhRPM7+1lrXYrNCH82yjCrXLGQtHnZoZj5wPw=@vger.kernel.org X-Gm-Message-State: AOJu0YzY1vq2uJ7faeqofstiLvpJPK+Kp2KzDM/hw88rrzZwnkgOIcaj nGqK9lg5+hpHy0q3SUXgjFsV3eV80QLSMlFymzTzi3FRo1QaUCr+WTZgr7Z1KmFx8+dtF5vvlT0 ihn8V4zdSs2YtaHZNOpdBT6c/VtjEK/JdizO32C9heh4e6/WcYwZhypu7Tm6yAXiJnQ== X-Gm-Gg: ASbGncvSvWFDOEP74c61DU95ZszFpRLQQIE9dvk0eNBJpqCycUHz4ilwCQEVLf326Ce bdNo1NUsIVbygGCo0v2HSQoaTq0LhH/uvoYEijPzz60zH3h6NeUERlgpoBsx0XQ6wK87IpF7aJt 0Z+H55TmnMI8I1shuaOb35Kh6iEA4zIzr387eO5EZvhTSkPUGI1uJ0IPl9AN4kUjp5OQNgHAxU5 6F59wlXv1Dq4uGKx6tDx1kvuOtBmHDwvFbywh8/XkAZKCUii3rGtFR5jf6S5KDL4BlDVgl0jgG1 wutwAjj11LrCmP8ZSVQeHcCTXGTj2rLpNN6nbqgB+Qv+o7LcYwPwBvUiQdky X-Received: by 2002:ad4:576f:0:b0:702:ca9e:dba6 with SMTP id 6a1803df08f44-704a40f3f86mr2464686d6.16.1752169400846; Thu, 10 Jul 2025 10:43:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGneFeZHD+R2IlA/RJ8povEc4F9IjcKH8Fgp0p4dCYgtfr/rKSizrHDLTlvLp9E8FfSRTeZdQ== X-Received: by 2002:ad4:576f:0:b0:702:ca9e:dba6 with SMTP id 6a1803df08f44-704a40f3f86mr2464046d6.16.1752169400264; Thu, 10 Jul 2025 10:43:20 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:19 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:02 -0400 Subject: [PATCH 1/9] drm/imx/ipuv3/imx-tve: 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: <20250710-drm-clk-round-rate-v1-1-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=1689; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=JMQuzI07hiKrV1ATnFggAmht1J6rMxSCqpxpi2ExgQM=; b=2cWi9RxWr4DG/uT+Adfe1rLsJLWqf/HsK4V1CHvsD1HqS0tzYLionTpIhnP/uRurPd7gfFmll 2lm+LwJba1xA78TVoaKVn+hJWZX7dEn9fhckaPz4uGeZs+gsOpWRugK 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. Signed-off-by: Brian Masney --- drivers/gpu/drm/imx/ipuv3/imx-tve.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/imx-tve.c b/drivers/gpu/drm/imx/ipuv= 3/imx-tve.c index c5629e155d25aef5b43445bc18c6c90039c99974..63f23b821b0be66a8e8a379e137= 5ffd98552e72f 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-tve.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-tve.c @@ -368,17 +368,20 @@ static unsigned long clk_tve_di_recalc_rate(struct cl= k_hw *hw, return 0; } =20 -static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int clk_tve_di_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { unsigned long div; =20 - div =3D *prate / rate; + div =3D req->best_parent_rate / req->rate; if (div >=3D 4) - return *prate / 4; + req->rate =3D req->best_parent_rate / 4; else if (div >=3D 2) - return *prate / 2; - return *prate; + req->rate =3D req->best_parent_rate / 2; + else + req->rate =3D req->best_parent_rate; + + return 0; } =20 static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate, @@ -409,7 +412,7 @@ static int clk_tve_di_set_rate(struct clk_hw *hw, unsig= ned long rate, } =20 static const struct clk_ops clk_tve_di_ops =3D { - .round_rate =3D clk_tve_di_round_rate, + .determine_rate =3D clk_tve_di_determine_rate, .set_rate =3D clk_tve_di_set_rate, .recalc_rate =3D clk_tve_di_recalc_rate, }; --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 A1B6C2F1988 for ; Thu, 10 Jul 2025 17:43:26 +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=1752169408; cv=none; b=mny4qSu6tdMhKUYGGgyPVbX3+ahCNuxmpjKcD9RUejKLm0PyVTqi3amD1rg22gIUxDPKSe3A7Jdoq7LcqEjcFMahhuOFWTxUbnD9BB/QiMWmaDVj6VP+hiKQV/XNzn/SS1259Mug29NETaIBAZO8HsENz+fScVJgKvsOCZgP+hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169408; c=relaxed/simple; bh=kl2qeTWYwIcCK1THSOcO56NA9jbysmHw5mNgghcr0SU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sNcJPLQ+DL+xkgnoaBFY/0p+kpekojxhdLUy+wSeEqZMfLnOi3amJByyVBHiEc/P5qftyRDb5ANgEtR1v0uwDJBZddcClWbJVV5xJMEYbOx58VihnZ9hnvOmdrDxZH8V4lBBs88TJduSceo8T55XdZFSp4SDHteLdaTrS6X2ylM= 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=UKQObq0C; 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="UKQObq0C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169405; 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=ZPzxLLqVb+btp2J7RVCrJ2ENgQ7+4k/pXM6bF/LohTw=; b=UKQObq0C2HDGxQSGASh/VSqQ5FSWIIgK7bU+/Kt2t32vdJoRHB/JOj1v8nNTlMWIbhJWRI f3ExChTznVGtIlqlH2ZBHBKNPeS69h9psk1TFWuvNCOv/foJZt9NhbnHc5bPhRvnmYZjxp XGoxWDd7E3gj1PzutYpG2q1DZEhvs2s= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-oXo3vykxO7uayuY0lhqRxg-1; Thu, 10 Jul 2025 13:43:24 -0400 X-MC-Unique: oXo3vykxO7uayuY0lhqRxg-1 X-Mimecast-MFC-AGG-ID: oXo3vykxO7uayuY0lhqRxg_1752169404 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6faf265c3c5so19384746d6.2 for ; Thu, 10 Jul 2025 10:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169404; x=1752774204; 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=ZPzxLLqVb+btp2J7RVCrJ2ENgQ7+4k/pXM6bF/LohTw=; b=hxPcwLps3eRL+iDIAW3/t1p8Y/e673cfak+Oq2rFt32awNAZ60VwhrlWtAC5VkJ1P5 d0Pr5/hh2Rta++uPmlTNj8YU6Dgjn2EGWYPG4fiFVSQJzdbSItbB8ZDg7q9xsgr6uWpq g9t026Sm2gy5B7abzZiyoKeh0LB4moAJ7A3To9R/tsRUGSmUEx7OAH8lIKqnLOdvsv38 L3bDeUscqWWrwqyALv25RdUxUKcpjUaR7Rw5sz0uTMhKz2IrYTQItQdXz9wqOWmn4OkE N5XyEO/UtQdj/OhDunkfjSyNEL58BdWIDDftuLrWR7wP3SWC8kPiTKgPY7kiY7G6TxYR Znrg== X-Forwarded-Encrypted: i=1; AJvYcCX841nHJQ6lE76LBrtwDrGgCf3raCcIEHz1k75gyOCaKT+jj2NJy2jl876Jr5lRzJLTerGDDyU49fb69oU=@vger.kernel.org X-Gm-Message-State: AOJu0YyXYPrFwiMKkPQXrhutTPcbtFMwMG1KKCsakmZ1R6tGZScayS3p tGZTQhodC100svFAKJK6KuS1qTzWVdwGfoO+UjqB48vNfSzVTdMFBaXhTTTctRlDoCV9DBd1Yl4 LLFqjeSxgqM8flV3Oarl4xMp0Tss7DDTmRjI41OGojcw5lBChBV1MXBion3Jt3FYLew== X-Gm-Gg: ASbGncsZ59TTD1Q47OADTiGpcwF2MGpmHryvzfUDwg0xQz7KVEWPkYtJcaIQwW4p93B +wOx2iQ/3Mj2F4xpsUot2D69i8UDJIiR1c4tfWtFZ1F76P/UIHQztbv8cbkpTGUQ/1x7q44xRka ScXY+k1MLS5b0JZOdJdKlCa0wKnuJzCFLeE3u5z2mmJ6xVn8yvVV0N+gXtxvWuoUZTSCbhqJus6 RQ7Wt5irPl68cunKfZeO15tdWadwAQYIIX2uebUH/Ja0VyPAKXe6AniqRrmir+FY50uSK4uPGQU RFrV8pDoLeuboFXVZ2FCT3dY8kGHxpPrOq1nvipU8CHfcf5cvZa1g/ziscJW X-Received: by 2002:a05:6214:4521:b0:6fb:66cb:5112 with SMTP id 6a1803df08f44-704a3b03a02mr2644786d6.43.1752169403796; Thu, 10 Jul 2025 10:43:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFibFyJAqH2Tkc8cSfyuj43nonhKwPGrbHTb1n3BZYj/b4JFbj4juY9nmJvfEsNrJfVGljjaQ== X-Received: by 2002:a05:6214:4521:b0:6fb:66cb:5112 with SMTP id 6a1803df08f44-704a3b03a02mr2644146d6.43.1752169403246; Thu, 10 Jul 2025 10:43:23 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:22 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:03 -0400 Subject: [PATCH 2/9] drm/mcde/mcde_clk_div: 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: <20250710-drm-clk-round-rate-v1-2-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=1675; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=kl2qeTWYwIcCK1THSOcO56NA9jbysmHw5mNgghcr0SU=; b=dJ/qA0hGF/+fQfe0crsCUgeeRXp3uEEF5tBBbhlI5F6XFBRbvTidAvVYatP+DdWjLDW+J4Np0 hf2I1m8Rc9fCuxnysHNHHy4FFC3Lx0PLz51pJGMCy+rQ/pwYO2VWCbI 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. Signed-off-by: Brian Masney Reviewed-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_clk_div.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_clk_div.c b/drivers/gpu/drm/mcde/mcd= e_clk_div.c index 3056ac566473487817b40f8b9b3146dbba2ae81c..8c5af2677357fcd6587279d5807= 7d38ff836f0c0 100644 --- a/drivers/gpu/drm/mcde/mcde_clk_div.c +++ b/drivers/gpu/drm/mcde/mcde_clk_div.c @@ -71,12 +71,15 @@ static int mcde_clk_div_choose_div(struct clk_hw *hw, u= nsigned long rate, return best_div; } =20 -static long mcde_clk_div_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int mcde_clk_div_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - int div =3D mcde_clk_div_choose_div(hw, rate, prate, true); + int div =3D mcde_clk_div_choose_div(hw, req->rate, + &req->best_parent_rate, true); =20 - return DIV_ROUND_UP_ULL(*prate, div); + req->rate =3D DIV_ROUND_UP_ULL(req->best_parent_rate, div); + + return 0; } =20 static unsigned long mcde_clk_div_recalc_rate(struct clk_hw *hw, @@ -132,7 +135,7 @@ static int mcde_clk_div_set_rate(struct clk_hw *hw, uns= igned long rate, static const struct clk_ops mcde_clk_div_ops =3D { .enable =3D mcde_clk_div_enable, .recalc_rate =3D mcde_clk_div_recalc_rate, - .round_rate =3D mcde_clk_div_round_rate, + .determine_rate =3D mcde_clk_div_determine_rate, .set_rate =3D mcde_clk_div_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 286F02F19B6 for ; Thu, 10 Jul 2025 17:43:29 +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=1752169411; cv=none; b=O+Wp9g+8D6kt9AC4LO8zXJoq0T3Wdc+ANTYaWO9phsPuzeG5e3uQASe0BnaBnhEeVNknZpoXT6TQQ4I4Yf5ycIjHxEt1ZFiBmShSGsvKh3KVJ3gsaXi3v+ok8ADPwda2gaOkY6vmBV8Qq+hGvx4lUWbw7krBKIZ00GpO2IE9YRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169411; c=relaxed/simple; bh=0XNjSSy+sJ0lfEyL4cE3BgJoCrdQCRO7x73pTQQcP6I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SnhxgH+ARw9QgibXecvk4pMS3iUwzaVCfpWCdQo0FiHInuHlLON6NX/rmWq/g9OiGG4ft2wMCg/piGuVWC9Ki1urdvU7mzYC7MWC1QjzMeO187zCsQLoPvPkWuPI4bGZtD/KfOm3M1UK40uRPbQKc7DQeptVWSTNikNzrA5SSRE= 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=Z6C6+DUg; 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="Z6C6+DUg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169408; 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=KBPGyYPlG02EWMpLoXBzNUmSiSLVytWyHaO2lqHRcZA=; b=Z6C6+DUg4w1ugVrWNW9WD7XPladdxlXW0J91egWhoYSpM9Q4ezFhvOUX6fcnXk00TKHtDd 6as/n6Q2VPb8Qk+eMAqJnuc+p1QNa1nZfytaHXEqQBCQ2SfOY00LSvzY0hFPAldqbNWGzC URwibWZiy3br+cSDhFQbudAzUvI23pQ= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-dO4LhUwwMW2lEF_msPgoyg-1; Thu, 10 Jul 2025 13:43:27 -0400 X-MC-Unique: dO4LhUwwMW2lEF_msPgoyg-1 X-Mimecast-MFC-AGG-ID: dO4LhUwwMW2lEF_msPgoyg_1752169407 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6fb3466271fso23954006d6.0 for ; Thu, 10 Jul 2025 10:43:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169407; x=1752774207; 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=KBPGyYPlG02EWMpLoXBzNUmSiSLVytWyHaO2lqHRcZA=; b=wOSJi7UyQ8vApV4PpvJ14ymbWJ5o2Bvd8FFDfH6YGG5hrkAgu5ZhDJetrV2yp0fxLj 3KpfQ+zoGTmsOpByD0iXYsXVXi5oju7/bVcAHTEw2ZUTaw9pfL7nsSI1a7PGTjw06jBs rU6uqDFup+4Iik3sOjhOH7mo/QxnHqIjWP2hlOEwUE41Wbgj0CZtVjFAWimC7BgdQ2KV kXODKcS2GSmbzJyrMu7WtB4834wa8xVH8dLCWlFCIYi92yg8foxJsNUpeUxCYpcaZGh3 CYtQ8Ux2lCDH2v7LtUaQRJXmdliavNReV5SpVov1HZmB/MoksLLgo09FXgfL6bnSuW5P kHBA== X-Forwarded-Encrypted: i=1; AJvYcCUs2zugZ+oBlpLbJUAu7+kPZLCeomka+fXu0x/RmlLD1D3Vme5J/+AFF4de0fVjFSDCSYLUz7ANdmos3B4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7SwiM0T0lebkv4XKslG0EmwjTlNkzNYGhzKDHYpren2YzZZNv YpTLPEIbxq8sp1lXolI00TdGmSKNVIm2BlwFazRFvtCRUwMdghvgGEDUfxAgPXhbCDowfsFv+1A zeJsI0Xzb65YcsaiIJ8NwlS/y+5Ygyiv1oVI4V+HGElM5MWFHTs7XkKDSQIj6lMbx9w== X-Gm-Gg: ASbGncteVs+T/M78yDQrVSMMSfiD/lWk/2iqqZ69eKTLWlQFPEbEbbLvRQN7+y22aj3 xzxNmatKHr5bTans5YHaW282vwucmMgiDm6J+YPuDvgp+rKmxQKVbMqP143k5nUE035PGynaBEu jXXLZSVjWUgw4klPabv2zVAFMTV4tYGPL4fb0DS3yPFwnQ5uWTU+buZxWccBw74qhyomnERgGLS JqQwEdxPICOV2OuQZEsDEAngfL7JGjhh6IzUrN1VhwHNXllmKfa1jPUj4xIgWxvvVNaE5Eo7kq0 4YYPacm7+vsKfjDEQMzRo+EF50wW/NlcXZSRdtmgRnYgVhXKK6NoNk41JCLT X-Received: by 2002:a05:6214:3f85:b0:6fa:c22c:f78e with SMTP id 6a1803df08f44-704a3f6fd62mr2496106d6.14.1752169406632; Thu, 10 Jul 2025 10:43:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEttkcpvpmW8n4QYixl0+KFt8qbGPFK3Af/cnV1daIlslvCn8CNttD2d7VeOQXKfYZa2Tsq5w== X-Received: by 2002:a05:6214:3f85:b0:6fa:c22c:f78e with SMTP id 6a1803df08f44-704a3f6fd62mr2495446d6.14.1752169406197; Thu, 10 Jul 2025 10:43:26 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:25 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:04 -0400 Subject: [PATCH 3/9] drm/msm/disp/mdp4/mdp4_lvds_pll: 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: <20250710-drm-clk-round-rate-v1-3-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=1612; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=0XNjSSy+sJ0lfEyL4cE3BgJoCrdQCRO7x73pTQQcP6I=; b=96LRUEONivujwIpqQbr8tblgDkupptPSSepp1EfUIk95IM619emUTpzW+J+hude/MQ3kCg+HA 3yXQuBUEDwkAc7M+xiKSzQ6eV9m9VE+WhiAmImR5xyYrk63QkNrzyzs 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. Signed-off-by: Brian Masney Acked-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_pll.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_pll.c b/drivers/gpu/dr= m/msm/disp/mdp4/mdp4_lvds_pll.c index fa2c294705105f5facbf7087a9d646f710c4a7fe..82e6225c8d491d44e30631cd5a4= 42fb7c2de3f75 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_pll.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_pll.c @@ -98,11 +98,14 @@ static unsigned long mpd4_lvds_pll_recalc_rate(struct c= lk_hw *hw, return lvds_pll->pixclk; } =20 -static long mpd4_lvds_pll_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int mpd4_lvds_pll_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - const struct pll_rate *pll_rate =3D find_rate(rate); - return pll_rate->rate; + const struct pll_rate *pll_rate =3D find_rate(req->rate); + + req->rate =3D pll_rate->rate; + + return 0; } =20 static int mpd4_lvds_pll_set_rate(struct clk_hw *hw, unsigned long rate, @@ -118,7 +121,7 @@ static const struct clk_ops mpd4_lvds_pll_ops =3D { .enable =3D mpd4_lvds_pll_enable, .disable =3D mpd4_lvds_pll_disable, .recalc_rate =3D mpd4_lvds_pll_recalc_rate, - .round_rate =3D mpd4_lvds_pll_round_rate, + .determine_rate =3D mpd4_lvds_pll_determine_rate, .set_rate =3D mpd4_lvds_pll_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 906992F1FD7 for ; Thu, 10 Jul 2025 17:43:32 +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=1752169414; cv=none; b=AVPbwHq/RlSIu4I9ma/zsU3nTdoktAHHsvWqOt7X/wUjrpTwwdrS1HvkCnzZE4QCQsDZP3FqN8WTadT1Jymvv3BYuoQWf5rHXQ6HCbyCsK9CmOx3w0BXuE8CX4Ul7Un6tdcovE2e+UlDNbCx/aJJBy90JNSgxPG0TlsPgVcc3hQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169414; c=relaxed/simple; bh=MIrYQUA+EZpetvGrGMmQ8oMPGqbTBnNzDewrKD2iOsk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uBTaHSfeIhV0wxxRIIRTG91j5ePGQhxGGvpWOMIQ0vZpPLB08QAD++HMcx3rUJ1vo+HsE2n4voBG6J0wj7LSTVI49zI138FFD2vaeKsmjgwvkJBePBfo5SHgDZ5taMhQgLAjhyBo8XHMo7o8mRiYFdg3kgNTDyHkGODGVXofh28= 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=THsnD/UA; 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="THsnD/UA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169411; 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=ppN1Zg1KkN3TDh8kOcLfldTesCc7Q4yAOrM4kF9OYZg=; b=THsnD/UA0hn3cdsOaaayeVsUI/I7PyBZoNLeexfE7Ix1/Ezhzc2P7lFc2zjkmxESmSf6tu AsYRJ30KYZKxYjzg/AcTYqrt/nvtIup50+S2gdA6i68A9hw6YAZSwK6BWEdMax69xuNkB8 bTkykjp5jRN+RTZdyTAWSyQeZ2XzY68= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-6-XuMkVhTAMGm2MBq3A1Ti6w-1; Thu, 10 Jul 2025 13:43:30 -0400 X-MC-Unique: XuMkVhTAMGm2MBq3A1Ti6w-1 X-Mimecast-MFC-AGG-ID: XuMkVhTAMGm2MBq3A1Ti6w_1752169410 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7c790dc38b4so238874685a.0 for ; Thu, 10 Jul 2025 10:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169410; x=1752774210; 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=ppN1Zg1KkN3TDh8kOcLfldTesCc7Q4yAOrM4kF9OYZg=; b=BhF1I10CjuWoDcjnoe2sbvHkbBtNKPbUpO78o0M4AQbudRAqf2o1nAPf0PHN/m5AlQ 94c2Ckx08KLfjdVQk3XTV10CBVjexAds4zgYT+52K4osHQO++MG2TpsZAhBJjUw6E2Io hEJrtHUn678dodO1ciMA2sGZYVjZLL0cEsRw+EVvQLUJcukTWhot9YCtrudsCMDKHDb/ Z+k440YXlZVOjv11N/ZRPBSl2c1hwFHWBuAOPoTRjpMvs5cDhuyz80YumwsX52i4dDRp RcU7jyJOwtLivWvxlpkQB+bW6PF3Kb6LebUAy2dTITwPoBMxtdTRutYJTDaOfBEE+84K zcxg== X-Forwarded-Encrypted: i=1; AJvYcCUsnE4mrBahZEW/iJy6wIudHmZg+N/ofeQcAAIzTE1u2qi5E4tnQlkITaDlG4Au8DnoVG01vFatc/jN07s=@vger.kernel.org X-Gm-Message-State: AOJu0YxeWSL199jQS3r3Rlpw06U5k0jvBO+kIuP9HLcHuhMFhc16HR98 WzHGKQYcFNit7e3JKamvjJSzJ3F8zuntchXs2Ci5sVgGwcpjuLF41Rt71QdDdUaAWi2wC4KNPsZ EYQYU9dPTLRRAlEu6v5iBiaVSLup30+mo4wotrSQWheRWTIyrNsiPq251g4eAkXfZDQ== X-Gm-Gg: ASbGncsoWSKxA+8oJrPpJd1UWn2x9WwI26OcrPBlyUQ06eAB8fPHCMmw6bk9voc3pIK HuYskGe4d08D+rvaCvzGsCRhvoDkdAqK5N2Zkz4yuLIFxf6r7rE74sc/bJmAgM8ErHOe/Qnkl06 /obMY0fZxDSWPom5RF6yrvKmVlnSVvjyyHB4PoYKpFlp/53qs+ohjzuABMGN1ONUDQ6wwJ1ckUo cK1A/NaKYNPE1R1TWwIQjlCQDgDZkV9joE7PBoaP40AcJ0jnOgRSijpp2f4T9fvO0a1IidA3lWI y9Imy/TkQK25rWfk9p+6RFn7cK2aOYDd7GlnflhwEeGJzgzvqJWWirT1N/32 X-Received: by 2002:a05:620a:269a:b0:7d3:ed4d:812e with SMTP id af79cd13be357-7dc97da02f2mr646711485a.9.1752169409732; Thu, 10 Jul 2025 10:43:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtGRA59X5211+zA6+bTuLexmbhranU9s00ouhgxHCHsr1K/Q7uZzJEn/YRVuxvQ5eKEuxqlg== X-Received: by 2002:a05:620a:269a:b0:7d3:ed4d:812e with SMTP id af79cd13be357-7dc97da02f2mr646704785a.9.1752169409169; Thu, 10 Jul 2025 10:43:29 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:28 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:05 -0400 Subject: [PATCH 4/9] drm/msm/hdmi_pll_8960: 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: <20250710-drm-clk-round-rate-v1-4-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=1532; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=MIrYQUA+EZpetvGrGMmQ8oMPGqbTBnNzDewrKD2iOsk=; b=xNXPieWXOwE6YijWTJ3taaQPCPf8/+I1K7+s2EiMedGqecECqqLSQTFSwjhrnG/onGaKSV32p isG7Au5aNEyCqmbZJtcC9vC7jvxXBrzxoAluzBC1poKDa0ziZwvE41x 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. Signed-off-by: Brian Masney Acked-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c b/drivers/gpu/drm/msm= /hdmi/hdmi_pll_8960.c index 83c8781fcc3f6e1db99cfec64055ee5f359e49e5..6ba6bbdb7e05304f0a4be269384= b7b9a5d6c668a 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c @@ -373,12 +373,14 @@ static unsigned long hdmi_pll_recalc_rate(struct clk_= hw *hw, return pll->pixclk; } =20 -static long hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int hdmi_pll_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - const struct pll_rate *pll_rate =3D find_rate(rate); + const struct pll_rate *pll_rate =3D find_rate(req->rate); + + req->rate =3D pll_rate->rate; =20 - return pll_rate->rate; + return 0; } =20 static int hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, @@ -402,7 +404,7 @@ static const struct clk_ops hdmi_pll_ops =3D { .enable =3D hdmi_pll_enable, .disable =3D hdmi_pll_disable, .recalc_rate =3D hdmi_pll_recalc_rate, - .round_rate =3D hdmi_pll_round_rate, + .determine_rate =3D hdmi_pll_determine_rate, .set_rate =3D hdmi_pll_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 4848A2F1FF3 for ; Thu, 10 Jul 2025 17:43:35 +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=1752169416; cv=none; b=fjIPS0Lz6ZAx3qSFxqui1vx3Ls9xloCVg6fW/zGk/qhgDp+VitNUOTq6XGYYw8uK+NM3DKdnLr/2xLDvfUZe9gxL3VK1BzaXpAYRO8rw0RSxrSURKZIuKZpamKODp4Ki/V7zU8KuBOx9d/3cf6TirigqbUbY8p+Ra1XbRpdj5WI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169416; c=relaxed/simple; bh=Uzde4F/sfQBVHQNcjDIBT9HB34JjyGuqbe7jNdblqLw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lew+EeYuciQsa0xtXAGCiF/dwcTeMmHXNqz6p4xeZTyptDjA6gZKtxfq5umwczYuPdOu+Kc3pYOANxYHu4xbNORCyvbef8u4RRKxk1/gHqMl5c73glNAFkzSIbRmYD1lT5O0PrFHjM7G3jp9HGegchQraXdz/tUn7kxkaEQJTuM= 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=MxdvLNWC; 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="MxdvLNWC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169414; 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=e37lSQKt1hx5PQsR5CacpUsq2th6rpfG9r3kIy+fF3Y=; b=MxdvLNWCCDxudfCHkneSAo0mkKlPVrzsXXgsZ7dc3gVJHi/N8MqzjIePA3bX1/WYpwBnUN OiibdNOZVJ5w5CTGEi08iRLSh6TSqhpydJSmxHQs/+0MINT0TEH5XIumSqa9EcpdPx+ADL 1yY60XJYmskihHQYAYTM9NCZkGpBfMs= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-3eFR2dNyMfm_JFvgbNxnjg-1; Thu, 10 Jul 2025 13:43:33 -0400 X-MC-Unique: 3eFR2dNyMfm_JFvgbNxnjg-1 X-Mimecast-MFC-AGG-ID: 3eFR2dNyMfm_JFvgbNxnjg_1752169413 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6fab979413fso20156976d6.2 for ; Thu, 10 Jul 2025 10:43:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169413; x=1752774213; 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=e37lSQKt1hx5PQsR5CacpUsq2th6rpfG9r3kIy+fF3Y=; b=Chw4s3fONn7H54aXgBLfYgTMRb+Cx8/T2qtcd8t6Uz4YQTfp/MDWKh2xR4+Gu+n/ZU T1nvbx+h2vEdrXU/2GRcXIhOCOfGjuy4G4tTzQzBdQIXgkes1G6Q4QEp9tZQT9zOT5za JGfBhtZmVHX/DhAUciiyFodogMBgv4V+aXzC+va4ibg6SCWK0b6Eb6OqScwbyVd4D4MH ymCptVOtrG7dNB8RieApn69MdUpeMZ6ghMVqkArO/UcAm+qaNs3g15YQrCSPdonTIDE6 AXIbZ72Zl7QuMRHcDZv1vzKZbPC+t0xlINjR/3L017655zbGVBeyD03WJHGedIJrJZO7 6NPQ== X-Forwarded-Encrypted: i=1; AJvYcCWhqWP6sfAbMKffzmdTEJgIHOLl1ztA9zL4VS/wbha4Ga/g3FQjs/eQ5YqNFt0mZdfGVSsH9NUIRGsqh3s=@vger.kernel.org X-Gm-Message-State: AOJu0YwJMo/+IKRfUwZEzb2m0JKyeQmX2PRtOQrbGoVN/dPoQAmzor5Z gJDjyxWeV8uKTrowXzbZ4702sRtNxi/rw+PghGt7ruYdMXWD7WFGpMeKhq23gH0ZYbRWSDpMfkA B8FP6SUxnGQww2kanf50WzDQmlpNso5u7JUVJ59dBQ+oIPk3bq/H9wQoG7l7ekdKwRw== X-Gm-Gg: ASbGncvftgk8sHy7ImY1/nZzsNjieShA7K//t7rftVb3pzqbqCh/nHXPqueN33z+Dp8 GJ+sCrhbJ5JbnHyuZzUuEarAzMpv0Rnthff6mmAtslmBwUio54LVXZZHLbNsheVOKVZgjq0aI+S nW5u0XSaup29lihSwBPYXymfJYMI04YqphQPRwylBzpDgMgLxdvL9XVmLM1b6HM5hVFhzSQDe8Q KSLi4FlC98m8KUWXVe5H5CyOwjg9WK80VSgAgahCXHZhM9hZ2oLi9Q5ec45xDXPxhsH3TiI4nHD 6emmQKFwjfaSXgRf0MOC3+w2BsASJ3TulwTL/6MxuLlqjd5C+AHUxBWSqkEq X-Received: by 2002:a05:6214:5d89:b0:701:775:70b8 with SMTP id 6a1803df08f44-704a3a4449cmr3581036d6.38.1752169412801; Thu, 10 Jul 2025 10:43:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpu8L3YGRW12uiQDpOxMNgeR30Y84ZsZlrx/wXIc8LbcnhH9LwZm0nYnuoy1dfBl7P78vOQw== X-Received: by 2002:a05:6214:5d89:b0:701:775:70b8 with SMTP id 6a1803df08f44-704a3a4449cmr3580236d6.38.1752169412340; Thu, 10 Jul 2025 10:43:32 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:31 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:06 -0400 Subject: [PATCH 5/9] drm/pl111: 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: <20250710-drm-clk-round-rate-v1-5-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=1663; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=Uzde4F/sfQBVHQNcjDIBT9HB34JjyGuqbe7jNdblqLw=; b=0pYUMWvjxgx4WfuoWRCVGEVL5ZYYPMN0neD5N8OcfZKIHag1vghAK3SLtnfFRHjfYafmDTVi+ fTHFTPespiOCXPSLsOLNifbUMGk0HbP0Ww4Oh/+lSRoq6wnUOICkRwy 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. Signed-off-by: Brian Masney Reviewed-by: Linus Walleij --- drivers/gpu/drm/pl111/pl111_display.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/= pl111_display.c index b9fe926a49e8bb42116ac382010829e333edbf8f..6d567e5c7c6fd559ba369a2761d= 3c402a14c6fe4 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -473,12 +473,15 @@ static int pl111_clk_div_choose_div(struct clk_hw *hw= , unsigned long rate, return best_div; } =20 -static long pl111_clk_div_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int pl111_clk_div_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - int div =3D pl111_clk_div_choose_div(hw, rate, prate, true); + int div =3D pl111_clk_div_choose_div(hw, req->rate, + &req->best_parent_rate, true); =20 - return DIV_ROUND_UP_ULL(*prate, div); + req->rate =3D DIV_ROUND_UP_ULL(req->best_parent_rate, div); + + return 0; } =20 static unsigned long pl111_clk_div_recalc_rate(struct clk_hw *hw, @@ -528,7 +531,7 @@ static int pl111_clk_div_set_rate(struct clk_hw *hw, un= signed long rate, =20 static const struct clk_ops pl111_clk_div_ops =3D { .recalc_rate =3D pl111_clk_div_recalc_rate, - .round_rate =3D pl111_clk_div_round_rate, + .determine_rate =3D pl111_clk_div_determine_rate, .set_rate =3D pl111_clk_div_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 7C3882F1FF6 for ; Thu, 10 Jul 2025 17:43:39 +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=1752169421; cv=none; b=fsbO3ZG+y9GCQ2FrKkqS9wLiC2HczDD7Nc9ver745RBpa9tsUkJDep+mduvBIbeRuaqNkB/X5cKrI1ZKTJfAbdojTzvkqlsuy32Xc2NMoP3E5N5Kpsg57oZJhCxJUlcaev0cfu1XlwgvlOHa9tT3q6oIz646a42+UXoaGlANm/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169421; c=relaxed/simple; bh=zHcO3z3+e99osmKzMokPyvWC6/DSceppfY/05RlRXYo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oi2xzKfTSqDRP+sOXs2+FxUzF4B1AwQyb86S30FFTDFox1hxDn0ZVRyneAMLK2r8q5PWjpXQN+hKcTiEKfIFVQLLYhKqxI+9ktyxy5tFgeqnyMQPDfGLD0GYUWeWwEIWyxG4W/G2u8ckaAP5olO2pBJLPtkiB0xboAzXKUkogTU= 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=gIxkbYzh; 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="gIxkbYzh" 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-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-318-r4_C8ZqONNmxWE-Lu3L7lQ-1; Thu, 10 Jul 2025 13:43:37 -0400 X-MC-Unique: r4_C8ZqONNmxWE-Lu3L7lQ-1 X-Mimecast-MFC-AGG-ID: r4_C8ZqONNmxWE-Lu3L7lQ_1752169416 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6fb3654112fso21627276d6.3 for ; Thu, 10 Jul 2025 10:43:37 -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=fBMS+sMygqJHnRD7u+MZhyvLy4aglYzSaNBsgn99p4GUMXxHFVViLk5JiGrtbLGEnR x/EMDSKpvuIhpZ6Apl7itpeLyRzHgTF0gznZ8+DLvNVV2f06jG3MFjJeNL1UCZftr1EX 9KZkOs5z/ukeO1LLljcgcNgj0et8MeiNHehZ+j/2fvG83hsjcCT1bPlfNS9d/tsEP+2A XD7UWq2uBVR1xy6JVW/t6vI91B5s6EBa6KP1Gi4X6cuvhcLTafsshh/38GrTWrrbSljm yWuxVvxhw7EvdlPalGgMwTX+xwDYgG4tjc4TFZ85Yiw3PTRFiWA5hVplSt7C9YkWato3 wviA== X-Forwarded-Encrypted: i=1; AJvYcCWmF3qzupfn8QQ2ZueqhzEGFZELxiyiRsGNFOZfvWUOVaLuGZh5DWRQe8jES0F2QRMSilQZUDn+ujKTXEw=@vger.kernel.org X-Gm-Message-State: AOJu0YwSpla+nts+tIx6QnOA1jlisBvYCb7ah58FS/ma0NItIBijhu9r W1I9Qot6OTSinzcSoqy8b3RBjJy1ShjgfZAkxHOWwYlCe48rEkqyqCk8Or37J1S6NLB+JGet/SG VoY1ydUBJF+X6JS9AzB/y8Enr1sby9u65AHMNXHXcNRrUqc1S8mfUNlKiGstfkoBwug== X-Gm-Gg: ASbGncupsBKXXB6b6s9r7O72HcoSLi3nwPmijITRjQgFupaBJatSlyzy7uj94YJLyjj 3SapCo960Nlnt6M8ueg9qHw2A27DN0ynp1mpMaA9o8vWY8ZwSHrJTb9PFaYikIeC2vudTAdSE4t ShI5A0UZsxwt/6idQR7j8r2nSc9Ph9xKBAfknY0q/2KlUBfX0QqPx6bt+xNJ3GxDGL1F1xI6/ry VcICZRbmwyly02YfHSBqDATHDuy1PyCivz0V1p5cJ9QDxkh6L/9KcZvlsSWdK++j0zB7I5fAJWK Hd8YY4GpcH1CCJNYBp00UYeISnPh5A78XS/2iD+i9ZNwdG9rGM8hhozkvqD0 X-Received: by 2002:ad4:5f89:0:b0:704:7f0e:ca9d with SMTP id 6a1803df08f44-704a3885c2emr3440236d6.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() 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: <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= 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 Acked-by: Raphael Gallais-Pou --- 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..58eae6804cc82d174323744206b= e7046568b905c 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; } =20 -static long dw_mipi_dsi_clk_round_rate(struct clk_hw *hw, unsigned long ra= te, - 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 =3D 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, =20 DRM_DEBUG_DRIVER("\n"); =20 - pll_in_khz =3D (unsigned int)(*parent_rate / 1000); + pll_in_khz =3D (unsigned int)(req->best_parent_rate / 1000); =20 /* Compute best pll parameters */ idf =3D 0; ndiv =3D 0; odf =3D 0; =20 - ret =3D dsi_pll_get_params(dsi, pll_in_khz, rate / 1000, + ret =3D 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 *h= w, unsigned long rate, /* Get the adjusted pll out value */ pll_out_khz =3D dsi_pll_get_clkout_khz(pll_in_khz, idf, ndiv, odf); =20 - return pll_out_khz * 1000; + req->rate =3D pll_out_khz * 1000; + + return 0; } =20 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 =3D= { .disable =3D dw_mipi_dsi_clk_disable, .is_enabled =3D dw_mipi_dsi_clk_is_enabled, .recalc_rate =3D dw_mipi_dsi_clk_recalc_rate, - .round_rate =3D dw_mipi_dsi_clk_round_rate, + .determine_rate =3D dw_mipi_dsi_clk_determine_rate, .set_rate =3D dw_mipi_dsi_clk_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 3A7F82F0E47 for ; Thu, 10 Jul 2025 17:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169423; cv=none; b=AikRrAPrjz3sHhKtGML4SO0cade0uKkPMB9ghOOJuo9iVtSLm+Fs9vK54cP8Gh/SRICYIZqEgPGflOO1KWTthakvcGQprClcg8nh5UG49ORSm6cfX1mUDt+jo2sEx2DplHIxG6BpJWWspMAwzvSZo3XeC6kdb/ruoyZ8NY+jTEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169423; c=relaxed/simple; bh=QsQxnV5P1fb5ziwiaykq6XlQnnjBowQ0Qm5g74Jm8ZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B5ePg5r1Sj8v8rA3ZAeiGv7f+mmoewyI2zdczLt8heDL8wfvl5/r+96TcFAuyQV0SUXd/sqpvceUuPpVKksDHHxs7ch1zkCbBQBGI6O1yxPT1xxZ90Bg3YMGO/I91PW2gemW6pu5/f/1T3yKO8yr+bF51/xPSdaVVxaW2lLOzLQ= 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=KrbD/Gu2; arc=none smtp.client-ip=170.10.129.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="KrbD/Gu2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169421; 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=YCUkHqw4OIJFHYNlmvSZg7Gb7N9mp6WEkDCfyaw9PXU=; b=KrbD/Gu2fvGtJgy2zR1l438LVyMU4wyCcF6aL7v3Np7P2LaWs1vVicnNvnJ5TfWS0punHj GT2pQ7poa1WZVXCL6aR9pK2zaLO6SPCo3fzk5uyitlTZQ+1pGJWl9FnyxNTWCLJvIdfMSr f8yW8SswwyqdIxmrM0tyw1VezZVUIwg= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-425-rgW3_YWwMJyYxgJcIoEOsg-1; Thu, 10 Jul 2025 13:43:40 -0400 X-MC-Unique: rgW3_YWwMJyYxgJcIoEOsg-1 X-Mimecast-MFC-AGG-ID: rgW3_YWwMJyYxgJcIoEOsg_1752169419 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6fafc9f3e1bso20590696d6.0 for ; Thu, 10 Jul 2025 10:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169419; x=1752774219; 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=YCUkHqw4OIJFHYNlmvSZg7Gb7N9mp6WEkDCfyaw9PXU=; b=LdO4KIDl0jlLcmpiTfKBJUUThgh/XHSHuaA3pUyHVVMvfGvocvNQCPtVjfXUYVc6aS 5JNsMS0cWhILDXjhk2LIieIV4RKzr7ppOFNWPBM1TVgjRuVg5uuXhCBtYEr9KhNE9Nbs mLkxNmjcHKArnosgRhd4pYf9ihjk9R3K6VTxIyFRTWDnsfFsl4U+YyeKxsNP8hvkPSj1 opMlY3Tz7tgKSYioJuJLJO6cb9OHT39Lwdr3rhlGd48heKiDHJaWKlD3aHKxTW1M64rR tPScuTHxMGPw9CM851rjPynXegypTgrK6/3t2nndb04T2J3DZjK0ShU9k37pKgo8wiEM J/cQ== X-Forwarded-Encrypted: i=1; AJvYcCWfYc7nCqplhfqL4RWOmf0Ft91FNailoV8uKvsTYkbr6vPuoXgGGcooYFJfhDhA5sq4bzlQYaPcukPrq+0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxex8ZuQSQng5jO9PR2kJE6UtG36hZQt3jfHmY3NeITQvZIs0OW 6nr0KsDhSY+rh4C0s0ekxccAA2/2sgFXZwfUgRARYFZJ2IB7w12AHUwn9odZwYHhG8g6LKnm2Zt QIU2R/B8xp8woZpizBbUEkbWLoQ96LqgnwRgGW5hbAPRv7jIlwZZNu1NTufUyXGD6Iw== X-Gm-Gg: ASbGncsjrpC7MM9TFF4TptcvEG3x2iE/jcX5oLBuhccGJgaDWQnBPd13uvmn754LyYC 10uimbUE7BdpGzXxkeUbN/ASUvD9SwaYUvxEQ9yffvjDtXVPP+RkYfh3Pcin9SBrvVW+1yJvBk7 hLmiV9MPZm/xX1l0rHHMnMGbLb2shBtENNEw5p5HPyHGPZmoJhHtbIzO7fEW/8McTZ6o90vh2du fCm9rnokJDMOgHACpNefJixVfJei2T/91T4QWKBYaFcQOnMboi4zkzyr+rjvOINjDVOTHn9ZHGb YiJyo09Jm07M2EJ7H+nCdMbFuyLPlcwrSX2ZCN33h6BK4c/Lyacp2byy6ubs X-Received: by 2002:a05:6214:5883:b0:6f2:c88a:50b2 with SMTP id 6a1803df08f44-704a354cf6bmr4070126d6.3.1752169419288; Thu, 10 Jul 2025 10:43:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHT9fVCmhXOEcnhqu3VFHhqJP8lRdJ7DzuHPSbjh7k32ODCAsPCUcL2Z7QyeRoPgckrF6a+A== X-Received: by 2002:a05:6214:5883:b0:6f2:c88a:50b2 with SMTP id 6a1803df08f44-704a354cf6bmr4069566d6.3.1752169418934; Thu, 10 Jul 2025 10:43:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:38 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:08 -0400 Subject: [PATCH 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: <20250710-drm-clk-round-rate-v1-7-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=2097; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=QsQxnV5P1fb5ziwiaykq6XlQnnjBowQ0Qm5g74Jm8ZQ=; b=Ksw8mIL+2RRN/KI5dE4mx3sGUsPAEzJtg6FBiWBslMJaF5i+drzv8/2cRkcR9a0IBfQcYS2SG tVJ/WPvWyYACv81xH4ZsEZ5zwtnc4MB29saRvfEdAfzM+LmC3xps5M8 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. Signed-off-by: Brian Masney Acked-by: Raphael Gallais-Pou --- 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.0 From nobody Tue Oct 7 09:55:06 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 BD3C42F2C5F for ; Thu, 10 Jul 2025 17:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169427; cv=none; b=fl6VgEXqYCWSM2vlHo3BWuvTcCm4SHVby/eSAoyGH7mcegeHQkPaMD4QQcFanQ0T1q/tzdDrXykmp1RYTF+BCSY+7Ruy5PfGpkMHsM7QhLA9ItEkkgmuMA+tLvsQ4aCgiySBO5qhKfm63RSf4wMXjTaNJhOLI03NleR+yR+iowg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169427; c=relaxed/simple; bh=OHsRnwsdtf93oenlkpM8OGpjPNCqkqTYz1ncE/Hukgk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qxbuigtcmmaCzaZd2QPYG3lWV3MQHQa6A1QD367StbmqxoONt+D+lrA0cOmZUXp7gpd5GVB8/9Fwa2hEELOlCGtEyWh9tGKy8624jTXhcqLrY5ViJC75sJtbuOzwE5gKUl+1ZrImfIDT2oqSOoeejWCqXeXBbyyZsyQkTqO8JVw= 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=FNh7qlXD; arc=none smtp.client-ip=170.10.129.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="FNh7qlXD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169424; 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=exSjMafszsHf+hPI+jA3EKbDPNjmXxeN/VchItvqKMU=; b=FNh7qlXD6m2QLcZ3QRT4K5kIxg92JTM+rUjeJk25DvzaNoB/evf4izVsHdYE8cqlmUJqOq yiRnOq67x67x4T2EwgevrqcJJHL56py6c0HPE9dmZBN21DAgRpOBHaW2qTO/4ta4i+gN4K dlNe6TpPpmEbjjMS2z/n9CJsbSfV2lU= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-ZojIPNpXMjCHJG9QaXousQ-1; Thu, 10 Jul 2025 13:43:43 -0400 X-MC-Unique: ZojIPNpXMjCHJG9QaXousQ-1 X-Mimecast-MFC-AGG-ID: ZojIPNpXMjCHJG9QaXousQ_1752169423 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6fb3487d422so19531136d6.0 for ; Thu, 10 Jul 2025 10:43:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169423; x=1752774223; 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=exSjMafszsHf+hPI+jA3EKbDPNjmXxeN/VchItvqKMU=; b=H7QBiPc4XNxoPXV3qCcTy7FKTgIqsiA5ytuaJJ0O0eJbuVyI/bZsSsVfaZa5qZALWZ M2mBZLzkt3hg19wAAZ9YzOnuSP3ID+ZPEgMfVqcbdqS2x4eqzlAQ6II6mw09OlrfKNGD sog4ukYsNNxQsxBvBMFinfh5MIbe9FwmgB4p8yfgGUkiN0ar1+wvjEsntaKhcbBw9OQG DdoFJ+Ixxp8Y3wG65S5IJQDh7lzOd1mIc1vWhxwNhb4yQdpvqyQieQS20HAcR+p77OiX 75Q5QSOsHEChpt5esSuBHkvj7zmD/W+Rbo6pROeGtIIlw1TvBvXDyzJuVeszA3v+bhbW sYwg== X-Forwarded-Encrypted: i=1; AJvYcCUu6xUVEhxU9pm+L3nEx9d/bQX8PHN73gsHT8AUUy2rUB087Q97ZDI1t/gtjtnf+Lv9GC1GlbtsobgjNi0=@vger.kernel.org X-Gm-Message-State: AOJu0YzoHqhjU4ECfG91wMrpwN+i6+Kn1f4BxBnTEgz/PS5Jkz6H3zQe aM3f47zuTAw2wf66Mrk6gGcxepz+4Ab8JELwIGAEdydYxs/6cUhr/T+OOAcRRNUlWF0OHw9Et7u XkSA3HRR5l0Kt15bsMs5AlRx0LmlAxL773Ja3RBlp2RM4N+NRACZzsu3YvaX9YBQVXw== X-Gm-Gg: ASbGncv5jMVSAM+1gdyoGRZaQZwObDV7Yy08OwyQ5u0WpDADgYm6OYRomGIyt+KlLL2 y6UeGdYMoi+XpN6px0sdFHT0c97GYAUtc3dbWaWKLxsJME+Bd232oHgQ/IzHf74bAqFO+yqVEKp KQMq1/Yqqm1p1wQWTZdt9a/ZrfHWqs17sB3ZnSrf3I3KiMLcdz8pMwonoDyXFCYgPVaAq95NYwu TzQzzccF1KALNH/BZEcaWKuzXE0CIJ/uUFIXGtWnxMr6FUgVgTuir5xIyAI6qYMuPMaGdsmfu2r XyaVTooizqWtC/W+2RxqONnmSXbB8IMzCw5iRR/Nyf6gSnYVSWYFSWc+3Mno X-Received: by 2002:ad4:4eab:0:b0:702:d7e1:9a61 with SMTP id 6a1803df08f44-704a4325359mr1692636d6.32.1752169422743; Thu, 10 Jul 2025 10:43:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE946PzHD0RXk4GY5dDiYIFHgj5udxSitTpswAFFe0EalaGRnpP5sdgmvG0/oOdFa+px1bfeQ== X-Received: by 2002:ad4:4eab:0:b0:702:d7e1:9a61 with SMTP id 6a1803df08f44-704a4325359mr1692226d6.32.1752169422349; Thu, 10 Jul 2025 10:43:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:41 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:09 -0400 Subject: [PATCH 8/9] drm/sun4i/sun4i_hdmi_ddc_clk: 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: <20250710-drm-clk-round-rate-v1-8-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=1647; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=OHsRnwsdtf93oenlkpM8OGpjPNCqkqTYz1ncE/Hukgk=; b=ho7GtAWEeFJp5Ux6aTEtHmHkJKzsUOAKpGEfNDI+F7l5XbF1qK2v1eRvTIse1y82RTcxYpTS9 vSPNZAJFAqpDDKhg/zIW7SbizIxqSMy8J+QnCYzoa0xmplhJw/HPvrO 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. Signed-off-by: Brian Masney Acked-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/s= un4i/sun4i_hdmi_ddc_clk.c index 12430b9d4e930f7e7b0536a5cabdf788ba182176..b1beadb9bb59f8fffd23fd5f1a1= 75d7385cd5e06 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c @@ -59,13 +59,15 @@ static unsigned long sun4i_ddc_calc_divider(unsigned lo= ng rate, return best_rate; } =20 -static long sun4i_ddc_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int sun4i_ddc_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct sun4i_ddc *ddc =3D hw_to_ddc(hw); =20 - return sun4i_ddc_calc_divider(rate, *prate, ddc->pre_div, - ddc->m_offset, NULL, NULL); + req->rate =3D sun4i_ddc_calc_divider(req->rate, req->best_parent_rate, + ddc->pre_div, ddc->m_offset, NULL, NULL); + + return 0; } =20 static unsigned long sun4i_ddc_recalc_rate(struct clk_hw *hw, @@ -101,7 +103,7 @@ static int sun4i_ddc_set_rate(struct clk_hw *hw, unsign= ed long rate, =20 static const struct clk_ops sun4i_ddc_ops =3D { .recalc_rate =3D sun4i_ddc_recalc_rate, - .round_rate =3D sun4i_ddc_round_rate, + .determine_rate =3D sun4i_ddc_determine_rate, .set_rate =3D sun4i_ddc_set_rate, }; =20 --=20 2.50.0 From nobody Tue Oct 7 09:55:06 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 7C3532F199D for ; Thu, 10 Jul 2025 17:43:48 +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=1752169430; cv=none; b=ozdPTlf0yLskBwj/M5Eh3oFJdWIgk3Q29kIRVpUn4Rv6CBKDRMjZc9ISHGzYfVZxX473g9x0Vw31+NGDtt1ZcwhKgUYfTKBtAVZn1bet2tU8COO03wqhexUZe7zA39SDg2Yapy6lv09NX3LxDvBEmLrrAG8tFIg8q8TlpS89/Eg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752169430; c=relaxed/simple; bh=xPkagiW22ryYRgcFeUxKsYb4R3sx64zzzkaF7TIS6rk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RJrR9B4p+SvhwOTaWZ214jnB2ygYWSVpzPz1WZV+op/cYA5uHWSf0uZ2Kx8WODUsqRDMskLjuhSdRWj5lbLf83dijxBXcaD8Du02vwT8DE1ud/cbxAHSugG0HJ+WUP2YrG6vm3w4MK/wy/eb7ImYv1hjf1j3VsNbY9TEzp+x3Ak= 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=C1NKOcA9; 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="C1NKOcA9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752169427; 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=/OrtVi+H4smani+Wxuj7rrrlvdLEKHZeWuJz/QAEtZ0=; b=C1NKOcA9WOjno+qVJncqzTsNd6tK1OAbQ/UwBy4EBdMnt4Xsye00ti/gS9SWSzC72f3Qme 7/4nj1LECVyixuEcNUN0nPDlCSFLDGPZNcQ9nKJJXF3v7bGm4gP1VEyNxbQNKMyEYFUU2b VY73g0YPuvBXipL1Hqt2qlcEP3OjR1U= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-nDi4K8eqM32orSXn-GXFLw-1; Thu, 10 Jul 2025 13:43:46 -0400 X-MC-Unique: nDi4K8eqM32orSXn-GXFLw-1 X-Mimecast-MFC-AGG-ID: nDi4K8eqM32orSXn-GXFLw_1752169426 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6face45b58dso19844326d6.3 for ; Thu, 10 Jul 2025 10:43:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752169426; x=1752774226; 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=/OrtVi+H4smani+Wxuj7rrrlvdLEKHZeWuJz/QAEtZ0=; b=Hl30QTOa7I0VRqe6HHr6BZjtu+5r8bu4tE/0sb2hrsm7lk1jr7pyQ61AG0Ob37xsYT SG1+r8cTjY6D9Pylc0CVh0boSkBe1Am3719VgI86Nzh5BpEP7tQQ+p2nNKf1MdH8Mat8 j4W56fO7Qb3GKny5zXV5WOuoadcvzTiGHktAqMq0+hqd+AjCHtrFfvAzjvenS/jm81dk 8jd2CTB8RpAzNwvFKZyTBJ7SoQf75pDSfVpGjND4YYpFrWIqyfW2rnFMMwaDY7VQTy9E cMeabH3Xv1Ozats+OkmK/pmMATwQJRHHlFoCT3nKccAGptURUeCdxO69iMPQTCfPmd4E mipQ== X-Forwarded-Encrypted: i=1; AJvYcCX+dWgBC2OBwZJVbP8DoX6QIUdzgs6y8sUDvxBAM8j6fpkHaZgjRucviYe/SyFclvMTLTrNg1J+QZoA/io=@vger.kernel.org X-Gm-Message-State: AOJu0YxNVBZMrw7EMecGMNg1vpoKynfCMXov0rnUodMI7UXpTDg8Hwro o1PosgXFAFbfWS/w1iKuOoIsHchR56t03oIcp8SsvG+lTsZMsKlXsl1moL8rMo57/CIcPw2n7+I fYp1E6afmFSvahIvOUYGoXtXoo3lDptbCO+3bk2ZvkCzCWBlpn0paf6WuMRLW+1ocRQ== X-Gm-Gg: ASbGncvA8g9moHB/OTiOZPvy0ZbTeAIGyfJVvG5PDBVqMfOGVUaDL7cjjME/Hp9Pbcl An2wPbB4U/Q2dH+9own54Ldh5HBP0AsrgCiULCVThdxNbaiG0XQJKypVwoif4pXFeCkj12+FsI5 NnbTbZEEMVqFBD8MF6+i4XYWrFQrM+q0BlZwnySPkxgKmjSHRWRcDXIhnHe+/kZ6ZtapZKixypR 6lsNYNHaXK8tnHw1iPOyoMbsbvPhq/qcUDVO53K0ulS3DQTDf7+Vfq61BymK5glZsIP/46yNV8y /Rmj1fEu7lVRlOPGGfX70dz5s5HZALrgF+UUbas/vGBDQnZU5k783gtEqABc X-Received: by 2002:a05:6214:5d0a:b0:704:9bc2:be36 with SMTP id 6a1803df08f44-704a4083bcemr2613516d6.7.1752169425761; Thu, 10 Jul 2025 10:43:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxO+/+2HUAUPTiUYztt/lC4Yi0Q22OZoIfFBMZk64H2H2sqirYgZh1L3qOGgIkQVmmCaX6kA== X-Received: by 2002:a05:6214:5d0a:b0:704:9bc2:be36 with SMTP id 6a1803df08f44-704a4083bcemr2613296d6.7.1752169425386; Thu, 10 Jul 2025 10:43:45 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 10:43:44 -0700 (PDT) From: Brian Masney Date: Thu, 10 Jul 2025 13:43:10 -0400 Subject: [PATCH 9/9] drm/sun4i/sun4i_tcon_dclk: 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: <20250710-drm-clk-round-rate-v1-9-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=2262; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=xPkagiW22ryYRgcFeUxKsYb4R3sx64zzzkaF7TIS6rk=; b=l1P9iwEOFZ7iseMUGqrDwyTv1j/GS/74kLm+7ZgYbXOn1R2j8JwTxirCensojfrRCiquhbnNY RQW74FdbQM8B7MkeQZA7rAthmyuLBvNMin91wee7+2bXtn9fga4VsSS 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. Signed-off-by: Brian Masney Acked-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon_dclk.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon_dclk.c b/drivers/gpu/drm/sun4= i/sun4i_tcon_dclk.c index 03d7de1911cd654f395ea85ad914588c4351f391..9b85bf512d4c81d0a12e8cf726d= 5d5440343519c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon_dclk.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon_dclk.c @@ -67,8 +67,8 @@ static unsigned long sun4i_dclk_recalc_rate(struct clk_hw= *hw, return parent_rate / val; } =20 -static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int sun4i_dclk_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct sun4i_dclk *dclk =3D hw_to_dclk(hw); struct sun4i_tcon *tcon =3D dclk->tcon; @@ -77,7 +77,7 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsi= gned long rate, int i; =20 for (i =3D tcon->dclk_min_div; i <=3D tcon->dclk_max_div; i++) { - u64 ideal =3D (u64)rate * i; + u64 ideal =3D (u64) req->rate * i; unsigned long rounded; =20 /* @@ -99,17 +99,19 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, un= signed long rate, goto out; } =20 - if (abs(rate - rounded / i) < - abs(rate - best_parent / best_div)) { + if (abs(req->rate - rounded / i) < + abs(req->rate - best_parent / best_div)) { best_parent =3D rounded; best_div =3D i; } } =20 out: - *parent_rate =3D best_parent; + req->best_parent_rate =3D best_parent; =20 - return best_parent / best_div; + req->rate =3D best_parent / best_div; + + return 0; } =20 static int sun4i_dclk_set_rate(struct clk_hw *hw, unsigned long rate, @@ -155,7 +157,7 @@ static const struct clk_ops sun4i_dclk_ops =3D { .is_enabled =3D sun4i_dclk_is_enabled, =20 .recalc_rate =3D sun4i_dclk_recalc_rate, - .round_rate =3D sun4i_dclk_round_rate, + .determine_rate =3D sun4i_dclk_determine_rate, .set_rate =3D sun4i_dclk_set_rate, =20 .get_phase =3D sun4i_dclk_get_phase, --=20 2.50.0