From nobody Sun Oct 5 01:52:37 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 9B0611C07C3 for ; Mon, 11 Aug 2025 10:56:31 +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=1754909793; cv=none; b=DJEwyzdxK7QiSZn/7WOKj9PdJn9kquvVMMcwcz2gRfjWautArEyZPvYV9jymgbcDmeAvu4v4Aq3VenTX+hWkxlvrZ8J7QcazVc2G8ezzKCOtgVB2RNO92WPsRN9RBkNU6o0Cim1euByOuSmMsenl/7+7vMZtlVKsODJJ/0xigy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909793; c=relaxed/simple; bh=cxbqZ4pGz5eouMzBVW3NyN413s0i735X+YyBDIP1KBA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=goGmsibTvoWi9O9/7GvapxnXfGV3Hxb3nx3CGjazH1SfU25PzISq1Yycy1GTLarMTPs0JiIbVhDFhpFiqjFINO3coo0yDl3UTlE0ZXBpAN84p0ukJfPdSAztbv3SAfSDE8v3kjz0C1/0IlPJ5aUuQTFNudtQbsPuuyFykPrFn6U= 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=XUvkGGxE; 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="XUvkGGxE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909790; 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=oItVFGO2Yky7AW4ur1CICLCJs15wxQxwvYfZhdFHqm0=; b=XUvkGGxEe+h1WmIbg/eyl2fCDWGsH82NDvxo0Pd+C72IHlKf56j9dvQz/tlJs1YK+Vn5N6 77LGXvnSvCT46SKgtftFqcYRB0rx7gnbKGCHkD8qb7R/BQ6YLSHF+Z29uoDT1WucT2ESoK TCIF087SsfZw9+R3BIB3tSGGeoJUZqo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-418-rMlTMhTKP_G5mvG0dUWE9Q-1; Mon, 11 Aug 2025 06:56:29 -0400 X-MC-Unique: rMlTMhTKP_G5mvG0dUWE9Q-1 X-Mimecast-MFC-AGG-ID: rMlTMhTKP_G5mvG0dUWE9Q_1754909789 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7e8072f828cso419676085a.0 for ; Mon, 11 Aug 2025 03:56:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909789; x=1755514589; 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=oItVFGO2Yky7AW4ur1CICLCJs15wxQxwvYfZhdFHqm0=; b=bL9ILLWgdZeiyCdv5JrpV/3W671JQr1L2/mIrBBw33KppgLVWsuXokR10O5kXdmggx e/zOxto9KyszqppmPhkrfHal0seGz65aZBdobMsMvnT2HdermBQKWf6wtO7IxzHghGeO C22fvl21QSZOuJIgYMGwge9QjFnw7pzUa71HLm+9Gzh0ovmJQjLnKkupQjING6CY7dhN GSudbnx5FfQ3dUpoEDusmNLxwvHHgxciYT8w5xopk+iC9cnZipmvpvnRS/WWCi5MtcxW EnMWqqHXqiTEiRBAlQsOghxALTXoAs51JdVgzr/Iso9K3WNfjpU/leFha0sFn8Dvz7P9 TQiQ== X-Forwarded-Encrypted: i=1; AJvYcCVoj5V+2f5HkiDBdy9U15KM84RBjkVUYk0FpRUkmVSfaUd4rQ1GVtuBiOFudKQx0KFCOzLC0b7PyxyvT8s=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+Y/umJO+1zUnAXWm/yaWhYLARpKLDq3F2aWTquBs9f5ykomOz 9tlLt2vTLv05sFjziF5EPKcO2iMeBLLfkcynMhNQeAuuHZOOWEf1+ztpreiwup302g3EBd/Bjek ousQV1mtgXi7gpDylNMG2nGvgUqAAdwXVATtIGsiJpCfMtDsOP0IJ4mIEQFhjrNIbsg== X-Gm-Gg: ASbGncs6cicZMzjf6KIPGfSrHrAegpJCtuqws8YyrcGQOIQSIVVqMPWRu4l71KtWQlz GhWQHtohMrzduD3PGwDXjdrmKiH6rhxtOaPDrHcd/w1ybzje4ZeWWlwbjJLbonzloVOkNZFQ5Lx UGCjwk9jIoVSEJIzIqiNjUcFO9EEcpoyacA0xAEVsJZQ6rKog4ToW8j6V/OXROohcwPqYrzeB12 hANIFfl1jkETimzyDJJy2m+5ix6Mxhz3x4fsmc/oMYUBSQQ9AEQY22wbVP1QaiyfY8Q+BhyFFNv U6kq0cscWvZBVO9aQqUM9efApLAJJ6lJcm+fIEPTL6osbA8P+dZQ0RnxWhKzOS9/2Nxmzt/d3aR Gb5s= X-Received: by 2002:a05:620a:4482:b0:7e8:4fef:bfdf with SMTP id af79cd13be357-7e84fefc2camr275376185a.45.1754909788886; Mon, 11 Aug 2025 03:56:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGc+TLWI2xokcRtB+yecJngyy21noRPTcC3sO0sgVUYXnKnFuXDagMBjiVXOuloOtpZxIcGpQ== X-Received: by 2002:a05:620a:4482:b0:7e8:4fef:bfdf with SMTP id af79cd13be357-7e84fefc2camr275371485a.45.1754909788147; Mon, 11 Aug 2025 03:56:28 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:27 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:05 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-1-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=1689; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=cxbqZ4pGz5eouMzBVW3NyN413s0i735X+YyBDIP1KBA=; b=6DBm6LwfY0nfMA421HhZNkFETdBD0OvYJlukZJUarU0DQPM5TzD76GN5AVvolZqrFAvmrp1nP jvbNFGe7dHWC4XgQV+dlyA/bvSpVN7ZZvyR5/1pWXfn+rHkgHaXmtum 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: Peng Fan --- 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.1 From nobody Sun Oct 5 01:52:37 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 8A05A2777FC for ; Mon, 11 Aug 2025 10:56: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=1754909799; cv=none; b=oQ4d5FyVy/Vxku3jUh/mt99W8HOytZxKzh7dX/CN5V3dP3j3gxNRbR23d8vjKXoK7TGd0Sxa8+b0ROhbzbputvF4jIzbFATHtaEmMwvtf73TiVZ5AfE3x6bWXfxXRnVA8imiTcrYQ7i0VNHMvI4Mn5IsylpG4JcLoaqlgSNcK8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909799; c=relaxed/simple; bh=9BXAN9WaQXGACsWVgeakYqAdywyzgmh/IMziqVvQDEg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=feG+erUSKcictVpk8SKXpKSx006tiJFQc34/dPV7k+3vsu5u0HmI6teTwYL77Fbr71ApAt/tmTUZGwBc1JrpVDaHNhmm1t6oWAaBs0icpD/26974QJP1ZVbh9Mc5RZ3D889+CMiqIv+oMcdn8RTvDLn+VrgQa0x1t2lFbt2jJ+4= 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=Vlbpd4d1; 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="Vlbpd4d1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909794; 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=tWkAq+ld75LwDG/hGRVHHPxuHrsiy/sV3D7XIB1FZRs=; b=Vlbpd4d1GWLigeSUtZRUv6DKjNBdXibb4g9JbYbVitRrPiFoji9hYKRStDLadmK5tBebGE O8pfANZy2JB4mvj9zgRNWtcrWGCIF4PAp5CDs9jbUW2m0xzVyPlEO/n0D/CWyW+5FVEsWZ +c3yXwS/mQYrfBi/vxjzhSLMtzshwp4= 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-158-q7yZ1fVnMLCPexlK8n0geA-1; Mon, 11 Aug 2025 06:56:33 -0400 X-MC-Unique: q7yZ1fVnMLCPexlK8n0geA-1 X-Mimecast-MFC-AGG-ID: q7yZ1fVnMLCPexlK8n0geA_1754909792 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7e696444d0cso1003465085a.1 for ; Mon, 11 Aug 2025 03:56:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909792; x=1755514592; 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=tWkAq+ld75LwDG/hGRVHHPxuHrsiy/sV3D7XIB1FZRs=; b=Ny85lYCkdUcyxkobjxDxqfiogxdAHjdss2BoBC6pdtlznGQyM886eRPwzpU3Qwxhg0 E9YbUUuNZ61ykD0yEjCH4PuZ/9oZn9RHcqt1RvQAOnVRkh3Itu9PwH6JxV4Q7nY6laj+ K55Sj/2uLOl6Y1SDVYQ1J9Smc1EYK1iOnT5k442yjHDkenJokxD4DK5lLxcV3O943vX1 KcXVF6B+ymeSk3sAI9tMI2CB1Cn8ncH3p0VQPfTxzJX0PGu0loidVUU1vF93HmFXHZ03 yA5HrJ0BfD22ucolY8oKOPzr9DX/RXk1ZKGpXLQoBqHthm8c49C4MDq0YuxzqVhUnRbJ +9yQ== X-Forwarded-Encrypted: i=1; AJvYcCUuiUupo2AbKAhvYglcIQL8uJv7xmhYGInzfhheB6qKm6VUFsG7hciu7pVboSkiKCbPaCJMFZliEIDrJ2E=@vger.kernel.org X-Gm-Message-State: AOJu0YxwG8hUaiJQ4PZBNw9VCoYCXMkdR+FC/T4npPpJFS9Qm8jxBZsJ BPlIZq1ZBH8uoXCdR1jxC02/Qy1nDDXczCH58IrG5IPR1oCMZ0PLyG/L6sF+vTrf7/b9u2F6JGD /SjXtebYBjSuX/w5RdyrUCmxRdPphK33GRgHfaxjx9PQX3E5BBpunrENvGJKxDhNYiQ== X-Gm-Gg: ASbGncvQsMuEe92bFpDnPaN+2d2BAmYqn3HpfrpIvjSMopVWTQnwrWbC+b0cLFdZClq Y9hO9XNnNbt6O2xJ7xiG8M+hQVtVBEYYwdD+UGybVxvJQ5drITptL+AmnAZ6m6a19ASuGhbsjM8 DzppxKg+2sxhkEgPbpVcnUifehu8TiiGl9TDxbENvyKRoqyKD6K6N2BIQQuuK1P+sc/LQb0O7tv JlksNOmCVSa1WoGsOMSej2KT6rFfF37jrUeAK3P9CWw8kV207Pm2pLd20TIsAEZCzDGpKsJnD8J LFXISKWP1ms+eiEFmuIea+AtrJFy6qK2V70YbBIddZ3zwieSaClGotevs8WsuBdFy7YWBDW1rki 2d1E= X-Received: by 2002:a05:620a:45a3:b0:7e6:9a4f:a299 with SMTP id af79cd13be357-7e82c646f33mr1843251585a.16.1754909792392; Mon, 11 Aug 2025 03:56:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgW8gZJYQbVSn9A8dMelBcES9raZpoqJep5i7D+EdYN7YXUJOpmuR1qZ1AM51jM57roxoq8Q== X-Received: by 2002:a05:620a:45a3:b0:7e6:9a4f:a299 with SMTP id af79cd13be357-7e82c646f33mr1843249285a.16.1754909791988; Mon, 11 Aug 2025 03:56:31 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:31 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:06 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-2-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=1730; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=9BXAN9WaQXGACsWVgeakYqAdywyzgmh/IMziqVvQDEg=; b=ylupjg1fmCNBXXxO3X3BdCWItZxz3hbcUzYzU1GUNiNNWUiYrAb17RJCYD00k/EMPQMfWhWKC RXc0CDE9VnwCgzocNA8sHN+o4QXxCM6UpLGynPKDC6JbO0dbhiFFntj 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. Reviewed-by: Linus Walleij Signed-off-by: Brian Masney --- 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.1 From nobody Sun Oct 5 01:52:37 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 4CE5028853C for ; Mon, 11 Aug 2025 10:56:39 +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=1754909802; cv=none; b=s9/et1OW7ZRj5mTtxKoEOUW2RBALgwi7kFoTrQwFggFczFKV5S1/tceC+GfS5A7hFv8+VJy1X2MtPMabKLoKIC8C7cOeZD3EduBpKYqU4rTW/qTIZzKvC4rscdQWj+H1T2Fww4k3OdjnCd1KGvIBvMZ3DeJXQ3DrapFcuPy5y8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909802; c=relaxed/simple; bh=QhsR7m95oQQJWiR4k5sEM+znPy8RVqMfVFdEDgPgP5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rsbQSE3OQz3WUaY7xmkyYxD43Grp+iLn1ZbCTdf4buOfiqhf1KeYb6TkDrpXgyQuulDoLmCRNcnXiWNdKA+STmj1tHVaej0NtPiL6q0Q5PxZ9HUumv2Yp+qzIH3aTyP3tQlOFNJe/dzfac6fJP4+c0sXyA9+ST8HJcUILdJrBwU= 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=ign7rONB; 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="ign7rONB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909798; 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=SmZ5OhIFbDNhhdemRjccJWJIhJ+GPeWDy3CnIwZY5Y0=; b=ign7rONBCv8z3tMyAs+qKJUu0MXZjnCRh0CxIGY4VW6cwVrbvxPktZ+NjBha8BYhod/fp3 eX8fA8VKwPC00wrJOP7ARxBU3GfoxET0f4VmUXv7x2YaZADlIW7EyjmxUgDDidGyaqwgYQ 691wPJinScKtuQ4SeQLct8tblcNmkCA= 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-333-4ntU-ryjPsCPk-qLiVqaYA-1; Mon, 11 Aug 2025 06:56:36 -0400 X-MC-Unique: 4ntU-ryjPsCPk-qLiVqaYA-1 X-Mimecast-MFC-AGG-ID: 4ntU-ryjPsCPk-qLiVqaYA_1754909796 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7e69e201c51so996663185a.1 for ; Mon, 11 Aug 2025 03:56:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909796; x=1755514596; 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=SmZ5OhIFbDNhhdemRjccJWJIhJ+GPeWDy3CnIwZY5Y0=; b=MKsfpCJh1oX+JKfuD8BQMQrCNg6r5SPAE2LhcPXkHgNc3Y19Vvpg4KMQFzYF3gVFDk 9FHEhtFPCKeA+9LnkQstjPG5G1JFm6nVGecT4tsmN5omFZfCsgtEPyOsPEA483HVIHmI nFQFeJJ15hiShtL84P9OBuCctBkSJU3JmLRWC1l/zkpUUJNRgygunebmkySMIZJf7oua qRq4lQ8htm904hy4h+xtfG8ZOx4bOgDj+8ZS2JL/uobkAchHBadmHtwmGfmN5MiO2Mv4 xkECxmNHRGdJjeLZ1R3VOOQaEtAFPnGgg0+74yFMWhChneXSuRPu6z8Z2fGQ5IsvKXgU sI6Q== X-Forwarded-Encrypted: i=1; AJvYcCVzYaOuEOx6/zZzS3Ri70IrQBywN1w9BHzTf7u3G1fSDAtFWe+ULaUCdma6+KQn+bIuIdirPMHS8/ExQq8=@vger.kernel.org X-Gm-Message-State: AOJu0Ywj2i7+CwwZ0JFlWaQyl9GCNonigO+0cadtsyD3hGromZbS7JOP iMaoidPibjdcsD7ig1HSqWXyGxJSXEJpzELal0o8jn0wEvU/7sHKrWC+s4DV3BWQAOichgs/NWg 8kO84+tazxOUdbnn0wtF29KqkKEuikIuo0NaQa1TOGQPbKCrUGcyvNjKTra89dmgQ+g== X-Gm-Gg: ASbGncu+NVD1ht0R+g+LXfGBygFBV3qFX3No7ED5dBNDr5HsNraQGRKQhn1GyhnCbQR J2hbnbsrUfH9PHS31EdfTA9DUdiDXtIXxi9csmvZC/gWn8t1ra7Y613rQ3QlbZvMeiQNz1d2p7d 72a41oYyCHR+kh3u3TM7vKTgQBhEDn2jh2mn586HEx0VrGpLm1rqvyvcQbOG2nz96xnYInocdK3 4LU1t0RxII8sXIG4fum4zYSJ6mVbv//TeHiy9HoeSMrRAUPqjIqAuyZIBXhLG+JVJnDuGAk7Nqk XIp3xs01tqyurKPQrXzP3SNySSN+WNAwCppNWDTy4F+gcj2MNYhhP6A/GWP7mW0t86elMPUMXCI r+aY= X-Received: by 2002:a05:620a:2ae2:b0:7e8:23c1:f472 with SMTP id af79cd13be357-7e82c64cc0dmr1348329685a.3.1754909795614; Mon, 11 Aug 2025 03:56:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9n70Dnsh0oekI6lYBsj+g6fiHD2aJUNrf5ZRMtmoVkJvAZxcIb6V9PGnNEHDigLw+MQojEQ== X-Received: by 2002:a05:620a:2ae2:b0:7e8:23c1:f472 with SMTP id af79cd13be357-7e82c64cc0dmr1348326285a.3.1754909795068; Mon, 11 Aug 2025 03:56:35 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:34 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:07 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-3-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 , Dmitry Baryshkov , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1754909781; l=1737; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=QhsR7m95oQQJWiR4k5sEM+znPy8RVqMfVFdEDgPgP5I=; b=Yf+/AEJVSVpYyfmQu4W8WyuhOAot3PpTJ66fonHG6NgwPWqhvr62JRFBH9lf6jrYZTbKGBwD4 RLchj5Jj8AWD0/ZZRq0fRTK+W2ARhNi43oK0yq2QvGqqPc6Fg70Vyhk 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: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Brian Masney --- 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.1 From nobody Sun Oct 5 01:52:37 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 8D652289367 for ; Mon, 11 Aug 2025 10:56:41 +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=1754909804; cv=none; b=fl7qxfu+KNoPh8aKzQIOrPpkKCUXkgBvie4qTWrxLzcywc2foPSij/mh89DBZT61bYHYZP62AhPIaWliTXjuko6q4onN/4ejik2GdPNlPQFUlzlBMF+tz+K+1WoffVcpQTg7s50hi8SPkDDEpk/JjI/+z+J6JiR1u6XT3zzKNa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909804; c=relaxed/simple; bh=W4oHtDUPRGuCLmVSKKz7teYp4yrHno03QAMcLtqmgJ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s5TD9cgrUgm+62ovHIi3tWgaBXiLUntJVtigtroJ1UQrzFyFSEWJEaDaQhPy3LgVXt7Z+i/ZNuxcobothoOhX+WnJc0MwCnYwSa0Fqi+6lp+W6jz94frPgf7vc/+MP4Iou9ESERJ8uHRzYNdPQVKJxnS96uBxCDt0YoJl5N8rI4= 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=RE9dbemV; 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="RE9dbemV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909800; 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=2v4P79PdNIaS18Wb0ZUemgbjQrcADYOCCdsS00/Mio0=; b=RE9dbemVTecLIMxvYbG/9k6zYHAa5I3iPvs36YZpyr4pppl8fBfgX5GV1yJ2JDka9GBPS2 kGWXnxvSuVLyYCySsoGCP0OHz6EfafRiyuOxsRpyRpi42/23DjElav6djwyeleVzxD7zq8 5vnHFi8OV4AEBbwmt5Q7i44gPE2md8M= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-sKGbnGLUOxOSutJiEhjr-A-1; Mon, 11 Aug 2025 06:56:39 -0400 X-MC-Unique: sKGbnGLUOxOSutJiEhjr-A-1 X-Mimecast-MFC-AGG-ID: sKGbnGLUOxOSutJiEhjr-A_1754909799 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4af2237e4beso96989231cf.0 for ; Mon, 11 Aug 2025 03:56:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909799; x=1755514599; 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=2v4P79PdNIaS18Wb0ZUemgbjQrcADYOCCdsS00/Mio0=; b=jUq9btT4QRDmiSrzzA+8U0Zl7ZHl8NyMyH3cO8IV2PvxBheDzA7lO41pQfsvei1cZb 0O+eMxNIhhvlzseoSTwpz6FYCi5VgOFQu6fBhJm3O+kV6I2X2B5aJrIAbXXNCYou4SYy G5UyWynYUyt7gMP67bQfijCIo8oEbukbZSLtyO0SGCd6BgpzcKtHb2SQX4q2ah7L/HXz pRnnu+dRk2YRV1ZBQ80R1IX2qt2MPCS3McpAkwcqI3ToVADl+V1bRwhj+AJOUwiBCRf8 u6/ToiY3oDYhF6v6Ub5t8E6q7sPDMWaRmzdX8TEfF0DUEBS5dvKCXQZacLQe6zIoC8c3 1w/g== X-Forwarded-Encrypted: i=1; AJvYcCVcsTkvrJxmyQm/nPrZ5cg6nzQKhOcWYJeaGe8C7HRGeXtBdHN2uS94hVMAz2nrh98sbNsFt9dCdZz57ps=@vger.kernel.org X-Gm-Message-State: AOJu0YzocaxQLMelnTAamWxiK6KXbZ7mst99wAGsrUP71xzCB20XgXuW 5a8vB9fCL36M7fiHftgYrrmkeFr04UBH9kMhTe21wOLUeaoBwEQV8H7IAXIcuVQf598PF5FrO01 87L2X8/UOM+zu3vJS2xOVEX/1yEnv/UNHI8DM+2CCYJc2UWl36UYhOpZYcSFtqQNbag== X-Gm-Gg: ASbGncufVrSV6CbKBYCKBrGlCy2nJ3EsawOZAeJSwgvDBfTtVYq6FtGBmhsOqtZ3LW8 QS0MiVdxkQzreziUxh5nBHXh5iihYwATNq6nMUBRy7l21rwuWzo9h5DWfaCfqdHknWjywEkyF1B BgbJCVX7sEYdQeIOPx8puUAWAfBT7LwansPjKCFEfPHyz5nk7zj9D8xBGRMhD79GL7mGjcajBPM q8ifQkLUQsqaI2OV/TOfnuQPUhTWXD/j10jXfJw+N8Y9es3R6Ak8RSJxlzMWWQXRRNzKPDPuEzm 5USmsWpjbaOSbTRyHv4CuOuykKBRK988QWQTDWYWPjCFiKeOkqDrHPkaH4wKSPAi+IRZOYNWOyS XMtw= X-Received: by 2002:a05:622a:1aa0:b0:4ab:640d:414e with SMTP id d75a77b69052e-4b0a06eedfdmr247966701cf.3.1754909798788; Mon, 11 Aug 2025 03:56:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETXQEWlFC7Wcyu/io2faEikISODgBHD0p2mDq0e7vALuwZuamzM4hp/NBzXMpTjJQ+LZFp/g== X-Received: by 2002:a05:622a:1aa0:b0:4ab:640d:414e with SMTP id d75a77b69052e-4b0a06eedfdmr247966191cf.3.1754909798373; Mon, 11 Aug 2025 03:56:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:37 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:08 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-4-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 , Dmitry Baryshkov , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1754909781; l=1657; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=W4oHtDUPRGuCLmVSKKz7teYp4yrHno03QAMcLtqmgJ4=; b=zHi78rLvdAYaZdTIMhwgqH/js0hiXWDnYr4X0BvUbuN6hprJjEDc2ZwgX+szZViPz4W8X1kk2 ngDBdMEkWVsAVo6sQ7hWvsQkjGQtaqeiQEeV2wywPAakq8QLF6bboSJ 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: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Signed-off-by: Brian Masney --- 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.1 From nobody Sun Oct 5 01:52:37 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 B7B7A28980F for ; Mon, 11 Aug 2025 10:56:44 +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=1754909807; cv=none; b=t6GqOiioPBlZkxLIBIvgN/tyiT76DwAQHUzUCJlZUtBtW4FSAzPto53k20Sf9CAvXZkx+ubuNf+IwMfeaQHEZ+zrAsdw7XcebajYKw95s4rVhJsu2v5It7N7frHlm7aLZarQNnIkn60zq+VQ+HAHRfK+LttfuZHhaZq1bUA4Ubw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909807; c=relaxed/simple; bh=zjPZ3dnO6gZ6FQi2ZfbbqSAvbJwyf4CBg6JGhX8DcxM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nvX/ooYvtkF084sJd+fUaVK91lcoqF9MEB3s7x8ZvBL5fdfcyU6n7yvGszVHzv3KTMGS3q0RvSgRz6BKYyTilB4PNRWxrVSmqXgwvWpNzyQ5bXtP+Rm5rFK5kNOBRYQTMmjN8m0CvEFOH65TqjATJ+BagkYbuNnU4ufe9+YNrb4= 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=M50D6U3V; 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="M50D6U3V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909803; 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=wT9Dbxfb4kVAT42wH+rZD3vwBa5NQ+w/1wzXJJwlqX0=; b=M50D6U3VZliH6yNLTkh1JDR2fkGhSYetpLpYy1CHXkf5Symtj/vS+cdrJISrVHalx+KkQi z8Xvk5hlxdUtjvmGQmt2LdEJ5n5Q5Cm9MYRF3DYRl5Z2/hA35LLQsRk32O40IPgy/DMpvK BQTq3aKKn1mEHqismY7BiNkexV4gMiY= 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-126-TaEEtO52OymXe2tcKChDEw-1; Mon, 11 Aug 2025 06:56:42 -0400 X-MC-Unique: TaEEtO52OymXe2tcKChDEw-1 X-Mimecast-MFC-AGG-ID: TaEEtO52OymXe2tcKChDEw_1754909802 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7e7f74baf26so992964585a.1 for ; Mon, 11 Aug 2025 03:56:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909802; x=1755514602; 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=wT9Dbxfb4kVAT42wH+rZD3vwBa5NQ+w/1wzXJJwlqX0=; b=Fn9oq9spHdkl5bxJeJlsodrm6JCDKKfLXQfEnqYo2bRRvpJXYCT6ujxWsHT499tesu nPpa0QGsrn1dNrM6J8MjMiGSTTC61RJSqOkcVi3o/rdcCPrabqBqB8zyJDqgHx3sDqrc RbRZnO4PRCEoTVh4vuuag4UmVmhjZwpvq8vD2UaZz6QcqX3ocn7YxFRAWol5ZuBHW+zh DfuZu4JN6d1JOei2kQSuPwhY4zVsC0JROQVCa50I8OesMXyP34DA3LJLeMVCNfFY1K3t i46IMdJcbzBL+A48IPLgn2gI1GFrbZHtfTAkirJqNvb6li20RJgn5AXQD3QQHSLiam2R VFgw== X-Forwarded-Encrypted: i=1; AJvYcCXYJmKwLbme1+3K4s0cBf3jqrzRcj5Js2b3uIRs4R+6n+oM0MwWFrp+AKNP2kqPeJch6r3VRMD1CO5Vy5Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi/8+2aIZO37XfLc7ZPJlxtaHpfE5EcpW/EBcIfw3iAtf7yX3k NK9IPv2L//3jtZQmP80Y1EcVGzRqFvPabWHCUyq733t9aBkEWFC8OAP5gLyXQBkFRjCj15rZy1M VzM1jt8TUQntatky0GBFunjMSCHa3JLgD3CEZlSG9saE1LrvXgF+I0NJdeYGM+vceWg== X-Gm-Gg: ASbGncuDc5bNVvWfHa04ZzSb9zDr73ToVDDw2HuLkSZkmqmWAnl03RmhWrvwhn7DWby 0ml3+O888i3vLLadW7//yQ+qXRa5dWp7rg/Cso2o7sMZTzfd8Lwm/3lGEbHIQ0PRhFs+hu341GZ VGa46wthR2cCYXAZubQKP81vTTnZL8YxF0D1mKFRC7LSQLvdLnesC67x9aB2IQ/PKAbTWi3hgQ4 XsVS/sDnH17107othnhT3LL9B2qv0TapPZ3/KXA1ZarclaSx/vQwe7AIfYJM27ujFVbhN9KqUaR Uk/CRxGinu8WUmjokxn/3Cl6QFbDmcfj+hRcPurYToMXSVcmEqp2nletfg2gq4mph37UsZrfA+e Lbtw= X-Received: by 2002:a05:620a:45aa:b0:7e8:2151:9bbd with SMTP id af79cd13be357-7e82c6834edmr1680335685a.25.1754909802016; Mon, 11 Aug 2025 03:56:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn4J1YPALYk3sfXKt4CIgszP9xA12/nZjPecmiJUzpdOL3Mq3At3CKB2rvFttPLfHNTO7lJg== X-Received: by 2002:a05:620a:45aa:b0:7e8:2151:9bbd with SMTP id af79cd13be357-7e82c6834edmr1680329285a.25.1754909801517; Mon, 11 Aug 2025 03:56:41 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:40 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:09 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-5-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=1718; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=zjPZ3dnO6gZ6FQi2ZfbbqSAvbJwyf4CBg6JGhX8DcxM=; b=NJqHQ2ssaD4y0rqVbCbujpIrqzdN3VuMWj9ghDV3lWlNDbiI/oggFqGjuVCZHps19PnD896Q0 9FdZ8qhj9mUBZ/GerZTn1O4AjtYG03lLvn79VW/TKhLY3AumrqAiB+P 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. Reviewed-by: Linus Walleij Signed-off-by: Brian Masney --- 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.1 From nobody Sun Oct 5 01:52:37 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 D23D8261593 for ; Mon, 11 Aug 2025 10:56:47 +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=1754909809; cv=none; b=ZjmQSpncpxzGPQ0K1idkWwTF4SmSPIqyF4eauOQGUoGO7gHn2opiG2CcwXBzxhlbV1UQHrw/oVNDiGd2MswZO2Vn1ZUlCsGJYrJ/8ATBy6+Gpl7oOn0Uyqk1WE/6S4FH3/yOQpwX0tJR0hr2T5MeCs+cr/6NGE4t+td0fhHrZsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909809; c=relaxed/simple; bh=TQX7y0WLJPoT2FXW3ljOONLbYB3hMMDCH4wBpr8HvE4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G5EDhDulocdOJL44WC5NOl5vg4QMkPD9T9aszy6fCu4vimRgZZDtLa0mcUMDssK7x+J3Vv14dmTz1Sh/QFpD/mPuhEGJ1CoWOEj+9NFUaBr41N3cOtmxLQCbUxGOPVmL+iFVn61gDGAFNaO1+JGKRDu0vJtAbDTjLpdOkoq8Bqc= 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=A+W2sHlO; 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="A+W2sHlO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909807; 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=fe1/zFdrNglpQdcc7DcZ0ub2lnvduP/lEo2aekbxLh4=; b=A+W2sHlOsiYlkc6hjXR76yphB9YU0IaXThzauHDVMcgplUya7cqsxSOur1tNQ8tjmI/NQX 2sNCaMm++tH50bdv3GJfTecO/VQR9HJ3rtjZ/LD+sBg3txcE//dKIdtkgmQn9qE17//3cF FSgJ5Txbx5e7hQ65knPZbxZ9GH9NspA= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-327-VOzexD_qPdiH3sGX4vf8KQ-1; Mon, 11 Aug 2025 06:56:45 -0400 X-MC-Unique: VOzexD_qPdiH3sGX4vf8KQ-1 X-Mimecast-MFC-AGG-ID: VOzexD_qPdiH3sGX4vf8KQ_1754909805 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-4b076528c4aso46245351cf.0 for ; Mon, 11 Aug 2025 03:56:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909805; x=1755514605; 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=fe1/zFdrNglpQdcc7DcZ0ub2lnvduP/lEo2aekbxLh4=; b=Bf9zNNZUe6NunVTeOoFy3oS5nsEGNhImQ/VqFjJsRpfGTwitoLASgC3e+SyYNj8IEA xHHoyKDdLLJEvX/hza2m4AQ63CkWi6MigYa08MPbQjxpFKz9BmBJusz9JZXRcezX6K+F yR0tTkclei6WtuUEevx7okyZa+ddxPFk4JM+ioLG6UF8QTvganNTxgrIipQZR6jbJhTb 4Bnvr/qfkIMvlkw1s2q965TYnzbD/hVVuCPVdupdZVvnz9Cu7N9IG0y2NvdEp52YsOMW ioumWo2pSgCi7oFGSlE+QoVRnJVvZX8C47Klj0c/59dD6MvtzCn+gmbthS+KHHYQPfBh a5rQ== X-Forwarded-Encrypted: i=1; AJvYcCU1+QVfHj0RV6qBW0EGcCHG/fe2dJk1QU2e4GQyxN6ifvApblM8jYMlTQNGSyl1xGhTHaYzJfrLll7e14k=@vger.kernel.org X-Gm-Message-State: AOJu0YybaEFmsGDCkH/wuINSs0VxNQIMbeEv+YkE5ISD8Fm+F2y3XRrl aodCnOFQQlqn75t2p//vhvGar603ledYhylwnFXcKd19dvEnWw2m+1f3SXHGLxAo1iFYhLm/kFo zthfAhnFMYsTzEsMNy4739mMtsQgtNY999XX2ykwe48wGLAOUvXzom9r7Qk4NvIvp9A== X-Gm-Gg: ASbGncvj6sfoJrXUTJ+H2skXxGqpWG7bmsOtphS7+TZXBXyKkgjobfWOSB7s5D2k3/0 Z4prAnQyfAS21RW2UdHLCYsq5d63YpEi1YegNFtdbtlohA/9X2HlxCjRgZkwpQv5+4Mn0Y5vAEM NSnH8wz3l9P+l04KCbatsl91Y/F+eAxkNZcJeTXL8ZKqX2jfRqaIy5yU/uLd6gpCuPL3gDTTim1 P4rrUJhjvU8W+TjJy+LMMZSRWbgLUbWaDYN2xv3ULhOpX96RHNVlNVCRkUpoqk6lJ6ym0DCrQhH hKQJ1K0k4nsw2K9vDOPOaMTvtjKDFLa178Ayq05Rs6LMzrvSoO3KaooYF7Kh4BG+xTW3WNiYhrE vU8M= X-Received: by 2002:a05:622a:164b:b0:4ab:81c7:b992 with SMTP id d75a77b69052e-4b0aee0416fmr177626521cf.41.1754909805237; Mon, 11 Aug 2025 03:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH84pkBd6GJf8XCR9+s0wYsjRXbW3CjMG1+xiMebELRnnC0y+m6C0KXWBUqdNOSAQDFJQ+q/g== X-Received: by 2002:a05:622a:164b:b0:4ab:81c7:b992 with SMTP id d75a77b69052e-4b0aee0416fmr177626021cf.41.1754909804709; Mon, 11 Aug 2025 03:56:44 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:44 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:10 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-6-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=2470; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=TQX7y0WLJPoT2FXW3ljOONLbYB3hMMDCH4wBpr8HvE4=; b=lgrz8b1APu4kFbIpIygfaPAMyZa9PSq0qCqlA9d2JnXNchMfPplzKOoa7IYJs93TVO9unUYBZ Y9qrAO5hmIoCqBBrlG0p/QgoeneH78eck1EdJ9ad2HPr3tup0+0Nd5I 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/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.1 From nobody Sun Oct 5 01:52:38 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 From nobody Sun Oct 5 01:52:38 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 48C52277C83 for ; Mon, 11 Aug 2025 10:56:54 +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=1754909815; cv=none; b=R9JoJxhQL7fLpoMPOkOMM967DXIHoWxEvz3i3naUtv3oA8nT+4kJw29ZnGb2J/IVOuIycyS0pufCNJdoLACjXNMyf+pEG2AX+teYCfCVIbvWxQuqFhOtZxsleoECXb5JZKaNODlJRkYZLClkjywx8RF3m5kZelHb+5cDV7T9Vq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909815; c=relaxed/simple; bh=4SmOn45QQwwyMezbBb5tx+ffOCKNsfDDe6H8Sa9QRwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LhPbdkPx15lIuAj5WGv4Y1WC2Z6om4s0TU1wFZT7donOqieW899Scpr2CjuFdZcDQCKHAQPOWC2zvznNek8S2GUrabqWdskPYUJJMXzjmVM1U1Zvf6/JeLP62kz7mKKSGs1QQ6ekqQXeHN2BQ0Uf1crchrGOernRT6f24BR5pPo= 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=DdgK5j86; 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="DdgK5j86" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909813; 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=t+Rztee25JuVOb3qnfGrbYzil++DqREMLNxo1mFDVeU=; b=DdgK5j86P6d00GitbptmK7sdrzwJWhHk495pOfAXuttPUG/Uu0Fe9b3Al5GIhEoaCoxEIM EHmK91B6O8ufFJtJY7zqfIAAGhiNDeV/LGhzU9srcNY0PrdG5iV/fioHD2f0nAHDWRqq4M wJVjksnkloQJx4MXmn/i6tj4crIyWDk= 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-645-U4mEPgWEPkah3eDj1Pypkw-1; Mon, 11 Aug 2025 06:56:52 -0400 X-MC-Unique: U4mEPgWEPkah3eDj1Pypkw-1 X-Mimecast-MFC-AGG-ID: U4mEPgWEPkah3eDj1Pypkw_1754909812 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7e7ffe84278so885973785a.2 for ; Mon, 11 Aug 2025 03:56:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909812; x=1755514612; 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=t+Rztee25JuVOb3qnfGrbYzil++DqREMLNxo1mFDVeU=; b=K5mU8wjkMVe9DvXYM6Wps/WvAq38B7sYRyt2ZaU3XeyI/0UnNx7iTifO27U/se6Arz SdyVQVb0KjNbytrbDm1z4niSrvC0l/lLyScwK6o2OsH9sDYynMVcnLwzuaTradk661qx o6gjogYHjdwy9x8aSuUj9DlItzcku17T0SJ68NgdlmBcmVr23STQPgu7N2b1kPCXj28l oJpHogf1MmIbMvAcznWtoDwHnSrG9ujccgCBk0JkYHY8yxTH5MoicOpdbkpM682UIHZa eJj1yiANbu/QnL3437hdoz15y1IXM2Y+fAJVvvMCHGIwGWOe/sVAziGAqPfb6Dj08bQ0 dgzQ== X-Forwarded-Encrypted: i=1; AJvYcCWsubq5ZNb2YCkK2XR9N2GQwYTO2VBSKp8mUi8QziZ75hpOi9RCAHtR8ccWFbAYQyu+lzU6K6FunswIIII=@vger.kernel.org X-Gm-Message-State: AOJu0YxxOLhwEspveMTa07gqLGsld1sOm8EG7nwP/NJZjIqEGv/ZiUCM +qtjmsAikBd1qi1Ep5SHCjpzAIrCdP475aUXdYOfx243pyQdxn2RnxEPlMLH5XbFhd2IMA76XkD PweaUWkvj0reRgrGEwZ+RyI5RXa2itjodUXCMA3lhfSRsJPS0FLUvQ0ob/MhhoI6h3Q== X-Gm-Gg: ASbGncuW71jJISPj4Bd7GbyyKJyweK0qEoxOB8rhnDOeqTeW3YsjgtV0KEdmN+lu3EC SWz497UxMwm+goQmda2d4ZCW9/B2ZEzMl6QdTL2IcjaSShQYReTJ7/73Vch4UKb1et47gD434Dq aha0DkL8OCBbebQTCmpko+Rs6fwFW3HV8SZJjGxjoy/+EWjx1cM1V0VQtyBNWUtMPOuNeaFtNPD YeezE4miBb/HTu9mPpRqFThZSNdeb0WzfTxo0npHqpst41sn25ZyMBTeSbq7uP2TiLrJleB/I42 srdxkp1+Kd2tIj/g6z75IVPXTsCLA/Djr+x5os6xy4uw7P02V+uKGwTqN2ue22EzZIl0w5kr0rd AzgU= X-Received: by 2002:a05:620a:c50:b0:7e8:1b64:2187 with SMTP id af79cd13be357-7e82c75f958mr1792739985a.33.1754909811727; Mon, 11 Aug 2025 03:56:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEK2Etk94d7jqWBuBTsPUBpC0ORVIn7oE21Xh8O9EOQgSk7vq5RIMLYWuxIl1Nwz+nt1Y38MA== X-Received: by 2002:a05:620a:c50:b0:7e8:1b64:2187 with SMTP id af79cd13be357-7e82c75f958mr1792735585a.33.1754909811152; Mon, 11 Aug 2025 03:56:51 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:50 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:12 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-8-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=1693; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=4SmOn45QQwwyMezbBb5tx+ffOCKNsfDDe6H8Sa9QRwg=; b=D6lQv4uU9BbCtmlsDXvXPLa8dR0h0DlOWWckbVaEkFndxlEt+IyMNkfDuSVR8NgDYOThGx2MA 72BwKh/6cLNDsrNiAlNie395a35C4+/kjwVpt/wftlDiaqzAFDkxkOV 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: Maxime Ripard Signed-off-by: Brian Masney --- 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.1 From nobody Sun Oct 5 01:52:38 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 D668C27875C for ; Mon, 11 Aug 2025 10:56:58 +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=1754909820; cv=none; b=mWd5tlNEVlQ2eWtwgOZ4baZcAtMJ2f9ovjG+ro2A8wltL9XnA3IrlyN4bZYBub1j7N5MiXJuC229LUBIYEzjgxL4d2iw03qj/CrCCjzGlYfyCD0pgqblQMUeEIfrc4d6JCW/E6HyDSvBBKeP13YspjNaQqSf09uwDkMocAV3CHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754909820; c=relaxed/simple; bh=y0KLkFzoWiBCsjyKHVyFf5yBXdH+nrgv9bMtrhIbLXo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VCxQIAA/K9uDRafuthf8e3zj/F3pcbKyWtNtymUWzyTSVC6PzCyn5fNw0OEZKDyHJe90+uWdr/wfqwCTPNy3WmMSN3yEZ+dOp6AAjRGDsjR0QoRTVjKY60icISJ2jhIpcTP38XkhsmVTkQwTDJt6/qHsMRa5bq87DrplbWLyqx0= 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=BH1brTqz; 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="BH1brTqz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754909818; 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=CR+LHOxQNJH4mrdkRrblEPU2A6Ou6dlR4qZMmeyZ4e8=; b=BH1brTqzguJfDbxIemXjvT3RlzqAgYCptrJt797t04nTVIU5hl9qsvIjg0/+d6u/cdjrzg GrT2rSZqNiivVjqRZIigTpPta3q+T+5e2FYeWajy4VOrI3QVhyjd/USLbbBieWUyiP1I0b SujHSzsW4KS2Wrfre2eWCfX8LNpjiHI= 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-137-8KCR8Nl3PrC46z-rDceuVA-1; Mon, 11 Aug 2025 06:56:57 -0400 X-MC-Unique: 8KCR8Nl3PrC46z-rDceuVA-1 X-Mimecast-MFC-AGG-ID: 8KCR8Nl3PrC46z-rDceuVA_1754909816 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7e69c14e992so834375785a.3 for ; Mon, 11 Aug 2025 03:56:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754909816; x=1755514616; 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=CR+LHOxQNJH4mrdkRrblEPU2A6Ou6dlR4qZMmeyZ4e8=; b=IWE2QMjUcHM/+quE682tJeU7h6Y+aZC8cZregxpaU0h50p3Glll8QCs81RaVVLJlCH allqVdPpMc5qqIiEftE5SfkVGOoA8XIcmh+OHHrsc9NajuLuJellJKU38MkEWrpIxatk IsDSP/RXERbQCUSPYh2POH5Imm5yb/mXfI7wEKEWTEDY0kFU5J3KKAOz+1z1N5Db/Hm0 k1YpSa7IlBRq+8oIsoJlPVJU9hTnzOieLD8Py1Zn+OBZj3yvGGf12es96RbY7joike++ fhzbTp0MGqOjGo8UKI2+OQyqLrvTy46loTXLGK2eA1qNqwroBfbbN4nUf0hFBkrjKaZx tjcQ== X-Forwarded-Encrypted: i=1; AJvYcCXuL1QHEofhB0zt7qV1CWhEJII45Z9kwVZDcvpqBiKEkGh/2rnYVxS+8va3CI1HYqAURxvF8fiP6duH5IE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx70eUOmZb32C6Fu6lEmKVwzo9C4GgI1hJLmfsFjZcmW5DW3vmB kgopwul+kbGyk7rcGkwt+EyBm7DKxGQiPv9I489WGNVX5Z3Rk9qPG1Q17CGbyDqbNdsQENNGzM7 9IUpsggDS6gJD20lM+zxoxCvnewEM59GDurIgT2z5sFaodt+NVoKIRfeUxznMYgJ+Ew== X-Gm-Gg: ASbGncss9AypdWuSArynFO+bo+y34YQm4UltxDftIBm9M4bSmF9i4kaDVHp+HpKVrvO llQr9LtO5yogHPq42A8QhBFyNxfuL2nkHWt0xMpmiXehCcaeSqOlsYZRbXNAe6tL0/r/637h0WJ nWRju+edn/P4jhUDsJs9peZBCgO2PyqevfySIcOKTAUD5Rj4EEZHRETVIJ0X9WylqFNK0M8hSN6 4kobYWy8gwCH066I2IL2epPV+eOim+olmixECL7ZmtQiLRPmExsARBVYY+jbX4C9y025rE5V5Q1 L28jLprEm7j4+5Y+HAD3Htf4oop17XuLWmmjWyP90vH6n9pDARC3HHji8IpQhQinB5dTqeHFTRw uAW0= X-Received: by 2002:a05:620a:1996:b0:7e8:54f7:67cd with SMTP id af79cd13be357-7e854f76862mr91495085a.50.1754909816404; Mon, 11 Aug 2025 03:56:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSii5P15b+af3L4E7F/cQGCM1Xz8KwmyfhCdGkZGKODW+eFh6Bky1dDzTK+GfwnJZiiMZJQQ== X-Received: by 2002:a05:620a:1996:b0:7e8:54f7:67cd with SMTP id af79cd13be357-7e854f76862mr91484185a.50.1754909814934; Mon, 11 Aug 2025 03:56:54 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 03:56:53 -0700 (PDT) From: Brian Masney Date: Mon, 11 Aug 2025 06:56:13 -0400 Subject: [PATCH v2 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: <20250811-drm-clk-round-rate-v2-9-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=2307; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=y0KLkFzoWiBCsjyKHVyFf5yBXdH+nrgv9bMtrhIbLXo=; b=j1ZnE8gcsk3YjO3zCEvUNiC5B3rrw/rsR6rCeLo5Q9BxZp8jvK69xEFMszvH1iDCwux2pSDHd eRkR0peMpaDCxDNa8Bi3chrL3Nda3ZZTmewCk0Eb5cefUz9pD7/Qw2Q 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: Maxime Ripard Signed-off-by: Brian Masney --- 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..4afb12bd5281f0d1720cfe2c8f7= 9b80d97244ef2 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.1