From patchwork Thu Feb 22 03:02:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13566681 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 B1F96C48BEB for ; Thu, 22 Feb 2024 03:03:04 +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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hmlzYnb9Kk5E/27DRjFESzARtQzJRsnQAVtzhUYGff0=; b=AYhQzW5sTZE65a YbngSqeLFudPZUjwNR+LHp4J9ltwDiQaWNlVp5WygnfEgwVt1kJRu3flha2Cq0vKJvNfZI847Ai9q bFMCUdjc6n+sapcbHtyV3xvxUly8Yk3wAxNatELpUlJr3yZ5O+kY7rWDw/0ArwFF/ZZVWpPrUwg1J KiZdVu5aQG/Fh8JEdVOy1UT5I8dWt0VcDYcWlIH3PtEuh7pidsAi1B8Nm7ycLA06lk6JUMC94bT9a nCVDZfKGmnGv3KHj5+qSTVfZ9rEJ13pzPfoE10TnT3WN5+4bFu9jTkAoiEndMM4v7LasPhrLT6N5l SMeN5N2i/H2O8XijEdew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rczMJ-00000003ImZ-44Pu; Thu, 22 Feb 2024 03:02:51 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rczM7-00000003IeE-3x8i for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2024 03:02:41 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-59fd69bab3bso1265584eaf.2 for ; Wed, 21 Feb 2024 19:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708570958; x=1709175758; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zl+WacIm9QRXQC0Y5/uv+FIwM1YVxoD9Cr7x73AtUv0=; b=Br2Hv5hUE6KtKw8JQ6MUE2yEPLjJej7p+2Kx/p8ITYvE1IHgk/fnpx5sitJrtum/w+ ysax1mKvzCgyrxbvEDlrePxxTSstHE8MJAz7twcilZUz1ONwelY7Ojq5p5bqnMFrgv2y V6tkWeWWHOJ95sAcEs/m7EYi8oIFzvpxHi53vvvYZD0Y4DwOYxLHild4TXNc9vq7SWNu PUpcuLX6jlwWRixdmV2ryQ3ZcpetJMDRmT/xxeMvxJz7fDnNqR5efiNY8EjtUa+tXw2t C8ICGDErdYubSL6sQCAW+9qaqTLxBLTt3HGJu5i05KbCSEByxLe7/soo7gZYprOG1GWl 9o9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708570958; x=1709175758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zl+WacIm9QRXQC0Y5/uv+FIwM1YVxoD9Cr7x73AtUv0=; b=VVvG122B2Vap0rCSz9ExhUT9vT1rV0tkX9B5aHF+6djPnC8bMlbU4WFh+je5Fro/BB FctUvpN7aHx0PwedxEBUYoKfpAka1eOo6RCghqGy//JIOAK6X62idLCYxp0XwXZ6jBs+ s/R87b7Tky5dh0yXoPQKOmpiJUZ0UM6N98yGURz+RrLSci41KpOlwq0MkExEXIRB37oO Gt2iiZsmSH5Ew9iuy+h7Z5aMc99lWfKlhC7nSmxIWNrVSh8WysOFe0r34WTDKQ04PRNb pLd4JhKjpmsmnZVMWXpDnCZEAziZuE+BmfSPjISkRhCD6vbTn2G3hWHIMoHNs09guFv2 Y2gg== X-Forwarded-Encrypted: i=1; AJvYcCUoXIyICuA6rJeSVuJxdmrrbJkvGzjFbfcw6TsULnKCPovfl5BcYvBPTkUg+rUhC2aKK2roGBwEpmxBA2ZKYhggWkPz/a529LvfOPGH27rUarMh1os= X-Gm-Message-State: AOJu0YxoIJVUnunWMuYxWo9LwY65VyObbHffHpfb6UtTo+BkDOEnSOCP Jmr99DKy8aUMqdkVPGNB0IlI1ltShf2ShK+adlp2kjoZDRB5F+arJynIARS+8tw= X-Google-Smtp-Source: AGHT+IH2HSioJXyNfPWhTv8Aki4+YIBLaNkslaAzYgx78hcG5wWTUzPaMZ6CmaxOILUiQ333qL2zzQ== X-Received: by 2002:a4a:6116:0:b0:5a0:294d:dca4 with SMTP id n22-20020a4a6116000000b005a0294ddca4mr458878ooc.8.1708570958584; Wed, 21 Feb 2024 19:02:38 -0800 (PST) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id k15-20020a056830168f00b006e12023de5fsm1900371otr.46.2024.02.21.19.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 19:02:38 -0800 (PST) From: Sam Protsenko To: Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Alim Akhtar , Michael Turquette , Stephen Boyd , Rob Herring , Conor Dooley , Tomasz Figa , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/15] clk: samsung: Pull struct exynos_cpuclk into clk-cpu.c Date: Wed, 21 Feb 2024 21:02:23 -0600 Message-Id: <20240222030235.27815-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240222030235.27815-1-semen.protsenko@linaro.org> References: <20240222030235.27815-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_190240_083507_F847368E X-CRM114-Status: GOOD ( 20.28 ) 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 Reduce the scope of struct exynos_cpuclk, as it's only used in clk-cpu.c internally. All drivers using clk-pll.h already include clk.h as well, so this change doesn't break anything. No functional change. Signed-off-by: Sam Protsenko --- Changes in v2: - none drivers/clk/samsung/clk-cpu.c | 29 +++++++++++++++++++++++++ drivers/clk/samsung/clk-cpu.h | 41 +++++------------------------------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index e02730776aaa..6412fd2580e0 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -34,6 +34,8 @@ #include #include #include + +#include "clk.h" #include "clk-cpu.h" #define E4210_SRC_CPU 0x0 @@ -64,6 +66,33 @@ #define DIV_MASK_ALL GENMASK(31, 0) #define MUX_MASK GENMASK(2, 0) +/** + * struct exynos_cpuclk - information about clock supplied to a CPU core + * @hw: handle between CCF and CPU clock + * @alt_parent: alternate parent clock to use when switching the speed + * of the primary parent clock + * @ctrl_base: base address of the clock controller + * @lock: cpu clock domain register access lock + * @cfg: cpu clock rate configuration data + * @num_cfgs: number of array elements in @cfg array + * @clk_nb: clock notifier registered for changes in clock speed of the + * primary parent clock + * @flags: configuration flags for the CPU clock + * + * This structure holds information required for programming the CPU clock for + * various clock speeds. + */ +struct exynos_cpuclk { + struct clk_hw hw; + const struct clk_hw *alt_parent; + void __iomem *ctrl_base; + spinlock_t *lock; + const struct exynos_cpuclk_cfg_data *cfg; + const unsigned long num_cfgs; + struct notifier_block clk_nb; + unsigned long flags; +}; + /* * Helper function to wait until divider(s) have stabilized after the divider * value has changed. diff --git a/drivers/clk/samsung/clk-cpu.h b/drivers/clk/samsung/clk-cpu.h index 0164bd9ad021..ee57f3638fed 100644 --- a/drivers/clk/samsung/clk-cpu.h +++ b/drivers/clk/samsung/clk-cpu.h @@ -8,7 +8,12 @@ #ifndef __SAMSUNG_CLK_CPU_H #define __SAMSUNG_CLK_CPU_H -#include "clk.h" +/* The CPU clock registers have DIV1 configuration register */ +#define CLK_CPU_HAS_DIV1 BIT(0) +/* When ALT parent is active, debug clocks need safe divider values */ +#define CLK_CPU_NEEDS_DEBUG_ALT_DIV BIT(1) +/* The CPU clock registers have Exynos5433-compatible layout */ +#define CLK_CPU_HAS_E5433_REGS_LAYOUT BIT(2) /** * struct exynos_cpuclk_cfg_data - config data to setup cpu clocks @@ -28,38 +33,4 @@ struct exynos_cpuclk_cfg_data { unsigned long div1; }; -/** - * struct exynos_cpuclk - information about clock supplied to a CPU core - * @hw: handle between CCF and CPU clock - * @alt_parent: alternate parent clock to use when switching the speed - * of the primary parent clock - * @ctrl_base: base address of the clock controller - * @lock: cpu clock domain register access lock - * @cfg: cpu clock rate configuration data - * @num_cfgs: number of array elements in @cfg array - * @clk_nb: clock notifier registered for changes in clock speed of the - * primary parent clock - * @flags: configuration flags for the CPU clock - * - * This structure holds information required for programming the CPU clock for - * various clock speeds. - */ -struct exynos_cpuclk { - struct clk_hw hw; - const struct clk_hw *alt_parent; - void __iomem *ctrl_base; - spinlock_t *lock; - const struct exynos_cpuclk_cfg_data *cfg; - const unsigned long num_cfgs; - struct notifier_block clk_nb; - unsigned long flags; - -/* The CPU clock registers have DIV1 configuration register */ -#define CLK_CPU_HAS_DIV1 (1 << 0) -/* When ALT parent is active, debug clocks need safe divider values */ -#define CLK_CPU_NEEDS_DEBUG_ALT_DIV (1 << 1) -/* The CPU clock registers have Exynos5433-compatible layout */ -#define CLK_CPU_HAS_E5433_REGS_LAYOUT (1 << 2) -}; - #endif /* __SAMSUNG_CLK_CPU_H */