From patchwork Tue Aug 8 08:27:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13345836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E7BEC001DB for ; Tue, 8 Aug 2023 08:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bAVmjYQNzgxyW2W8mqncczdFqC6OzbB0hrzIovUaaV8=; b=ty4FqB6FHtDEWG 36XJMd/8ksJ8OazvKBRXs/5m/79/TYUhKhCnRo6Wh2QO/0bO6W6rnfQQheo2/HjvWuZVWiWUERfEJ epsErylNT5pmGYOcyIDXRZbtoQjx3TiDSA4cyt1kfvYiGl17zOp4+BX8bhilxN63TYAeH91HQZTq9 I/d3hO6JKWfFGdLurawf5AI3U4O4UBst0xgXBVKV6eiHSXGt85C9auwAZpHxvY4YO4NKY818ZNFcs YNV6RCASVVgayhln5BuwUvp32aG1WVFXVzczgFin86M0opXZBVErSTESe6oNUJwOGkbOX+3DmjCdW TzqEMz6SAOpHkv5sqLNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTI4V-0020x2-2A; Tue, 08 Aug 2023 08:28:07 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTI4P-0020rd-2d for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 08:28:03 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fe2d152f62so8883551e87.0 for ; Tue, 08 Aug 2023 01:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691483278; x=1692088078; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qv5+yldfcLl5F50y6SpkVFOO6DSopWazKZ9tTkvj/KI=; b=CZBW9nW5F9NumoK7WmaElQE4oz8vx5tzzM/mD3rjAQa8Jsv4LP6W9h8+FPCh/aixzW 3zgL/d1dehfEjVQwirp2IFwc3lb7lE+O5UErOgL6UtGjHTTRYCAUKX3VZcUVymgctPRE 6jkaY14dHaPgdtLFVuHI2G2VSFsXYVZRWXOzszvzpd/+9vwn9ndukc2OCcgfUjGQvheF gqo6UKdxlhExgyfVOHyw+0sEyuXmVmodKK6kDek9QEfOkFQXWk0pYIKnTrYf/3YTH3cF djlh/giqKhapL4aB6T3Om5KrhcQyn6Q3PQADHL5oLxeazrp22gfB+nMBA/X3Bi4KHBEQ 2Swg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691483278; x=1692088078; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qv5+yldfcLl5F50y6SpkVFOO6DSopWazKZ9tTkvj/KI=; b=ZmyKzRFXGyAdJ7DnzqDlEH1As80rSoqFe+mmOBuzLDl+GOzFZkdTtYcNAEJtzF4uaH ODrpCCjX5jGNxWWpq5bv+4J3Qirhrr83A9Uxf1UVAQgQZiJ0EHU/Fm5JGGtBwWBAai7w 2djLNAtF3mDmRiDKIvfVX/UV7bLO2XVJb8hlLjYIU0fttObJS2a21+s+QfsP0mHLh3az KG25lrnIqIIKiEpmwObIuz8/Ig06/dhdP/PoWOSkmMFL9iRPpLhtZW37w2QMWEzRW+ft /U1EbZ+XzM63Iwpr8COK8zJpGfgHWxBQD/L0PeQJx0uD4nD3DIT+MP3vyKz/Y9m4a8uH 25MQ== X-Gm-Message-State: AOJu0YyWDKlZLVkZ0cVN2/UkQIwCn+1YNHkR8jOyamFkAmyv2f8be9oY AphlBtke/1azGzV+n40sQUBJVA== X-Google-Smtp-Source: AGHT+IE1JwtFdnFB8Qb2FMa0lT19XJl5y0OhOFfz9ix5xSzooJBHWR588byfQs4NsD0XnfPqprVNBg== X-Received: by 2002:a05:6512:39d6:b0:4f8:71bf:a259 with SMTP id k22-20020a05651239d600b004f871bfa259mr7889276lfu.67.1691483278062; Tue, 08 Aug 2023 01:27:58 -0700 (PDT) Received: from krzk-bin.. ([178.197.222.113]) by smtp.gmail.com with ESMTPSA id s18-20020adfeb12000000b0031779a6b451sm12861246wrn.83.2023.08.08.01.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 01:27:57 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Alim Akhtar , Michael Turquette , Stephen Boyd , Rob Herring , Conor Dooley , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 08/11] clk: samsung: exynos7885: do not define number of clocks in bindings Date: Tue, 8 Aug 2023 10:27:35 +0200 Message-Id: <20230808082738.122804-9-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230808082738.122804-1-krzysztof.kozlowski@linaro.org> References: <20230808082738.122804-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230808_012801_853478_0E167086 X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Number of clocks supported by Linux drivers might vary - sometimes we add new clocks, not exposed previously. Therefore this number of clocks should not be in the bindings, because otherwise we should not change it. Define number of clocks per each clock controller inside the driver directly. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar --- drivers/clk/samsung/clk-exynos7885.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos7885.c b/drivers/clk/samsung/clk-exynos7885.c index 0c6a84764f7a..f7d7427a558b 100644 --- a/drivers/clk/samsung/clk-exynos7885.c +++ b/drivers/clk/samsung/clk-exynos7885.c @@ -16,6 +16,12 @@ #include "clk.h" #include "clk-exynos-arm64.h" +/* NOTE: Must be equal to the last clock ID increased by one */ +#define CLKS_NR_TOP (CLK_GOUT_FSYS_USB30DRD + 1) +#define CLKS_NR_CORE (CLK_GOUT_TREX_P_CORE_PCLK_P_CORE + 1) +#define CLKS_NR_PERI (CLK_GOUT_WDT1_PCLK + 1) +#define CLKS_NR_FSYS (CLK_GOUT_MMC_SDIO_SDCLKIN + 1) + /* ---- CMU_TOP ------------------------------------------------------------- */ /* Register Offset definitions for CMU_TOP (0x12060000) */ @@ -333,7 +339,7 @@ static const struct samsung_cmu_info top_cmu_info __initconst = { .nr_div_clks = ARRAY_SIZE(top_div_clks), .gate_clks = top_gate_clks, .nr_gate_clks = ARRAY_SIZE(top_gate_clks), - .nr_clk_ids = TOP_NR_CLK, + .nr_clk_ids = CLKS_NR_TOP, .clk_regs = top_clk_regs, .nr_clk_regs = ARRAY_SIZE(top_clk_regs), }; @@ -552,7 +558,7 @@ static const struct samsung_cmu_info peri_cmu_info __initconst = { .nr_mux_clks = ARRAY_SIZE(peri_mux_clks), .gate_clks = peri_gate_clks, .nr_gate_clks = ARRAY_SIZE(peri_gate_clks), - .nr_clk_ids = PERI_NR_CLK, + .nr_clk_ids = CLKS_NR_PERI, .clk_regs = peri_clk_regs, .nr_clk_regs = ARRAY_SIZE(peri_clk_regs), .clk_name = "dout_peri_bus", @@ -661,7 +667,7 @@ static const struct samsung_cmu_info core_cmu_info __initconst = { .nr_div_clks = ARRAY_SIZE(core_div_clks), .gate_clks = core_gate_clks, .nr_gate_clks = ARRAY_SIZE(core_gate_clks), - .nr_clk_ids = CORE_NR_CLK, + .nr_clk_ids = CLKS_NR_CORE, .clk_regs = core_clk_regs, .nr_clk_regs = ARRAY_SIZE(core_clk_regs), .clk_name = "dout_core_bus", @@ -743,7 +749,7 @@ static const struct samsung_cmu_info fsys_cmu_info __initconst = { .nr_mux_clks = ARRAY_SIZE(fsys_mux_clks), .gate_clks = fsys_gate_clks, .nr_gate_clks = ARRAY_SIZE(fsys_gate_clks), - .nr_clk_ids = FSYS_NR_CLK, + .nr_clk_ids = CLKS_NR_FSYS, .clk_regs = fsys_clk_regs, .nr_clk_regs = ARRAY_SIZE(fsys_clk_regs), .clk_name = "dout_fsys_bus",