From patchwork Tue Aug 8 08:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13345832 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 AC686C001DB for ; Tue, 8 Aug 2023 08:28:21 +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=Hnwv+NDza0rKoWYiba0U9yKyK/TWE60cPgXRrjNdnmY=; b=FGTNVHS+9pEI6a evLnj5s1osnbNfug61pV/gaiBFBnRyQbE0bDIP4q0WE+ib6mKWJbUBJetK46lmeiK7bywb0+EZ3UX JbOypETroymtu1kgrcYqIz0GsCLohvKkO2jpS3mpQa2RUrMeSPnKovOH083uREl2kH+j9VYP2RH0E j5Ln6jgXxYSgCOOsNWKhgtTRDhzqHRVQgELQRulATAFdIp3hU8mPQpklz74dkEPVlCfTUv/J5FzX1 jPFSsBlsOKf16Y76MyrgEd1ONXzwspZiquJMELCtjn1qOh5SGIUn4vp6UGyg2Nh6eY0s5dAYA9aXO /WuijYwf3twhUfuVTeIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTI4I-0020p5-0V; Tue, 08 Aug 2023 08:27:54 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTI4D-0020mC-0Y for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 08:27:50 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-317f1c480eeso973439f8f.2 for ; Tue, 08 Aug 2023 01:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691483266; x=1692088066; 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=6MmEGhsWcyV2tJiWGbgG48WJpgMlPeUsMr9lr8DHG50=; b=AAcz0o7YICKIS8fo9NiTGI7Si06V0yo0sxmntRbXDWFI4Gr5AELlYy8xkLh8w7UfWr U8WYJ72m+OHystAJHV5mXqcyU0uC9PaIaCILYaBDCdp8u1Lh2e7X8s7x/3es4qkZpJZM K068JAhwcOYumYI6Vo3A+8HgG5JnRLFMnUfp91WYYd183UbV8FynbecdEAK091XMfJ5a l3oB5pXjuyy7AjQFu9nd4++Mq3K9LjJ1DPFNioDMfpJGIPBufZCZGkZiWq5jhrDWoe/o 9KzLbNg9k50J0wpaU7JISqe2FQVnRqSSKa30Xu32nSHmb2F7T5RMQlZCXpZ5OLABXJap oHDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691483266; x=1692088066; 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=6MmEGhsWcyV2tJiWGbgG48WJpgMlPeUsMr9lr8DHG50=; b=Yp4sVbBOcy0yUPdItEaVKI6zCl/DI8XCmdvdZE2TkCHPLZMrg1xIcbDztg+vbi9XmR 9IaxJZ7HCqP71Lw+9HcOwUMpOi0T/3Us5ilWpv8vsR/+xbf+Rz0BjTV2/PBDOvW/ygFv G2jTUEZWWgmSsxvn42D+nDjc6vt1iMBvVxsYNaOFdNvWRvsop0hjnZmUja1pP87EQ5ZJ Ihkijv8jOIpG0C8EVjY68+vievnIs5JQczOO14jks56d2beQoUTMLAcecccH3XavyDPU LtJ8LeQn+rz5NN7vYIpxfmc9/XxRVOPB69195PQXFyWIvufCeiioNuxLbMbpFPJci7rv Pa4A== X-Gm-Message-State: AOJu0Yy2BAZF0CD2c5MMX77SsKRLpHxceElnzjbpsl9+xnYcPKqvkq5c cuq/9zTYte0IATrvMi/ZXbZLWw== X-Google-Smtp-Source: AGHT+IHKz5Zsyb9uLFLG9UFYYyG8FqN+IRe8yffZvnZAPP1i84HeUdZsdHqQNw+tO7uYnme50hdlgw== X-Received: by 2002:a5d:5253:0:b0:317:cff4:7357 with SMTP id k19-20020a5d5253000000b00317cff47357mr7262024wrc.20.1691483266358; Tue, 08 Aug 2023 01:27:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 01:27:45 -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 02/11] clk: samsung: exynos4: do not define number of clocks in bindings Date: Tue, 8 Aug 2023 10:27:29 +0200 Message-Id: <20230808082738.122804-3-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_012749_211690_AA3C0D70 X-CRM114-Status: GOOD ( 16.99 ) 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-exynos4.c | 5 ++++- drivers/clk/samsung/clk-exynos4412-isp.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 43207257a9cc..4ec41221e68f 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -135,6 +135,9 @@ #define PWR_CTRL1_USE_CORE1_WFI (1 << 1) #define PWR_CTRL1_USE_CORE0_WFI (1 << 0) +/* NOTE: Must be equal to the last clock ID increased by one */ +#define CLKS_NR (CLK_DIV_CORE2 + 1) + /* the exynos4 soc type */ enum exynos4_soc { EXYNOS4210, @@ -1275,7 +1278,7 @@ static void __init exynos4_clk_init(struct device_node *np, if (!reg_base) panic("%s: failed to map registers\n", __func__); - ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, CLKS_NR); hws = ctx->clk_data.hws; samsung_clk_of_register_fixed_ext(ctx, exynos4_fixed_rate_ext_clks, diff --git a/drivers/clk/samsung/clk-exynos4412-isp.c b/drivers/clk/samsung/clk-exynos4412-isp.c index 1470c15e95da..a70c2b06a61a 100644 --- a/drivers/clk/samsung/clk-exynos4412-isp.c +++ b/drivers/clk/samsung/clk-exynos4412-isp.c @@ -22,6 +22,9 @@ #define E4X12_GATE_ISP0 0x0800 #define E4X12_GATE_ISP1 0x0804 +/* NOTE: Must be equal to the last clock ID increased by one */ +#define CLKS_NR_ISP (CLK_ISP_DIV_MCUISP1 + 1) + /* * Support for CMU save/restore across system suspends */ @@ -121,7 +124,7 @@ static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev) if (!exynos4x12_save_isp) return -ENOMEM; - ctx = samsung_clk_init(dev, reg_base, CLK_NR_ISP_CLKS); + ctx = samsung_clk_init(dev, reg_base, CLKS_NR_ISP); platform_set_drvdata(pdev, ctx);