From patchwork Mon Aug 26 16:38:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778175 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A049194C69; Mon, 26 Aug 2024 16:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690296; cv=none; b=Kj0FCmDahldxJMJnJ3ip8mqfZQfXQWKPtEHjX03yOZxFocqKv0VG9fWR19MP7v/MNyHM7Y8X6K0nmK7QaiWkFa1PxYuvBZadzgh62hs/DwIEbk93nux08ISppEfaeFalsb0II8tD6whji/I3Y5+7+/E6V5ILPRJQ4HHI2h1TdaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690296; c=relaxed/simple; bh=z/anmOnVsGpNJHpaJn7B9xGUnXLvQ0PBCafTWMT0nIE=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=Wp2WQsDLOrNqw5ldgXpPym/qKBksTgbyhSR99tSYzT69XQGK1NuIQHQ9RBdW21CfddPblurtk69TxpQyV6Q8cQpzxk7eg5CvxDTc25mIcPFKNEMznWOzWExAFYE+ZUMA0JVjY3/y+ha553IcS0SFa9YXWUzXmVjU33SYNcN21gI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CIorsOZf; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CIorsOZf" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5bec4c3ace4so761362a12.3; Mon, 26 Aug 2024 09:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690293; x=1725295093; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=aDq9hlxq5SKiY7D4NwdJ+sg4GlIHm5Ue+KqwIBMJ4ck=; b=CIorsOZfAgwrHx/gUHU/gnrBZ2cjwwa+/G3Ak4YiSMpl7pALzBiTX68EelmjYI3UI9 1r98BUZqslqr2iSX1Tf4O85+g1JAFejBMUZPwi842omrRxGSwDOb/sISEUOzW8ZB4Ies XoNkBbutdmvqk4Kl24kmdym4peL+d9jKFrw8tfqiEzL4V4hiYHzBUW8sqCVXqkgLrlmY xGZLqt6NGXTgyzV2I0PhVinipzBlofF6roE8tlfEyo4m5xQ+Fm+uCfrVUZPwoU2Cg2Xq xrg7JTKsufmJyTp7ux2HsAlvEp6WBKML8ihCHuH+6HjGHMhrnId69Y45t+//7UxtSQ+h xDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690293; x=1725295093; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aDq9hlxq5SKiY7D4NwdJ+sg4GlIHm5Ue+KqwIBMJ4ck=; b=ZbR4ju92QO35/gye7zJNRvjSzfV3K+6YiecffHlQmFCSu/m9Dj8gEhECIfd7S9W5WM 1cyYFrKhr2xnYZJ88pzCkiBBZTSiDcQ3b0iA3ICicscYcIqkMW79gMbezKJQIZuQ2A2I F5LoGOfRkGag66BVze35g2A5+LdHD6qw4oPMrximC8AmmeHDOF1f8PtqFzwASuMrRnOj P2Y0C2DSMINv8h+bo8b9fWkMAJEj70Oe2Ht1AHKgXA15tsWhRpiw3VhD8JFXcToSP2M4 sVKsUfUhEpXC5brIAgLzH3OeADsCLj1tuQUw3xm9+YCCqrGb5AVa3c5av+AbCK6NXA2z HqFA== X-Forwarded-Encrypted: i=1; AJvYcCWuwdvlUFBeKMRcuoK4WY2oTiR5lHmfuaIASGu3MXNkMaa90EnPpzzO7ZSfQPtlnflpQrmK9uKee55X@vger.kernel.org, AJvYcCX6zZyh4+/0aDpUa/dVRO1axbxQR4NQyu4ztHbCxPm4Gah638WwB9A8eXqea1Y6sUHZyzfxDZspknqm@vger.kernel.org, AJvYcCXnDJaadUXI0v32dKoXwFtEw+d1QGo3I3534AFRNMrfOWQXhinpbeUR0EWh6ceYhuS46BMpFizV3ksQdRma@vger.kernel.org X-Gm-Message-State: AOJu0YwQnc9OruFTK5Ulv/blK7i9YyVooAVyDdGplBQJoOkdGVUBCMQF qMynt/0gmMa8slqwO7GqYKGZJFqurv1cYim8zkahzgqAPbzeGpEI X-Google-Smtp-Source: AGHT+IHLIDKav6SmXKB/LiGyu/BHEreiTXzj+YTCi5/nF4P/IeOMyHMupH0woRlDT69S6BqXYTtVag== X-Received: by 2002:a17:907:3da0:b0:a7a:acae:341b with SMTP id a640c23a62f3a-a86a550a4eemr453225566b.9.1724690293070; Mon, 26 Aug 2024 09:38:13 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f436bc7sm685795766b.116.2024.08.26.09.38.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:38:12 -0700 (PDT) Message-ID: <5ad12808-61f5-4e3b-801e-85231375b6a6@gmail.com> Date: Mon, 26 Aug 2024 18:38:12 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 1/9] clk: rockchip: px30: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-px30.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c index b58619eb412b..caf7c0e6e479 100644 --- a/drivers/clk/rockchip/clk-px30.c +++ b/drivers/clk/rockchip/clk-px30.c @@ -1002,6 +1002,7 @@ static const char *const px30_cru_critical_clocks[] __initconst = { static void __init px30_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -1010,7 +1011,9 @@ static void __init px30_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(px30_clk_branches, + ARRAY_SIZE(px30_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); @@ -1043,6 +1046,7 @@ CLK_OF_DECLARE(px30_cru, "rockchip,px30-cru", px30_clk_init); static void __init px30_pmu_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clkpmu_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -1051,7 +1055,9 @@ static void __init px30_pmu_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); + clkpmu_nr_clks = rockchip_clk_find_max_clk_id(px30_clk_pmu_branches, + ARRAY_SIZE(px30_clk_pmu_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clkpmu_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip pmu clk init failed\n", __func__); return; From patchwork Mon Aug 26 16:38:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778176 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67110191F78; Mon, 26 Aug 2024 16:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690310; cv=none; b=GRSU5FqkZljENxuzE313rvCmOU5FfS17/t69J89htfzJEnHZA0pDNsjHz+ZJeETbo52Xjxvz+iFohLnIDLBdD/a6jc3a+WvNl+iOzJPvRoOBXHBzipwt6DgeiNQ7DraOokZN+OyWsx5pyfOXFdhXDba7iJris7tcu7Om15QjFA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690310; c=relaxed/simple; bh=KldMEYNpuc1fUqRb0YPV/CoQkolzt3ozzhaQ3kQiz18=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=o+0WFG/dZpsFohsS/uHTvRqcKtwdIK9D+Kq30L4NDxz4rSYHOkIy6Yov/XhD/Ejt7/kho4CBhFE9+48sli242uCNeyJql8Uq+XazFbEBLKuW/x58rN7UQeOTnfcFfKY/KXb1yi6Lf/GsNhLQA2xKtmRIpy8ZshA2I99qkGjPmF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Au9b6wT7; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Au9b6wT7" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5beccb39961so713499a12.3; Mon, 26 Aug 2024 09:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690307; x=1725295107; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=yhq/9WJku/9EgEbho9+8mkKwaS95Mme88p8ubN0Cp18=; b=Au9b6wT7YtTQ191laYQF3AiEThKzfgBpHd251TJuRDgWc7eOD94kJ1RSF0Ehb+DiVR umzfdQD4qgj1NvIrQalnt583NIEqOCfKDA41XiDBiRs3SuLXyi7aT0uVlsuVis5/ZCUG bCHhZlfVrXLiGfFAdFDSNqpJeW5WWG0C7yzWpI78iditzQDehQmLtlFAUxR6/kCDHjMd b98u5HizYwQezSGdEQD92itiHxlDycdrh2/Q4WfKET5CS6WHxLrByjFaMc4qeTyO/nMJ GYZPqvcinRNnya3y0sLcemVgWOTdmWE3Ab2RIgYdJANxdocgTluKr8gXqGnFdbZ969Hp 0P1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690307; x=1725295107; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yhq/9WJku/9EgEbho9+8mkKwaS95Mme88p8ubN0Cp18=; b=bAuEqKu4GibvvdryXKEDvd21/3TdTG9QSsx2xvjix53l30GwBlsXXTXp59Vcx5o2xZ lvtQBVRmm3ciTTFWduVvxLGgDxOp0OFd1cAuYNmFM+5W2cCD8A3jtA/bHiAVZPjrEux2 BozKvM4dNe+59slP1DVpsg7nmwpF5sptikazhnEzSpG0Rebi8Bzx/jGW5fNJnOPxZvrE OW/ThLgLJ6f9ao1eeLdFXOKBGDlAtUwPC/p2E36bPuDAXZoR+HNOJI4ALPAcCPR/4t0u 7onQVNaeLWjL7lOo60RFJrLD0oOgGlyz1KqTh9xv8mBLbefzuJekFFGlK7KlpRYFVOMO J7LQ== X-Forwarded-Encrypted: i=1; AJvYcCUvok8/Dbou++kMQ9bJGgaKrTZFkNQaJEXJxTd7z8vzQRycQWmqZ6W73A1zDDnt2j7xU8xLiMlfHVbm@vger.kernel.org, AJvYcCWkgDX2VQCe7LdMToOTEieM4mRTGvB50UiKPiqWvgej/xqTLFsNLeCeOyAXnNVK5R+iDL53fork1J9PvRo/@vger.kernel.org, AJvYcCXjphZg9ioOgMAFxDGoSN3rz4TuGqlEDARvMKu6nGyvDSzABN8yhHxLhzzQnqJxUj36V4IoST8ZkqsL@vger.kernel.org X-Gm-Message-State: AOJu0Yz9l7NWiIyDBePkxER1ivB0EK20Jvy09FUKWwz/e4PnHeGSP2LH EgTp2z4v/SALr4SjT5oqugAEZio5wqqgor2YdMFXtanNt7Bwe3n0 X-Google-Smtp-Source: AGHT+IHJJKkoN0mudLhREuJFqK/RBwRijj8qeEa1gtLmFiRUc9gIA1e33tIg7ucKuVXcnXRqVW0BTA== X-Received: by 2002:a17:907:7d91:b0:a80:ed7a:c114 with SMTP id a640c23a62f3a-a86a4ea63cemr395278666b.0.1724690306550; Mon, 26 Aug 2024 09:38:26 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f4361c3sm682266466b.114.2024.08.26.09.38.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:38:26 -0700 (PDT) Message-ID: Date: Mon, 26 Aug 2024 18:38:25 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 2/9] clk: rockchip: rk3036: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3036.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3036.c b/drivers/clk/rockchip/clk-rk3036.c index d644bc155ec6..d341ce0708aa 100644 --- a/drivers/clk/rockchip/clk-rk3036.c +++ b/drivers/clk/rockchip/clk-rk3036.c @@ -436,6 +436,7 @@ static const char *const rk3036_critical_clocks[] __initconst = { static void __init rk3036_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; struct clk *clk; @@ -452,7 +453,9 @@ static void __init rk3036_clk_init(struct device_node *np) writel_relaxed(HIWORD_UPDATE(0x2, 0x3, 10), reg_base + RK2928_CLKSEL_CON(13)); - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3036_clk_branches, + ARRAY_SIZE(rk3036_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:38:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778177 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D54C2F870; Mon, 26 Aug 2024 16:38:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690324; cv=none; b=fP2XILAcWHK9gkJTtINN8H3+IixUYrTJ1ZjcOZWTuhGYZgojTKnidEnMIf48ucRdIpQmwCXhIWglmIpYc4aQdhTMgh8n4SC5CJi2pKJMyGCHBr6Ho00ZnqNWk1lCGSPkxqKG980HHYca64sln6u7BHuY8W5NRA+Dc+okfNeBcXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690324; c=relaxed/simple; bh=unU6Yo1ydDutqZQye9P93W1jBxzIgooTFj+TraDA7cw=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=H8aOlw2TbVGlIBgg0DID6JRCFRfYeXIo3AiLQp4idX+2FKvrj+Nzmka08kj/1W3NBPbVmqUb1ltAp+qWZVnTAge2VM4lgknkDOWdVIH9IbRDukXKR5R2756LkzveRi14mVblMaPxVqFZUNDcZ9fgUYmSME4CRkN3one+2n/c3OU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hc5oACqr; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hc5oACqr" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-533446e53b5so748138e87.1; Mon, 26 Aug 2024 09:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690320; x=1725295120; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=752Mrptz3EsbmUrr2Glsdy9heW92gw97tgRdBEx4Wo0=; b=Hc5oACqrvopAY2w2aV1k88njEzTiHlWGp9pGEyJoqSbGwAb+XDj5zqCwIXZxS7KDMG 9opjSnYXKqz9iXLS07rr5YHdwo2xZdRVG+TdMsYilw3dAOtYr9UZiLtQpJb92AKG0K7W hoAuVrHul+Ut4P1K4r/3ZBT1ECcSEKbGD2TU0m4k0gyWIKORH2n0eCNUhNdSnG7DI9mT LUdIPgU0ASPViFw+7JTsKAJlf3l8lZkMV5KfHApbUve3mMS3w1aYUsc73Hy3yudsRttd /Bnj2Nmlgduwv6Jmqxq6vzxlEjYbTzVayvaUcghOQN5vJvL7nSD505tvNldnbrlQdx5I vjVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690320; x=1725295120; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=752Mrptz3EsbmUrr2Glsdy9heW92gw97tgRdBEx4Wo0=; b=pkkMXjcHYD7MbXtuHM5DG6a7/HnKZQxPeM0Xo2gROWv94tVqqlUB4VkZMSb++EO32u rJCGwLTngg29ql+Tx6JuatNJZ95FofRCwpz+Ix+JSpX1DTGw/EUjkh0WWHGLnH+Bz/pp SG0ABlFQpQR4KH7MdlzJZOmn1vhcr4S0044Ahp2aXZZsaOGw32EKSEpILQgtcxaASknT KyTzW2uqt0DXk8ORMjNO6Ss0AM1OkcMJ9RXnQKtSeC8c+xpm8ZFv8uoJQa8GFPAqSYCv DrxNALN9om7AymlehVNDdGU2R8IullrTaSfhz7hJYiSokSGW/+iLT9imyHh9qHXZ6xL+ MS7w== X-Forwarded-Encrypted: i=1; AJvYcCUiuY+N7hmlPiHXT80CVTaLPjg2x08N7+v5GpSmgbhayXKxi0qQkLfXgm5mU6jn9PEwd9nlHEP+DHb3@vger.kernel.org, AJvYcCUk6BOotUghcQp9D7WvnAcBwwbr1Zd4xKG2t5f1kj8HPRpuyELrSnMJyp694o55+0kop9oO90yf2G3Crzm9@vger.kernel.org, AJvYcCVjz3vBKbR+h35KWgeJiEbrqOCd9i+8UDKzrb9pRiSELXo0DtWZ95D6RaqG/QpES5aIS1Jiyf/OfSuG@vger.kernel.org X-Gm-Message-State: AOJu0Yzcjf1sb31HBhNTkW76gO7lUDxhyomklFnQdzaRuW07w/+8SVA+ u2JikxMCv3uyXYf+q0eoCw96xQxhs8guNsMB5GKhdbk7zsX8/G41 X-Google-Smtp-Source: AGHT+IGc/UAzFSmVQIQ+Hglo1jjzZjGNfHpwVXB7AZL+IUlmod8yK3tbxu7FQIRBiL9BAjkK0n1CwA== X-Received: by 2002:a05:6512:b11:b0:533:dde:bf07 with SMTP id 2adb3069b0e04-534387be364mr5038397e87.5.1724690320147; Mon, 26 Aug 2024 09:38:40 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f484b29sm680320966b.162.2024.08.26.09.38.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:38:39 -0700 (PDT) Message-ID: <2ee6f0a5-a1bb-4b62-ae6b-8f3828f8eccc@gmail.com> Date: Mon, 26 Aug 2024 18:38:39 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 3/9] clk: rockchip: rk3228: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3228.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c index 7343d2d7676b..ed602c27b624 100644 --- a/drivers/clk/rockchip/clk-rk3228.c +++ b/drivers/clk/rockchip/clk-rk3228.c @@ -683,6 +683,7 @@ static const char *const rk3228_critical_clocks[] __initconst = { static void __init rk3228_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -691,7 +692,9 @@ static void __init rk3228_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3228_clk_branches, + ARRAY_SIZE(rk3228_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:38:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778178 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 391B62F870; Mon, 26 Aug 2024 16:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690335; cv=none; b=W2s4+vdwkCx4xktW+h4XnEiDvcADEyjwWnQjwEsUreZf7bfOEeQF8VeynekGrZYZHIQT32OcKdpVRhnAf2qeym2D5vLCz+PnU2sF6qhgOdOoBkZmws/cDft0arlbPXjcn0jH3b4dIqRgEOvbx9NtpglFsQ2uVsF6ViWXML3n2ZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690335; c=relaxed/simple; bh=wrmyHvHv2nyWcRmmlY5SaB6oRq7gHzJ3hZhhm8EeiLg=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=ptKlCK2ETeRp/ayRF0B9LpYY1EPqm/NllfwoBAND/XiWWEvZcFCpcywRZHhG8LmMXUAzBzA0ppvyjqeIpAbbResS3lgeh/9rkoZ1BqxuwB0kjrI1zEjy4fVjgwmC9t9p+bDXIB6Lqm/l1RMfWaD+G2HMaNOF8OKrX3vWClRz5q0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hBpgNaKz; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hBpgNaKz" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5bef259a71fso652241a12.1; Mon, 26 Aug 2024 09:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690332; x=1725295132; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=EZu/jBjd1Q70dpjtoHTLkvik+k0qgpVx09i6KQH3MDg=; b=hBpgNaKzhxfbJXALjb8sXQbGWSjPV8n9YzzhiarcEb+2f6vAiJrb8hguCbKXCZ4mnl E0i/YdGO+6ZOFPdN7IbaceA3AZKvvF4yJz+torQstC/ieiYcseSfbTwdcbvvW+HaTs5o rq4wVmNrON5b7L/rP6oRxrAbUBXNcEDuE/RgKR1AfimmjbPfeJ/bFHK4FSjgptyD0DFv KdBcq0i4tLk8Wy83LjbAriFgjoG1ikVhofAWZj/Yyr7lpTC//jp5v+mR7VZlSJYwWD3a FWg8r4TjYVPzqn45K2pv1r8wNjYTauPMjYU0ZEhB22H3VT1FZS1To0xa/w0t20wnx2v4 ODYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690332; x=1725295132; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EZu/jBjd1Q70dpjtoHTLkvik+k0qgpVx09i6KQH3MDg=; b=wgmkgE1zcyiHNUtAocq05jGr+B3l/jayezfk5N9/z3UPKaQP52mg6fSc936YyXb5hH P8+NAu+bk/Qs5CNKBTStC4lXD+noOD2hKnNwUqJDGOWeDKJD1UNd4K7f5epaXWLYTlbi /a+BdTKG/oQ+farJHsN9bx8/KeNGCznWVgIyZdQ7YVcFKe3mVtkqzPGDlJdaRzBqa6by /l+KqIMl65ybWaruqUnpmgT5h/yB6FW7AkGlTg2dHRHHiOSJ9KoYOMovhDUmAuO9D8vZ ZNgpdLSzqpdLUFYpFJfFIKcSLICPZlK375EAZ6j2TlHIwvZB74xGRO/q62UbdmKu2MBF iQ9A== X-Forwarded-Encrypted: i=1; AJvYcCVgKXmwwA/J4fv65u+06cdocUyPRs9EudPqXrqhyHvFwKpe2kIlVJc7qF2qbn9m/CTwH+MSHqyYR0RMim1/@vger.kernel.org, AJvYcCVo6T4TbyTEnB9wJLk+0ioOIzd7ZHV1wymGrR7z5IDB6Zo7EQAOJrPevylj8bjJ8+EpPaAElyv6S3FA@vger.kernel.org, AJvYcCW15XqY4/SoSV4LgneWVi2L1Rgyynq/bVlNLgeUU20gaRZaqgIwzBqEnfujmA4ch60S9YD5d2kn0tjw@vger.kernel.org X-Gm-Message-State: AOJu0YyPhCDum0xXXaHOrx6PbVP3zy//bhjktbkza/NOoN9SBzRbULAj vnZ8FUddQmH8Jsh+RKF0KnePeUvQQ9w7jxrH+QxjvXl2sIZNTNLp X-Google-Smtp-Source: AGHT+IF5/mm796lJvJrh2R57EkeRqBcf4GBAINfr26Gtc7NdeyL4EuQ0tSkGoqsTXngxQRCUC4zWNw== X-Received: by 2002:a17:907:9724:b0:a7a:9f0f:ab1b with SMTP id a640c23a62f3a-a86a54bb7e9mr373585766b.7.1724690332196; Mon, 26 Aug 2024 09:38:52 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f4363b5sm684267966b.133.2024.08.26.09.38.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:38:51 -0700 (PDT) Message-ID: Date: Mon, 26 Aug 2024 18:38:51 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 4/9] clk: rockchip: rk3288: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3288.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c index baa5aebd3277..90d329216064 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c @@ -932,6 +932,7 @@ static void __init rk3288_common_init(struct device_node *np, enum rk3288_variant soc) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; rk3288_cru_base = of_iomap(np, 0); if (!rk3288_cru_base) { @@ -939,7 +940,9 @@ static void __init rk3288_common_init(struct device_node *np, return; } - ctx = rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3288_clk_branches, + ARRAY_SIZE(rk3288_clk_branches)) + 1; + ctx = rockchip_clk_init(np, rk3288_cru_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(rk3288_cru_base); From patchwork Mon Aug 26 16:39:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778179 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0FC42F870; Mon, 26 Aug 2024 16:39:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690347; cv=none; b=sre0gCN0VMgxsqXyy31YXrn6tW9xQOf98D3RHp8qG08Bxvjx6MRDgMAFrOZlTi35L1eBCpegT0B37XoPFT2iq1oPhwjiWqrqsSGkT5XjNWRagQqRFKUtH0F+tlAlN7gIoE6mVgpTvTiPoaWDQjiqYJ9j0NJ9bIoYEAswt3JQ9OA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690347; c=relaxed/simple; bh=PEZnnBeiNVt3GdRDl4q/XrzlNfMfIl5dQkddY50cuY4=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=QoqS4wuJfvyYDQGCrNXaln2IT++N6A0zecIfMFCDnJrYT8mgDEMtm0PjEbecKK8XkYBVmWvjDPfMQSYKgJxwqUbkunRBoh6KrcjF9yYkSEaIO+ZuCDcW3vO2Ke6YIPAozBZ9/TMm3q/k5uUIepCs9m1Lmt0uNHCjxc31os8neqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GVnrGYls; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GVnrGYls" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-53345fe848eso1019518e87.2; Mon, 26 Aug 2024 09:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690344; x=1725295144; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=0pQNjRvPbGFwIbtiuAF6ctUFukzjUNsN4+HfbcLCR3o=; b=GVnrGYlsv4MUaluU1+/GpHZVpMgEOZNYW88/ss3dvWnDK3w3RasaFOh7tMtxR3HPca t/nRD24olpCAJYiXQsgG5liqDxa3I03WB7W7sz3eRWAGe6FGG01/10+khjLV5emCsS3M 1n406Lg89AHVJfjdWPukHEAQMPfMWP8ygNN/4DyfShhOEmsrhwewitoNORBMwew/Nwf0 ilHEXf2pBS0RdRcabsNVTETruE0W/M6cGJAyijj1MH1LnT3LmxU5Trc7tDtJo1UTUsCX uCKRZ9WnpX/AHtGQLXOjTES9bANHSywOyAG5iSQ8b24epjCL+xgdGk1dF5VUIoSNO2g9 lyyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690344; x=1725295144; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0pQNjRvPbGFwIbtiuAF6ctUFukzjUNsN4+HfbcLCR3o=; b=RQKkBSJ8LWRqFqe10VmTAtgwQY1snx8Gz4lMFK9yHlJghLZ5pvaQuBDMMLCVA4/9Dn Hj1J0cfGIJyaB79B3zr+ru1mzHvBML2LlMOGdZouJWHtNa73f76m6f8xBZkzQdNylwgB odZdyClB7I01iidKx8QM34XAir7ufNSC4KHFbaHAz3TX1F+IBmx+/ls5juzNDzzg97UL NqSr+h0r4HM4dqnR1OBvKU4VD6JBmwykuozgGvyHY5ax7qF3Xc+WGEYvukmO7lL964ro QU0BVdZFPykiKJ2NkzAheyrr7mv1YIbLEwzx1qn9I9a6qS9XTVRuF//EGaQtsfRQdXJg OgEg== X-Forwarded-Encrypted: i=1; AJvYcCVBu5IiEhgUc6tegKbydk3SB4RuFvclSFHX1HGiXxs/b83Bd9AX4f2YfvcouSF88H+QJ43ZHDSJ6WOj@vger.kernel.org, AJvYcCVL2ZbX3/w1NhCAMxTrLMNtaI5Jb7oJwZes2BaSAJcM5KJJEX4RSW8lxZEJnkmicGOlq7vXgjaP3b6P@vger.kernel.org, AJvYcCXeltbWjG2/3xr8t/dlE1gmRR1DFwvXsQnJ+xZszIsqCbIQ25nryxMI0ddienVF3WZ8ClAFMZ0aH/DILFxX@vger.kernel.org X-Gm-Message-State: AOJu0Yypr60gSzIEMoyhJm8sJdvtR3SmRlSjQbyYtTc1a+pSm+OL/SjD kLOKGbYWYFWcODO098iQg88N8xqtVkF+0iy3c+WcppsQwgqhegA+ X-Google-Smtp-Source: AGHT+IEM7G/1hSJu1S8jVW53HPtYBrabXkywCD2sERfCFLDL6cK0F7718zBUberYt362t0n/nsDo3A== X-Received: by 2002:a05:6512:1592:b0:52f:c142:6530 with SMTP id 2adb3069b0e04-534387c4976mr3999893e87.6.1724690343597; Mon, 26 Aug 2024 09:39:03 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f484b51sm696457466b.146.2024.08.26.09.39.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:39:03 -0700 (PDT) Message-ID: <9fbca2d8-f904-4913-ba05-8715e748a454@gmail.com> Date: Mon, 26 Aug 2024 18:39:02 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 5/9] clk: rockchip: rk3308: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3308.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3308.c b/drivers/clk/rockchip/clk-rk3308.c index db3396c3e6e9..95a9512a41a3 100644 --- a/drivers/clk/rockchip/clk-rk3308.c +++ b/drivers/clk/rockchip/clk-rk3308.c @@ -917,6 +917,7 @@ static const char *const rk3308_critical_clocks[] __initconst = { static void __init rk3308_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -925,7 +926,9 @@ static void __init rk3308_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3308_clk_branches, + ARRAY_SIZE(rk3308_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778180 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 608682F870; Mon, 26 Aug 2024 16:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690358; cv=none; b=MB2xndnqjHMHB31JLDUfoi1/eDIHrS831u6OdAsiA2DumAWHlLOj4wVokEVAdfPxJPNODqw5Yn3K/suh0gxeX3it9PIcbPajCXOf7/r2Za0WY94koowsaFdX64FlSxUtJ9NFN6nZnK8ENOXnXUTgB6lIUkUUJXntc9ZWmp0pkQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690358; c=relaxed/simple; bh=paO1IvGljZA9aHYuoMtlHqMiQEvGSGHGysSKkSAx6bU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=mWdNotnASVHh9G5ZgPMzzNz/AF5GY0jSFwxSW7SUuFfDTiXpGGVKdXHYqZ2X8T93wh+RB3WvFw3zwNW+LJX8vPpCbCcc907pGI5ZF2AgwZRaMgZRPHoOe3CsF9tI500tYDF6dY3Oi/0at5USn2chfevhVyPiLDZH28iKjfar+yw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=drN+7WB5; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="drN+7WB5" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5bec831d77eso652144a12.0; Mon, 26 Aug 2024 09:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690355; x=1725295155; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=tOSmg+U9ko9Cd03A5hlrj+MTA2zfydTPh5GQ0xhJtAk=; b=drN+7WB54cBA0YRCyhM0/Q1r9kvfA6p/s2qAU1W+01j1SR9c+kmhLQSwuG+J3DCXYX VLvFj8psnEDW6JmJrwwfDdEOU1SSMxUs7yd8LiixUdctNO4vD1Hvnd3/W6yAn0dX/3AL YaKHMd8mXedZRjqe7muxiatRX9ftSDxv3VA8jCQTkeYP7RlQ/qijpVeogMrrqJwBDUjR CHbVnGsp3rwrzH8mg/AvmhnAQxQEEHlYxFab0YPIRng3L4MFd8yYaiCGmr8nl/i57Rfh DA4OYP4Dzd5PtQXshjTRNvIen288PpWXI+WgigISu3/jrEHzi0n8x71z2OcJTgWBRR0L 43AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690355; x=1725295155; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tOSmg+U9ko9Cd03A5hlrj+MTA2zfydTPh5GQ0xhJtAk=; b=GfmHrxT+LLUBVzXEwCFU1rbCD1I1GUsHj1v7bVtPxrYLjm+eyfLtWXncxViof8q3Ji f9/ffK1ywhFhRKIpg9DDRG++KwTcYk95L5deU3GUDaCvVk/nZv0XPVJDez+KpQBwnJGT 6dd3lsBnVTtHstoVd/fVoiuWXEDxSkVEokshXFG7h1XkSFfZ1xDhrMBzClrwDCFOpCCs DX7j+s68DmgJ0ju1bn+fDpkVE+rBlzJUEAaUeWJtoL6YaBuZfWxlGs4ui/X+PWLX1vTj l3GgR3X17djiQKpU/CDLQ8Qp3Q4lohMrcixqAm5Tf++p1v1RsJoT+9/mMQ6MkuHaGdU1 qlMQ== X-Forwarded-Encrypted: i=1; AJvYcCVfQnFbtQqKRpc1oNTEAetXGY5XBxzc9ZlNBpRBKu36F1nwOjsFEzvmwrVp3vXyrHKs1ssA3wIB7qxQ@vger.kernel.org, AJvYcCWlLjG6xQ5XKk3qj5KRZLwzL/4H4c5U/S0kk154HDL7lOB4KVyrsiOxNIHfIIF5IMVApSASZhV2f6AZwiSJ@vger.kernel.org, AJvYcCWvqM9ldsXCBn93B40To30IpERhB/0cKkxfodcffzPD+vtpj6OmzE+CJHObj2uLe3WYaEV7YWVCXPHf@vger.kernel.org X-Gm-Message-State: AOJu0YyxHrEgiiqKHY7hymezXce/EztoW4B0TUkG/A+2DYLhqroEwp7O uXEbDZapAzzTXa+t3PG4hn3LhF8wq0/esJFJrw/A/6zPKvYcwkg8 X-Google-Smtp-Source: AGHT+IG1NTXW7GOuJLnWfkEVMy5ehfNd0YoEsMP2KyOoOKtU5dmeMYDV86OyxSCX9fEeyld4pF2lcQ== X-Received: by 2002:a05:6402:4307:b0:5be:9bc5:f698 with SMTP id 4fb4d7f45d1cf-5c08910dbdemr4226209a12.0.1724690354491; Mon, 26 Aug 2024 09:39:14 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c0515a961esm5781754a12.83.2024.08.26.09.39.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:39:14 -0700 (PDT) Message-ID: <38ea6be0-3596-49ec-8de9-aef9c7f2bbb6@gmail.com> Date: Mon, 26 Aug 2024 18:39:13 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 6/9] clk: rockchip: rk3328: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3328.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c index 267ab54937d3..3bb87b27b662 100644 --- a/drivers/clk/rockchip/clk-rk3328.c +++ b/drivers/clk/rockchip/clk-rk3328.c @@ -881,6 +881,7 @@ static const char *const rk3328_critical_clocks[] __initconst = { static void __init rk3328_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -889,7 +890,9 @@ static void __init rk3328_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3328_clk_branches, + ARRAY_SIZE(rk3328_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778181 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96FBB1991C8; Mon, 26 Aug 2024 16:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690370; cv=none; b=JaAiSJE9DvUP74wLEhlCt8nErVd7+S4ofgP9gME+Yrr5/0iZhx+CPfM95y3R4bIff91d/KGrzPSPrytwQvWGtWkuN40rHef6w7qG/XLkCwT0K+2tTyblrKdEdKcUbnn4zy2E9FZNKr76I1yUFL4mmOvTfdK46DI9cpVKUhXhv2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690370; c=relaxed/simple; bh=m0hxTzUnctUabw93oQO8xh0FVMtNJj7oRl3IZXmIAzQ=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=QY7LK02hXlSI4OE/boPVh3kb0AvCm/c+jNxDdcfneo/lQ/+lLD1UjrGGN5PeUxMVQpTmYznAlxVFoW1RMq5w29gD87ET4BTtPqJ9lNvGCV/Rq3qaDL7OR6ajkRG+Ew4+Ai333z+P4VGGG7OzutKAMWWQxcYzsl4L4SMB5iElqpA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aK8xZiPb; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aK8xZiPb" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5334eec7485so832505e87.3; Mon, 26 Aug 2024 09:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690367; x=1725295167; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=+i2AlGYsoxr4BsaWm8n7FjsczEQSUj3cbbi624qx9q0=; b=aK8xZiPbpQvduItmIP9VzrO4pTkSYAQIT/cqiCUMyrPsqjwEZQr2hhtM0ptOUuV8o5 alDtq6eINAcT88z6+rnwNfqnVl6/K9eMA45x1MDPSm8RWP/14C5ssPjYdBEFWHB9Jj0U C9gAYWCu/LPfT8H1gZTCvCq94wRk5ZiiLWeOILqhSWzNTotHnNNWFPXllbhaDJ0i594N pG3RlTzDBhD3qp57OYL3Z1H/rx1xOXKEqLZDSG1Q+wC7ZFCGo1y8yJPRzonry8m5RMVD q9aURZ2BbDkWp22zFNB34xpst6mLi6X9BithiNhOUZV0yUMHG84r+LR31ENoqbItTN+K 0Okw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690367; x=1725295167; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+i2AlGYsoxr4BsaWm8n7FjsczEQSUj3cbbi624qx9q0=; b=MGPDxnilVFGjHrUj873VfF33wLxWfLS+2vWbyRm4jhUlwdJXh9hyJ6sbBvAuRhAXTX iq7FYgsUIqXYc/PtXqnV6C83IJH5wOxRd0Gi9ayTBUqJwLn245ianm3Gx75/oHJkXTSv BEYh7r6IXYYGkUjVRapu4/12W7fPNQrJf9ltZk7/kiKQxiYG5X2ebmymbEnRjYbCRcul /B4sA0K+FPvfQPypy4Jmpxy7oZ3NtjwUnQmJMlW7V+dLQMFPi/xA+ilvM8FCwRBUlWtj 8TgEz6O3wMCBcHycrT869KetxBg6HUK8TH3jghxOK6FUVZYg2NQiVv1TQfwn96/bUcs6 rh0Q== X-Forwarded-Encrypted: i=1; AJvYcCVLI+0aorlsOl0Jfd1ZgCODBEJX8EPGj4cGh2onNLPeWUkahccNtR7hbdrRCRVGFjXlkZQjTCsgs0ix@vger.kernel.org, AJvYcCVWyCUPRdCAUGKQm1K+VQl/2XzRQBm4PV018Gs9BJlAXx6SdBDB7VVIqYeOpO3oZzFNQ28NDE+NZdrd@vger.kernel.org, AJvYcCWR00kOWCcNBkgw9qgXajREligocOh6yAR1ghbH0/85IOUim5Ld2kL/yZIDcrL7xXXLCs/liGOyEVEsR3XP@vger.kernel.org X-Gm-Message-State: AOJu0YyB2zKtKR6e8bfjtI8yrpY39C93evoBA5UUVmIGCnb5McjROakd q9m/dr+CkNViLDz5xFDdqUZIJUVIIrLDQ56wQgYSoh4ZydwIuceua+N65A== X-Google-Smtp-Source: AGHT+IFlY9yEz9cwzKGmpwql9VSj73wxFguXPTKKyguV45o2cj0X7EvoITq5F+dR8W084K0HOgqukA== X-Received: by 2002:a2e:bea3:0:b0:2f0:29e7:4dc2 with SMTP id 38308e7fff4ca-2f4f4944d49mr48761801fa.5.1724690366281; Mon, 26 Aug 2024 09:39:26 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c04a3cb0b2sm6101451a12.22.2024.08.26.09.39.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:39:25 -0700 (PDT) Message-ID: <2a19c3cc-5f4d-4d03-90b2-e0bb13b0502f@gmail.com> Date: Mon, 26 Aug 2024 18:39:25 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 7/9] clk: rockchip: rk3368: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3368.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c index 2c50cc2cc6db..04391e4e2874 100644 --- a/drivers/clk/rockchip/clk-rk3368.c +++ b/drivers/clk/rockchip/clk-rk3368.c @@ -866,6 +866,7 @@ static const char *const rk3368_critical_clocks[] __initconst = { static void __init rk3368_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -874,7 +875,9 @@ static void __init rk3368_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3368_clk_branches, + ARRAY_SIZE(rk3368_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778182 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA7E3194C71; Mon, 26 Aug 2024 16:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690380; cv=none; b=mv4Hm0GGG/iZSkXpWVdsvE3NvP4WrMK8gq0/fBcFOs3N1ZqkWaLli1dLM4t9PG2nYiTKk0FN+NDXNonhgzBuguXUgIlS3C5JzBDhsWBH968nSP7JLvv7hlQIcm4Ht6aFusoTLlDQK7Gu3iC1rsxYCCNi2UeAlBK45EGtbloEmUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690380; c=relaxed/simple; bh=PU1oYZO2QUCbnR03v7Saw0Q95PWuMfc5sU43sLrvbmo=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=dcVf1V7u2j5wxKSPpPpPeqUmHpz8vWeDcbk5/9NzS6rlSoPoxu8J1YwumI+3Fs0egpt3Y9cI8iYNUf1UTWkVt0q3sMTx1KRhdS89qeVmd/DJleQVM31UUd0gu83EeLAh9L0WcTLkMesIpCH/SWmrUireKCnQ5aAButFwJsORcr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OKYHC2yS; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OKYHC2yS" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a866902708fso23035966b.2; Mon, 26 Aug 2024 09:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690377; x=1725295177; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=FLEI1Cb2UP4A1vC0h0p4/XVr36pqAHZWOGV9GNwqygk=; b=OKYHC2ySwBaF+9W0LIfOTBfV2sCRRA0cVCtN9ocrsI/nalDreX6zqKcnzRf+YBDzaJ pzZxCm42rk2wPmW3HqMkJviUtJ224dlTvCoii0yh9/OzuVsiiBRytAV6C2lPbYNav6Hs hqDEMf5acFFT0mduzDs+vzyXqtBlvLyKJRxBu4bwo9tR5we10LooqI3HR7wgPx17VQtw JYHKBEm3Bnz2AELDDyjLvl7A7jLDuoJcySjKi7N8JZNSfXPbIj6PFx1MYOsCOAJfmGGH vy6eKnwaWvkYECxwqzHFeJBNLyV4YmZQ8pHnB8h9wW4QRtTC48/ot6uxPRIG4TwWRfSa 1cig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690377; x=1725295177; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FLEI1Cb2UP4A1vC0h0p4/XVr36pqAHZWOGV9GNwqygk=; b=nIOSSoXPtzpcIDOwbwPh1CwyE6aDLFoJZL+sHulgpBfwanX8boFaeYl/4qMCHgxT03 Xt55coMk/ZY5yrGWQzoEvIGKLBeerUb0nG1E9Z7TE21QrkXTEtMTePbdTjWkxavdQLk1 F+jUYhLxHkDL2AZ+ilLUSz3YFz+vhKQ9bWTOEgaEHJCe9/Dt00gh88DuVWptpw22ajxs XouPFtHB3RUvSvBCZ9hA6M7/flVBCmU+q9scIZqjAT4k5C2XLlWCxdLojrg5/D+fbYgr NO7Lmbp47EVdOtQS4+RCeVIh9ET/Fv5PymKryp86BxitJluOId/efB3sE10XcFqicz8l 3c7g== X-Forwarded-Encrypted: i=1; AJvYcCUZEXmyFjIaqssyZDc8dka7nHIwdiWRaadDDUPT63r1cwrUMBEaLS9j6GCUtkTW1vjH4SYsvIGcH4uo@vger.kernel.org, AJvYcCUaJ9N5xxrTKhKEBE30r7z5CqZcuKmetqKTrnlTHpN/Ka4JKfhKvxArZ8E7MvBsFhQ3rv3ZFS7i2+NJQhy4@vger.kernel.org, AJvYcCX7gjg9t9tFwffe6hKqNZOUyr793Wxm1LB1TYyaCF9JyE+qJIjVn550jpkpJToa01hPNJaCpxklDGTg@vger.kernel.org X-Gm-Message-State: AOJu0YxLFGaNiQ5MXsxVhIcJoriN6jrxJQIWrUM/xVRyoUTGfXC3EDn7 BcuoJ0/pDEu/9JOURPMqcHt7RVuimazPnlAH166gX/AkRsyT9J/EZLgH9w== X-Google-Smtp-Source: AGHT+IHL+FuBwtBkHSQziYl5NkPCUp/kCmo45U6Hon3dXAoeItbf4Y2lDeqQXqnhrhLcmTgJXrrRqQ== X-Received: by 2002:a17:907:7e9a:b0:a7a:b895:6571 with SMTP id a640c23a62f3a-a86a550b68dmr508411966b.9.1724690377077; Mon, 26 Aug 2024 09:39:37 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f220cfesm685727266b.1.2024.08.26.09.39.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:39:36 -0700 (PDT) Message-ID: <45f83b1f-64f8-4ea5-bc93-ebf7507a9709@gmail.com> Date: Mon, 26 Aug 2024 18:39:36 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 8/9] clk: rockchip: rk3399: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> In order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3399.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.39.2 diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c index 4f1a5782c230..c2b243d7a5e2 100644 --- a/drivers/clk/rockchip/clk-rk3399.c +++ b/drivers/clk/rockchip/clk-rk3399.c @@ -1531,6 +1531,7 @@ static const char *const rk3399_pmucru_critical_clocks[] __initconst = { static void __init rk3399_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -1539,7 +1540,9 @@ static void __init rk3399_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3399_clk_branches, + ARRAY_SIZE(rk3399_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); @@ -1577,6 +1580,7 @@ CLK_OF_DECLARE(rk3399_cru, "rockchip,rk3399-cru", rk3399_clk_init); static void __init rk3399_pmu_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long clkpmu_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -1585,7 +1589,9 @@ static void __init rk3399_pmu_clk_init(struct device_node *np) return; } - ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); + clkpmu_nr_clks = rockchip_clk_find_max_clk_id(rk3399_clk_pmu_branches, + ARRAY_SIZE(rk3399_clk_pmu_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, clkpmu_nr_clks); if (IS_ERR(ctx)) { pr_err("%s: rockchip pmu clk init failed\n", __func__); iounmap(reg_base); From patchwork Mon Aug 26 16:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13778183 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7424D19539F; Mon, 26 Aug 2024 16:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690391; cv=none; b=GoSljom0Cq1Tc/JreYq6KFvQYMAjBHWw2ske0PaGX7uTPugFlTmzocxBapZNMZLxnl50xft9+5CTM3KPu/V3A3tOMMFmuizRCQguxUW0Xite4Av229A+AG8rQ6zpmAHSiHij3KgasYfMWDwNWLQvdalNE433AG+RFzrlIW5GY54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724690391; c=relaxed/simple; bh=amzFsueMAjB/dtxA5/mHMWLcbBcsme8w4wvLbIqwftA=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=DmAJnWhb3W8hU4PTWyMEig9VfuMlHj8XnNv4Fi+PMQzDr6kojlJEVkmP2BXJZ19ucOGTig7Spk5iD5lHWJ1OfzEd1cYS8fpI4cgUfcJO+3Uqi+W+yrCvbt8hXPa5bz/q4YhXztZLv462Lt64SJHbt1C5nK7mg0mX2QihyNNqVZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Fb3NRPUb; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Fb3NRPUb" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a86a69bfcdaso14438566b.0; Mon, 26 Aug 2024 09:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724690388; x=1725295188; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=xEBnzy+nuAfpfauBPCGu34CbakxHPVG1Dzjy87tNiYM=; b=Fb3NRPUbFYjTtS70SS9XVKjEXOwe1asf8461Nkn4NJJOimO/P1sHl8/RkmeuoprPzy mZXjb/dK152vxvDYdLyaXp/1s2V0j2g09FifUbnm8CtDzun4D+GLJi4S4bUsCjL5UCil v8Ntjp11w45MQw+Ko08kMjfJGC0tHDBEIx9NgmOHbYK0NNWxjO37DxwP7fHBdkMJG2oV COaGLi1IMZ76JUTZWYUG1nF1Yp7NaOGW9EuYG4IpiqqcazBUeXcwAELla3ll1Nu2VMz9 OD2VHATQyrcW0DZ4QKbWSFl4+oFGlctkB7OGsL0BZaqRKkrM7tpFpL4fjDUuSEgWsSWV N9wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724690388; x=1725295188; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xEBnzy+nuAfpfauBPCGu34CbakxHPVG1Dzjy87tNiYM=; b=lP7vWRQshjDT0veYXQNZ3lofAZ5noU7f/Pqd8i936sWknYOM0UMdmKq2Sxl1y0IA55 r7fPib31ndD4jy9OWgilmx9UEVDlXLPyPpLY25wVPlOu2iLZZZXWO5ao2q6H1p0YBoz0 w+GflRWZ0mYYS+wGG84qiJzcr1XrBC3gVhcYk0F7dKCI4R8zwRciP5JC7bcMyMJKsJ20 nKfW43Zqb+maq0RnsJmXBmu0Udd5Taw6q/ldRAb9/FbWnpuM+SjX7yJF1Kn3jY7errux CX9Z5CwSaO/YvFszNR0/9Q/iQcAEPatzNpl1TvhXoIUX2L5drfSBPowN1oco2FNAx5/c vUNw== X-Forwarded-Encrypted: i=1; AJvYcCU50YbFn+cqP2o9DqdbsrKU4p1E/sZaC0/vauNCADQeyLJiul4eOYJoq34+ulOUesFuWk/3pdZPOQxcZfM+@vger.kernel.org, AJvYcCWVsr7DA5AErMLrPu01ZESYns7ytQDijYCxtHwDQo3C2MOt4LqY4CEjHSwuIIKfyyK/KqLE2lIQJgdS@vger.kernel.org, AJvYcCWWdkdDR9E+hyn/9UHJ0L6AKwOj2hySCl08aYJFtkvvlaUSOZYWnH5ZcUWUdnJWgoa0e6vU4LBWJpe1@vger.kernel.org X-Gm-Message-State: AOJu0Yz9/ewpfxuVX12AoE0j5yP3dNjD80dYwjTObdNXbTOf6hETAcPh D+onPmdpLfN7VosABrCe6fYWtlg4CVvrbzkyAOVuPk5P0L/92qpx X-Google-Smtp-Source: AGHT+IHbARgAmNxg4Cbi+E0/YnVBks6tDcx14l7inz4Q0CkixJluT8YVLmjj50b/VKagIKSP8C8PsA== X-Received: by 2002:a17:907:7e95:b0:a80:a193:a509 with SMTP id a640c23a62f3a-a86a5188f38mr526531166b.2.1724690387597; Mon, 26 Aug 2024 09:39:47 -0700 (PDT) Received: from ?IPV6:2a02:a449:4071:1:32d0:42ff:fe10:6983? ([2a02:a449:4071:1:32d0:42ff:fe10:6983]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f47bedcsm695577866b.145.2024.08.26.09.39.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2024 09:39:47 -0700 (PDT) Message-ID: Date: Mon, 26 Aug 2024 18:39:46 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Johan Jonker Subject: [PATCH v1 9/9] dt-bindings: clock: rockchip: remove CLK_NR_CLKS and CLKPMU_NR_CLKS To: heiko@sntech.de Cc: robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> Content-Language: en-US In-Reply-To: <416cdaf2-fef2-471d-a03a-837775d6e7dc@gmail.com> CLK_NR_CLKS and CLKPMU_NR_CLKS should not be part of the binding. Remove since the kernel code no longer uses it. Signed-off-by: Johan Jonker Acked-by: Conor Dooley --- include/dt-bindings/clock/px30-cru.h | 4 ---- include/dt-bindings/clock/rk3036-cru.h | 2 -- include/dt-bindings/clock/rk3228-cru.h | 2 -- include/dt-bindings/clock/rk3288-cru.h | 2 -- include/dt-bindings/clock/rk3308-cru.h | 2 -- include/dt-bindings/clock/rk3328-cru.h | 2 -- include/dt-bindings/clock/rk3368-cru.h | 2 -- include/dt-bindings/clock/rk3399-cru.h | 4 ---- 8 files changed, 20 deletions(-) -- 2.39.2 diff --git a/include/dt-bindings/clock/px30-cru.h b/include/dt-bindings/clock/px30-cru.h index 5b1416fcde6f..a2abf1995c34 100644 --- a/include/dt-bindings/clock/px30-cru.h +++ b/include/dt-bindings/clock/px30-cru.h @@ -175,8 +175,6 @@ #define PCLK_CIF 352 #define PCLK_OTP_PHY 353 -#define CLK_NR_CLKS (PCLK_OTP_PHY + 1) - /* pmu-clocks indices */ #define PLL_GPLL 1 @@ -195,8 +193,6 @@ #define PCLK_GPIO0_PMU 20 #define PCLK_UART0_PMU 21 -#define CLKPMU_NR_CLKS (PCLK_UART0_PMU + 1) - /* soft-reset indices */ #define SRST_CORE0_PO 0 #define SRST_CORE1_PO 1 diff --git a/include/dt-bindings/clock/rk3036-cru.h b/include/dt-bindings/clock/rk3036-cru.h index a96a9870ad59..99cc617e1e54 100644 --- a/include/dt-bindings/clock/rk3036-cru.h +++ b/include/dt-bindings/clock/rk3036-cru.h @@ -94,8 +94,6 @@ #define HCLK_CPU 477 #define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) - /* soft-reset indices */ #define SRST_CORE0 0 #define SRST_CORE1 1 diff --git a/include/dt-bindings/clock/rk3228-cru.h b/include/dt-bindings/clock/rk3228-cru.h index de550ea56eeb..138b6ce514dd 100644 --- a/include/dt-bindings/clock/rk3228-cru.h +++ b/include/dt-bindings/clock/rk3228-cru.h @@ -146,8 +146,6 @@ #define HCLK_S_CRYPTO 477 #define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) - /* soft-reset indices */ #define SRST_CORE0_PO 0 #define SRST_CORE1_PO 1 diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h index 33819acbfc56..c6034b01b050 100644 --- a/include/dt-bindings/clock/rk3288-cru.h +++ b/include/dt-bindings/clock/rk3288-cru.h @@ -195,8 +195,6 @@ #define HCLK_CPU 477 #define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) - /* soft-reset indices */ #define SRST_CORE0 0 #define SRST_CORE1 1 diff --git a/include/dt-bindings/clock/rk3308-cru.h b/include/dt-bindings/clock/rk3308-cru.h index d97840f9ee2e..ce4cd72b9d3d 100644 --- a/include/dt-bindings/clock/rk3308-cru.h +++ b/include/dt-bindings/clock/rk3308-cru.h @@ -212,8 +212,6 @@ #define PCLK_CAN 233 #define PCLK_OWIRE 234 -#define CLK_NR_CLKS (PCLK_OWIRE + 1) - /* soft-reset indices */ /* cru_softrst_con0 */ diff --git a/include/dt-bindings/clock/rk3328-cru.h b/include/dt-bindings/clock/rk3328-cru.h index 555b4ff660ae..8885a2e98c65 100644 --- a/include/dt-bindings/clock/rk3328-cru.h +++ b/include/dt-bindings/clock/rk3328-cru.h @@ -201,8 +201,6 @@ #define HCLK_RGA 340 #define HCLK_HDCP 341 -#define CLK_NR_CLKS (HCLK_HDCP + 1) - /* soft-reset indices */ #define SRST_CORE0_PO 0 #define SRST_CORE1_PO 1 diff --git a/include/dt-bindings/clock/rk3368-cru.h b/include/dt-bindings/clock/rk3368-cru.h index 83c72a163fd3..ebae3cbf8192 100644 --- a/include/dt-bindings/clock/rk3368-cru.h +++ b/include/dt-bindings/clock/rk3368-cru.h @@ -182,8 +182,6 @@ #define HCLK_BUS 477 #define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) - /* soft-reset indices */ #define SRST_CORE_B0 0 #define SRST_CORE_B1 1 diff --git a/include/dt-bindings/clock/rk3399-cru.h b/include/dt-bindings/clock/rk3399-cru.h index 39169d94a44e..4c90c7703a83 100644 --- a/include/dt-bindings/clock/rk3399-cru.h +++ b/include/dt-bindings/clock/rk3399-cru.h @@ -335,8 +335,6 @@ #define HCLK_SDIO_NOC 495 #define HCLK_SDIOAUDIO_NOC 496 -#define CLK_NR_CLKS (HCLK_SDIOAUDIO_NOC + 1) - /* pmu-clocks indices */ #define PLL_PPLL 1 @@ -378,8 +376,6 @@ #define PCLK_INTR_ARB_PMU 49 #define HCLK_NOC_PMU 50 -#define CLKPMU_NR_CLKS (HCLK_NOC_PMU + 1) - /* soft-reset indices */ /* cru_softrst_con0 */