From patchwork Fri Feb 3 06:09:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127028 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 94F0CC61DA4 for ; Fri, 3 Feb 2023 06:10:10 +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=dDT+/62WHS3Mqn6SjIivn84Q6kUab7wUP30EFXk7CeA=; b=LETQWOYU6f73eD TSZu3a/Z+/FfZXnDOGFiRmCxR4z152uPPpHyd0bufjhwlJN4Db04xKIZxH2+/2PAKDoQio5x+26dz yaRsE4IoaTzeXq4jYRMTZ8Hn45vBZY+sWZ54B8sH4J+2Zd8dj3qZl9X+fTP6wpd24txCJcVmT33hG sPSk3xTadUjk7Eg6K1lzjBaY5pta8L+8MBIklovGhlacl1ridHCmOLBj2TPUpnjTSagyvEUDVcsSE +ynHSuIw6MgLCGRatsgC472rsbJGFGA2eDHKJ3z4sEZh2d67pvGbJVupcEUrzUVkC/zZOb79A7vuZ JOIJ3Jj3uepRdwmwO4BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpG7-000VI4-Vn; Fri, 03 Feb 2023 06:09:16 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpFw-000VD0-Oy for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:06 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-15ff0a1f735so5523159fac.5 for ; Thu, 02 Feb 2023 22:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=qP1kmPfCeQKgCd6GN37+7ZY116BDOd653jRamI2rf4Q=; b=JbwS6hQ/EPlcMMnSMfrsjVyEYVxwTJUzWKRRg8v+WilnqkjNzttyZJjJ3mQvAjKLK7 kvSfAx5XsSqW2C5Nnmi5SpTH1xeTM5N29GFuJceJQCGQUHzsJS7fZgleAVWs7tFxMOm1 FHOnPhpRHLkgGKSdUE+HEnwcMTrVhik1sCEZu3axrqa7R83YY8TUpmqf2/PNias9Kl6A t13cLppfKbnozcNCpu95zHOUPcB6EoSoLVg6Sx78zyeMJsRDF/k8j/cBdo3qbbxi9CJE 7sQRNRNMCFqr/zPaxftFUnXKyqq5b0QrY71tsaegZnMCIFTAKKzwQhCGHi7FnmmaAbxo Sh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qP1kmPfCeQKgCd6GN37+7ZY116BDOd653jRamI2rf4Q=; b=IGuPN16mdmFfKFgiKhPVFWRQog/kvpAW+Z4cA/mUUa1KBO5elroNG6GewlV4yAQAQ+ XRJePv/5gAziwNQ0Tp+5ZP/emSSZDMBGboNfyA8ejUrzbwvp6UgQ3oE+TzabA1agNTDO EM9PLN18I10oXOuCe/T8MHiV5vHIHRzv7zlLGIxDfOPYx+eA++pfPsLVDDuT3/xghgkB OFpEg3b5SbhYv9qZOsy9/lkPqkllVtKQxTgVw57WfcuWMwMEukjcQovlGTuS92Wb+i6x 5n1889y+K/hQXslDQ7BX0WTCpXzim6O3xMKte0zSOhS/ABF+G+rI82NoHORtfeEqdPXi HkMg== X-Gm-Message-State: AO0yUKW3y3utqzJTM/KIBfquUyS0W4+HE1xQ/4NWYn8r6IUC4HUVYLor q+Nxb/bdZvOcoSlAf7Z6C+33yA== X-Google-Smtp-Source: AK7set/iszwxO1qsbnnzQ/GgAqXJ2hMKbUIZ4jpJpe9w0tIAMANdSsBQNyexdqqlPjE5zji2IZBFHQ== X-Received: by 2002:a05:6870:390c:b0:163:35f9:a4cd with SMTP id b12-20020a056870390c00b0016335f9a4cdmr4470812oap.51.1675404542767; Thu, 02 Feb 2023 22:09:02 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id u3-20020a05687036c300b001428eb454e9sm603570oak.13.2023.02.02.22.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:02 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] clk: samsung: Don't pass reg_base to samsung_clk_register_pll() Date: Fri, 3 Feb 2023 00:09:19 -0600 Message-Id: <20230203060924.8257-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220904_831606_127FDAC9 X-CRM114-Status: GOOD ( 17.65 ) 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 Base address can be derived from context structure. Remove `base' argument from samsung_clk_register_pll() and use `ctx->reg_base' instead, as it's done in other clock registering functions. No functional change. Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk-exynos4.c | 4 ++-- drivers/clk/samsung/clk-exynos5250.c | 3 +-- drivers/clk/samsung/clk-exynos5420.c | 3 +-- drivers/clk/samsung/clk-exynos5433.c | 4 ++-- drivers/clk/samsung/clk-pll.c | 11 +++++------ drivers/clk/samsung/clk-s3c2410.c | 4 ++-- drivers/clk/samsung/clk-s3c2412.c | 3 +-- drivers/clk/samsung/clk-s3c2443.c | 4 ++-- drivers/clk/samsung/clk-s3c64xx.c | 2 +- drivers/clk/samsung/clk-s5pv210.c | 4 ++-- drivers/clk/samsung/clk.c | 3 +-- drivers/clk/samsung/clk.h | 2 +- 12 files changed, 21 insertions(+), 26 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 22009cb53428..244f74f31746 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -1276,7 +1276,7 @@ static void __init exynos4_clk_init(struct device_node *np, exynos4210_vpll_rates; samsung_clk_register_pll(ctx, exynos4210_plls, - ARRAY_SIZE(exynos4210_plls), reg_base); + ARRAY_SIZE(exynos4210_plls)); } else { if (clk_hw_get_rate(hws[CLK_FIN_PLL]) == 24000000) { exynos4x12_plls[apll].rate_table = @@ -1288,7 +1288,7 @@ static void __init exynos4_clk_init(struct device_node *np, } samsung_clk_register_pll(ctx, exynos4x12_plls, - ARRAY_SIZE(exynos4x12_plls), reg_base); + ARRAY_SIZE(exynos4x12_plls)); } samsung_clk_register_fixed_rate(ctx, exynos4_fixed_rate_clks, diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 113df773ee44..69862ab6dc52 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c @@ -815,8 +815,7 @@ static void __init exynos5250_clk_init(struct device_node *np) exynos5250_plls[vpll].rate_table = vpll_24mhz_tbl; samsung_clk_register_pll(ctx, exynos5250_plls, - ARRAY_SIZE(exynos5250_plls), - reg_base); + ARRAY_SIZE(exynos5250_plls)); samsung_clk_register_fixed_rate(ctx, exynos5250_fixed_rate_clks, ARRAY_SIZE(exynos5250_fixed_rate_clks)); samsung_clk_register_fixed_factor(ctx, exynos5250_fixed_factor_clks, diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index caad74dee297..df9e93d6adf2 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -1606,8 +1606,7 @@ static void __init exynos5x_clk_init(struct device_node *np, else exynos5x_plls[bpll].rate_table = exynos5422_bpll_rate_table; - samsung_clk_register_pll(ctx, exynos5x_plls, ARRAY_SIZE(exynos5x_plls), - reg_base); + samsung_clk_register_pll(ctx, exynos5x_plls, ARRAY_SIZE(exynos5x_plls)); samsung_clk_register_fixed_rate(ctx, exynos5x_fixed_rate_clks, ARRAY_SIZE(exynos5x_fixed_rate_clks)); samsung_clk_register_fixed_factor(ctx, exynos5x_fixed_factor_clks, diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c index f9daae20f393..eb72bf2aaee8 100644 --- a/drivers/clk/samsung/clk-exynos5433.c +++ b/drivers/clk/samsung/clk-exynos5433.c @@ -5610,8 +5610,8 @@ static int __init exynos5433_cmu_probe(struct platform_device *pdev) pm_runtime_enable(dev); if (info->pll_clks) - samsung_clk_register_pll(ctx, info->pll_clks, info->nr_pll_clks, - reg_base); + samsung_clk_register_pll(ctx, info->pll_clks, + info->nr_pll_clks); if (info->mux_clks) samsung_clk_register_mux(ctx, info->mux_clks, info->nr_mux_clks); diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c index 0ff28938943f..96b2b15fafc3 100644 --- a/drivers/clk/samsung/clk-pll.c +++ b/drivers/clk/samsung/clk-pll.c @@ -1422,8 +1422,7 @@ static const struct clk_ops samsung_pll2650xx_clk_min_ops = { }; static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, - const struct samsung_pll_clock *pll_clk, - void __iomem *base) + const struct samsung_pll_clock *pll_clk) { struct samsung_clk_pll *pll; struct clk_init_data init; @@ -1576,8 +1575,8 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, pll->hw.init = &init; pll->type = pll_clk->type; - pll->lock_reg = base + pll_clk->lock_offset; - pll->con_reg = base + pll_clk->con_offset; + pll->lock_reg = ctx->reg_base + pll_clk->lock_offset; + pll->con_reg = ctx->reg_base + pll_clk->con_offset; ret = clk_hw_register(ctx->dev, &pll->hw); if (ret) { @@ -1593,10 +1592,10 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx, void __init samsung_clk_register_pll(struct samsung_clk_provider *ctx, const struct samsung_pll_clock *pll_list, - unsigned int nr_pll, void __iomem *base) + unsigned int nr_pll) { int cnt; for (cnt = 0; cnt < nr_pll; cnt++) - _samsung_clk_register_pll(ctx, &pll_list[cnt], base); + _samsung_clk_register_pll(ctx, &pll_list[cnt]); } diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index 3d152a46169b..d72c79fa9b63 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c @@ -347,7 +347,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, /* Register PLLs. */ samsung_clk_register_pll(ctx, s3c2410_plls, - ARRAY_SIZE(s3c2410_plls), reg_base); + ARRAY_SIZE(s3c2410_plls)); } else { /* S3C2440, S3C2442 */ if (clk_hw_get_rate(hws[XTI]) == 12 * MHZ) { @@ -363,7 +363,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, /* Register PLLs. */ samsung_clk_register_pll(ctx, s3c244x_common_plls, - ARRAY_SIZE(s3c244x_common_plls), reg_base); + ARRAY_SIZE(s3c244x_common_plls)); } /* Register common internal clocks. */ diff --git a/drivers/clk/samsung/clk-s3c2412.c b/drivers/clk/samsung/clk-s3c2412.c index 724ef642f048..367f3ecb68e8 100644 --- a/drivers/clk/samsung/clk-s3c2412.c +++ b/drivers/clk/samsung/clk-s3c2412.c @@ -223,8 +223,7 @@ void __init s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f, s3c2412_common_clk_register_fixed_ext(ctx, xti_f, ext_f); /* Register PLLs. */ - samsung_clk_register_pll(ctx, s3c2412_plls, ARRAY_SIZE(s3c2412_plls), - reg_base); + samsung_clk_register_pll(ctx, s3c2412_plls, ARRAY_SIZE(s3c2412_plls)); /* Register common internal clocks. */ samsung_clk_register_mux(ctx, s3c2412_muxes, ARRAY_SIZE(s3c2412_muxes)); diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index a827d63766d1..bfcad2a24dbe 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -362,10 +362,10 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, /* Register PLLs. */ if (current_soc == S3C2416 || current_soc == S3C2450) samsung_clk_register_pll(ctx, s3c2416_pll_clks, - ARRAY_SIZE(s3c2416_pll_clks), reg_base); + ARRAY_SIZE(s3c2416_pll_clks)); else samsung_clk_register_pll(ctx, s3c2443_pll_clks, - ARRAY_SIZE(s3c2443_pll_clks), reg_base); + ARRAY_SIZE(s3c2443_pll_clks)); /* Register common internal clocks. */ samsung_clk_register_mux(ctx, s3c2443_common_muxes, diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index d6b432a26d63..d582bac68bb7 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c @@ -414,7 +414,7 @@ void __init s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f, /* Register PLLs. */ samsung_clk_register_pll(ctx, s3c64xx_pll_clks, - ARRAY_SIZE(s3c64xx_pll_clks), reg_base); + ARRAY_SIZE(s3c64xx_pll_clks)); /* Register common internal clocks. */ samsung_clk_register_fixed_rate(ctx, s3c64xx_fixed_rate_clks, diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c index 4425186bdcab..b91d20994bf5 100644 --- a/drivers/clk/samsung/clk-s5pv210.c +++ b/drivers/clk/samsung/clk-s5pv210.c @@ -753,7 +753,7 @@ static void __init __s5pv210_clk_init(struct device_node *np, samsung_clk_register_fixed_rate(ctx, s5p6442_frate_clks, ARRAY_SIZE(s5p6442_frate_clks)); samsung_clk_register_pll(ctx, s5p6442_pll_clks, - ARRAY_SIZE(s5p6442_pll_clks), reg_base); + ARRAY_SIZE(s5p6442_pll_clks)); samsung_clk_register_mux(ctx, s5p6442_mux_clks, ARRAY_SIZE(s5p6442_mux_clks)); samsung_clk_register_div(ctx, s5p6442_div_clks, @@ -764,7 +764,7 @@ static void __init __s5pv210_clk_init(struct device_node *np, samsung_clk_register_fixed_rate(ctx, s5pv210_frate_clks, ARRAY_SIZE(s5pv210_frate_clks)); samsung_clk_register_pll(ctx, s5pv210_pll_clks, - ARRAY_SIZE(s5pv210_pll_clks), reg_base); + ARRAY_SIZE(s5pv210_pll_clks)); samsung_clk_register_mux(ctx, s5pv210_mux_clks, ARRAY_SIZE(s5pv210_mux_clks)); samsung_clk_register_div(ctx, s5pv210_div_clks, diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index bca4731b14ea..e132d63933c3 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -344,8 +344,7 @@ struct samsung_clk_provider * __init samsung_cmu_register_one( ctx = samsung_clk_init(np, reg_base, cmu->nr_clk_ids); if (cmu->pll_clks) - samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks, - reg_base); + samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks); if (cmu->mux_clks) samsung_clk_register_mux(ctx, cmu->mux_clks, cmu->nr_mux_clks); diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index b46e83a2581f..1b7315063edd 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -373,7 +373,7 @@ void samsung_clk_register_gate(struct samsung_clk_provider *ctx, unsigned int nr_clk); void samsung_clk_register_pll(struct samsung_clk_provider *ctx, const struct samsung_pll_clock *pll_list, - unsigned int nr_clk, void __iomem *base); + unsigned int nr_clk); void samsung_clk_register_cpu(struct samsung_clk_provider *ctx, const struct samsung_cpu_clock *list, unsigned int nr_clk); From patchwork Fri Feb 3 06:09:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127029 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 4ACEAC636CC for ; Fri, 3 Feb 2023 06:10:20 +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=ICjBy7gH70Om1ERhq5IfFCUYYfqrfMXiyL8WjFdRKQo=; b=3PARB6fTFLSELc cplAq5Mhib1hwkorwuS/3q07zMA7fWX/Q5EUNrQ6zDU1iFGrjrWj6pLGzGrXV/Hx1bOUsIVGXNM/a orwCU8bO96xfULdgdNOINLRoZT7Gqeeb28hd3eaF6I4X5dzaSVbaChJxxNpS0ak0qct9QfwAsBUUG ofJpd0siIHzPdEL7jdWguYOlLaVRujVwwPDsbVp5ne8KLtD2ijPDBJ9SnEqtBO6KhTndcPic8RuBY lAZ/lisAlXQH/HrXDYgdbqTLVXevrKa7S3KKauPFf9+GVF9aq9JKrY5m586z59TDMHAjA49eHTyCR C1xLzO3PJWORKO3+64FQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpGF-000VKO-MW; Fri, 03 Feb 2023 06:09:23 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpFx-000VDE-7N for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:06 +0000 Received: by mail-oi1-x22d.google.com with SMTP id bx13so3346582oib.13 for ; Thu, 02 Feb 2023 22:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=rhDFp02xAnIoajb23QEQdChW+frO427szyZqJSvH2Ow=; b=tl8uOyMje7TVhx8wjF4XNRLmw0XIhbo7ZVBa7x+ofZMLoMFDzFZIXuKO72fTi/EIDT EMyN3Mf5GZ1mv58YKGuwkSdoa8eCebr2g+uvLynpt0B60R5CvNzmSBCet7wrqWCyPP1C xpL5zjXDJ4k8LqXP9Etuad/GNPF/uffPRfHpl3Ujd2Gt5xWeVo5xse97lZoGzXVwsdY7 Lr0eMck8t1WiI89AhzY+nrZbPATcEOY89DkxPOZcpJn9p2VymP+WKAdLQwBll8vsk5Xr ZPYpO6YCaw5HD6s8avz5tmRAV0iiq6o/9RytHbeIbGm+3Vw0+H9Z6r0yiX8dhc6NCE3B +Q3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=rhDFp02xAnIoajb23QEQdChW+frO427szyZqJSvH2Ow=; b=ESb/cPhk7UO8DGRAZp3A7Fv6XTyEjDzNE1JBUi5g568my7GA+6snl+nKuPoMNZj5DZ Mfhvmvp3jN6MXrdSTDz3uZaiHKXiDCJAkI4D5o0G7xk/7XYJ2Cx7LMCQmPOwz7ahm/jt ri1OA6EfMMLLfkx9kaOgStYMjdENnN/UYXxajtiFJmvOZC+6cUPPHx4qSdYW4oZyW9Jy 8xpsbwXYu49DTmMid6r7u9IZiCT67bRcLLu40wWQVLa6Ak98FHq6ifTyP/qV659y9o4s mQKpBegMIovyj1n+wlO1+zzvzsWNCuHWu6kLM1Ex2y89Vj00YzXESTgK5dzabBERL4Eu TInQ== X-Gm-Message-State: AO0yUKUCNFEqVmITichhJFv6dFiRQf2KqnBlIZeEwWfkWy372bA9eEi/ MNMe9U7Va9eTVlBzH9JQQaDoRA== X-Google-Smtp-Source: AK7set8bFtm2GOhgc9JGHl5lZ6gfkXvATjtYJDqc9t57xJj5PYF9WlJCZv7dLF36uioZOXpSMEcvRQ== X-Received: by 2002:aca:2802:0:b0:364:adbc:609b with SMTP id 2-20020aca2802000000b00364adbc609bmr3730087oix.19.1675404543814; Thu, 02 Feb 2023 22:09:03 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id c15-20020a9d75cf000000b0068bbaf7a1b0sm739663otl.34.2023.02.02.22.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:03 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] clk: samsung: Remove np argument from samsung_clk_init() Date: Fri, 3 Feb 2023 00:09:20 -0600 Message-Id: <20230203060924.8257-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220905_290024_5BC6944D X-CRM114-Status: GOOD ( 14.88 ) 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 The code using `np' argument was removed from samsung_clk_init(). Remove that leftover parameter as well. No functional change. Fixes: d5e136a21b20 ("clk: samsung: Register clk provider only after registering its all clocks") Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk-exynos4.c | 2 +- drivers/clk/samsung/clk-exynos4412-isp.c | 2 +- drivers/clk/samsung/clk-exynos5250.c | 2 +- drivers/clk/samsung/clk-exynos5420.c | 2 +- drivers/clk/samsung/clk-s3c2410.c | 2 +- drivers/clk/samsung/clk-s3c2412.c | 2 +- drivers/clk/samsung/clk-s3c2443.c | 2 +- drivers/clk/samsung/clk-s3c64xx.c | 2 +- drivers/clk/samsung/clk-s5pv210.c | 2 +- drivers/clk/samsung/clk.c | 6 +++--- drivers/clk/samsung/clk.h | 3 +-- 11 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 244f74f31746..7a9994144d72 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -1251,7 +1251,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(np, reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(reg_base, CLK_NR_CLKS); 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 471a6fb82670..0b6390e04533 100644 --- a/drivers/clk/samsung/clk-exynos4412-isp.c +++ b/drivers/clk/samsung/clk-exynos4412-isp.c @@ -121,7 +121,7 @@ static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev) if (!exynos4x12_save_isp) return -ENOMEM; - ctx = samsung_clk_init(np, reg_base, CLK_NR_ISP_CLKS); + ctx = samsung_clk_init(reg_base, CLK_NR_ISP_CLKS); ctx->dev = dev; platform_set_drvdata(pdev, ctx); diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 69862ab6dc52..f1cb69aea10e 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c @@ -797,7 +797,7 @@ static void __init exynos5250_clk_init(struct device_node *np) panic("%s: unable to determine soc\n", __func__); } - ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(reg_base, CLK_NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_of_register_fixed_ext(ctx, exynos5250_fixed_rate_ext_clks, diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index df9e93d6adf2..46cac4980be2 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -1587,7 +1587,7 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5x_soc = soc; - ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(reg_base, CLK_NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks, diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index d72c79fa9b63..8483d4a2be03 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c @@ -332,7 +332,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(np, reg_base, NR_CLKS); + ctx = samsung_clk_init(reg_base, NR_CLKS); hws = ctx->clk_data.hws; /* Register external clocks only in non-dt cases */ diff --git a/drivers/clk/samsung/clk-s3c2412.c b/drivers/clk/samsung/clk-s3c2412.c index 367f3ecb68e8..8f12a40790d4 100644 --- a/drivers/clk/samsung/clk-s3c2412.c +++ b/drivers/clk/samsung/clk-s3c2412.c @@ -216,7 +216,7 @@ void __init s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(np, reg_base, NR_CLKS); + ctx = samsung_clk_init(reg_base, NR_CLKS); /* Register external clocks only in non-dt cases */ if (!np) diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index bfcad2a24dbe..6db8147f0aa2 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -353,7 +353,7 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(np, reg_base, NR_CLKS); + ctx = samsung_clk_init(reg_base, NR_CLKS); /* Register external clocks only in non-dt cases */ if (!np) diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index d582bac68bb7..47e9d19486dc 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c @@ -405,7 +405,7 @@ void __init s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(np, reg_base, NR_CLKS); + ctx = samsung_clk_init(reg_base, NR_CLKS); hws = ctx->clk_data.hws; /* Register external clocks. */ diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c index b91d20994bf5..b0ab6bc9d21d 100644 --- a/drivers/clk/samsung/clk-s5pv210.c +++ b/drivers/clk/samsung/clk-s5pv210.c @@ -743,7 +743,7 @@ static void __init __s5pv210_clk_init(struct device_node *np, struct samsung_clk_provider *ctx; struct clk_hw **hws; - ctx = samsung_clk_init(np, reg_base, NR_CLKS); + ctx = samsung_clk_init(reg_base, NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_register_mux(ctx, early_mux_clks, diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index e132d63933c3..2436223aac1a 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -54,8 +54,8 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( } /* setup the essentials required to support clock lookup using ccf */ -struct samsung_clk_provider *__init samsung_clk_init(struct device_node *np, - void __iomem *base, unsigned long nr_clks) +struct samsung_clk_provider * __init samsung_clk_init(void __iomem *base, + unsigned long nr_clks) { struct samsung_clk_provider *ctx; int i; @@ -341,7 +341,7 @@ struct samsung_clk_provider * __init samsung_cmu_register_one( return NULL; } - ctx = samsung_clk_init(np, reg_base, cmu->nr_clk_ids); + ctx = samsung_clk_init(reg_base, cmu->nr_clk_ids); if (cmu->pll_clks) samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks); diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index 1b7315063edd..98753b0e5055 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -337,8 +337,7 @@ struct samsung_cmu_info { const char *clk_name; }; -struct samsung_clk_provider * samsung_clk_init( - struct device_node *np, void __iomem *base, +struct samsung_clk_provider *samsung_clk_init(void __iomem *base, unsigned long nr_clks); void samsung_clk_of_add_provider(struct device_node *np, struct samsung_clk_provider *ctx); From patchwork Fri Feb 3 06:09:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127031 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 3F592C61DA4 for ; Fri, 3 Feb 2023 06:10:44 +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=pkFQBzmUM8BJ8pamCdS1N82RbMW4/WTgrimfZ/WeqUw=; b=Oo4vjlUqoagTJ0 0hDd0VcFowieclVlLL5Xrnj2a6wm40s/VXUi0VHuTgonxuEi27UEtthsy8IRufSYofE9vhJkWIXpA 2aSpyf4h9f0ZBR3qLjUIE4+p9X+NY27CzqTb8h3xlXIXBiucwShvydO8+NmqUKJqBQslsvf7s5uYp xXlfOXtP97Od2qTlczpgu5ifTChFH+5P+cFigHz+MJrwhyQO8tZs0Ru7nTyMnZwEOG0D5A6BWS062 ldvj39GfiLP3YosoJsxa1rhx7BSFed+2jgIiagiSllR6tfmVdE8vqIfM/Ed+1zryW5P0wFdzsBWB3 55CdLT0URBZvtSHmi67A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpGY-000VRt-72; Fri, 03 Feb 2023 06:09:42 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpFy-000VDd-39 for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:08 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-169ba826189so5534747fac.2 for ; Thu, 02 Feb 2023 22:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=0yDr1A3i4lDIJ+wlIu+l4d4VuNidJwmq/Y1jBeWohDk=; b=K2zByDQKA8e0euNkkSni0gOKbDACnfLRXRi54ui/9SqIbiQ2rFkNElrHR0lY34wKb2 wwn2+EVJXWb4jwCc7S2vXPo4/XydrGvPMYDzKf645rG/18dv81JvvOGT+k/f7HGi0ItW ibdS8Gbopb+eKrbGJNAQE3ClVwDxjzMMBN18HBfvVEtWV+EuJY1lgOTMaNFcFrZsGLwp +miJnlW1xouk3hSK6HoVo94ptseWtxaot4sXMkEoHBwYI+9YkvR1CPb1Yf+26ZGnjPha 901ifJh8+tabdAnXafQ5XsxF/6HjgTLCvG1XbDeg2blQMaSBceEDCOCgrt2+FWBk01q7 1xSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=0yDr1A3i4lDIJ+wlIu+l4d4VuNidJwmq/Y1jBeWohDk=; b=hbYeTTSD9ig1k/uoiTa6ZpmE0WoZa5ATrdcX9jfa2IpOkb/pU7dTWWz19y4NOAeMcu 4GWx6iRwQZgm8yBDGKkFFPCKvEQfzgcPWpvu9wathfda2bC2sjgmf7e3HgUfxg67OJeD NgmWDNpl5UKoayRjV+NtQ4Lv1x3X7twuAzdCz2gh566JbxR6mQ+9h98v60ATIDTweVm9 zsyhI7sr25pU9gG8CgWyHy6OWqL+5iRcjT0ItyK31AZB0cIevtVluhSpHXJPeLmSzlNK 9YujP/07kUr9MNJS/44w/heyqXnelQ6ouRx5dYvwosrf5IRL1ysnygFaBlOx/1/sTolD xLRg== X-Gm-Message-State: AO0yUKWrLgS3gXFQcF0juaTKDUCnpdEssYUDE0INaDNNNb41bGv5DlVn GArIT05VztjBYgmzoOww4uyiXg== X-Google-Smtp-Source: AK7set9YBh2frMwtpfDlDcpzwrz1BTgBwLN6EiL7cpETUY+zyn/f/f+l47+u+zB5kN7qLYJOme64ng== X-Received: by 2002:a05:6870:4414:b0:169:c27f:abf5 with SMTP id u20-20020a056870441400b00169c27fabf5mr4082876oah.15.1675404544827; Thu, 02 Feb 2023 22:09:04 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id dt10-20020a0568705a8a00b00163b3472300sm616309oab.2.2023.02.02.22.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:04 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] clk: samsung: Set dev in samsung_clk_init() Date: Fri, 3 Feb 2023 00:09:21 -0600 Message-Id: <20230203060924.8257-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220906_157245_AA294377 X-CRM114-Status: GOOD ( 16.88 ) 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 Some drivers set dev to context in order to implement PM. Make that part of samsung_clk_init() instead of assigning `ctx->dev = dev' separately. No functional change. Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk-exynos4.c | 2 +- drivers/clk/samsung/clk-exynos4412-isp.c | 3 +-- drivers/clk/samsung/clk-exynos5250.c | 2 +- drivers/clk/samsung/clk-exynos5420.c | 2 +- drivers/clk/samsung/clk-s3c2410.c | 2 +- drivers/clk/samsung/clk-s3c2412.c | 2 +- drivers/clk/samsung/clk-s3c2443.c | 2 +- drivers/clk/samsung/clk-s3c64xx.c | 2 +- drivers/clk/samsung/clk-s5pv210.c | 2 +- drivers/clk/samsung/clk.c | 19 +++++++++++++++---- drivers/clk/samsung/clk.h | 5 +++-- 11 files changed, 27 insertions(+), 16 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 7a9994144d72..d7dbb3858347 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -1251,7 +1251,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(reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS); 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 0b6390e04533..1470c15e95da 100644 --- a/drivers/clk/samsung/clk-exynos4412-isp.c +++ b/drivers/clk/samsung/clk-exynos4412-isp.c @@ -121,8 +121,7 @@ static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev) if (!exynos4x12_save_isp) return -ENOMEM; - ctx = samsung_clk_init(reg_base, CLK_NR_ISP_CLKS); - ctx->dev = dev; + ctx = samsung_clk_init(dev, reg_base, CLK_NR_ISP_CLKS); platform_set_drvdata(pdev, ctx); diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index f1cb69aea10e..92fb09922f28 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c @@ -797,7 +797,7 @@ static void __init exynos5250_clk_init(struct device_node *np) panic("%s: unable to determine soc\n", __func__); } - ctx = samsung_clk_init(reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_of_register_fixed_ext(ctx, exynos5250_fixed_rate_ext_clks, diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 46cac4980be2..1e0cbf762408 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -1587,7 +1587,7 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5x_soc = soc; - ctx = samsung_clk_init(reg_base, CLK_NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks, diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index 8483d4a2be03..a30db5b5b0d3 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c @@ -332,7 +332,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(reg_base, NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, NR_CLKS); hws = ctx->clk_data.hws; /* Register external clocks only in non-dt cases */ diff --git a/drivers/clk/samsung/clk-s3c2412.c b/drivers/clk/samsung/clk-s3c2412.c index 8f12a40790d4..c4a9abbdd1e8 100644 --- a/drivers/clk/samsung/clk-s3c2412.c +++ b/drivers/clk/samsung/clk-s3c2412.c @@ -216,7 +216,7 @@ void __init s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(reg_base, NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, NR_CLKS); /* Register external clocks only in non-dt cases */ if (!np) diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index 6db8147f0aa2..be0a378d0a92 100644 --- a/drivers/clk/samsung/clk-s3c2443.c +++ b/drivers/clk/samsung/clk-s3c2443.c @@ -353,7 +353,7 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(reg_base, NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, NR_CLKS); /* Register external clocks only in non-dt cases */ if (!np) diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index 47e9d19486dc..d27a1f73f077 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c @@ -405,7 +405,7 @@ void __init s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f, panic("%s: failed to map registers\n", __func__); } - ctx = samsung_clk_init(reg_base, NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, NR_CLKS); hws = ctx->clk_data.hws; /* Register external clocks. */ diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c index b0ab6bc9d21d..cd85342e4ddb 100644 --- a/drivers/clk/samsung/clk-s5pv210.c +++ b/drivers/clk/samsung/clk-s5pv210.c @@ -743,7 +743,7 @@ static void __init __s5pv210_clk_init(struct device_node *np, struct samsung_clk_provider *ctx; struct clk_hw **hws; - ctx = samsung_clk_init(reg_base, NR_CLKS); + ctx = samsung_clk_init(NULL, reg_base, NR_CLKS); hws = ctx->clk_data.hws; samsung_clk_register_mux(ctx, early_mux_clks, diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 2436223aac1a..912dfbe5ac20 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -53,9 +53,19 @@ struct samsung_clk_reg_dump *samsung_clk_alloc_reg_dump( return rd; } -/* setup the essentials required to support clock lookup using ccf */ -struct samsung_clk_provider * __init samsung_clk_init(void __iomem *base, - unsigned long nr_clks) +/** + * samsung_clk_init() - Create and initialize a clock provider object + * @dev: CMU device to enable runtime PM, or NULL if RPM is not needed + * @base: Start address (mapped) of CMU registers + * @nr_clks: Total clock count to allocate in clock provider object + * + * Setup the essentials required to support clock lookup using Common Clock + * Framework. + * + * Return: Allocated and initialized clock provider object. + */ +struct samsung_clk_provider * __init samsung_clk_init(struct device *dev, + void __iomem *base, unsigned long nr_clks) { struct samsung_clk_provider *ctx; int i; @@ -67,6 +77,7 @@ struct samsung_clk_provider * __init samsung_clk_init(void __iomem *base, for (i = 0; i < nr_clks; ++i) ctx->clk_data.hws[i] = ERR_PTR(-ENOENT); + ctx->dev = dev; ctx->reg_base = base; ctx->clk_data.num = nr_clks; spin_lock_init(&ctx->lock); @@ -341,7 +352,7 @@ struct samsung_clk_provider * __init samsung_cmu_register_one( return NULL; } - ctx = samsung_clk_init(reg_base, cmu->nr_clk_ids); + ctx = samsung_clk_init(NULL, reg_base, cmu->nr_clk_ids); if (cmu->pll_clks) samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks); diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index 98753b0e5055..3fd6c0868921 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -16,6 +16,7 @@ /** * struct samsung_clk_provider: information about clock provider * @reg_base: virtual address for the register base. + * @dev: clock provider device needed for runtime PM. * @lock: maintains exclusion between callbacks for a given clock-provider. * @clk_data: holds clock related data like clk_hw* and number of clocks. */ @@ -337,8 +338,8 @@ struct samsung_cmu_info { const char *clk_name; }; -struct samsung_clk_provider *samsung_clk_init(void __iomem *base, - unsigned long nr_clks); +struct samsung_clk_provider *samsung_clk_init(struct device *dev, + void __iomem *base, unsigned long nr_clks); void samsung_clk_of_add_provider(struct device_node *np, struct samsung_clk_provider *ctx); void samsung_clk_of_register_fixed_ext( From patchwork Fri Feb 3 06:09:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127030 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 F1985C636CC for ; Fri, 3 Feb 2023 06:10:27 +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=RUnxb/vtEmEyE9cWDw/Leb5iczdxWbhxD4DKigrLp+c=; b=iclCS06K6v+qx0 XiPUCMREPfUz+0g3x+0p7LmmbcU0XLAScan+lyJAVaVe9t1TGkgswDu3XeS3AP02WBpYbVPhVVpWF yCqZKESk5ssdB8YQbfhBAdeXTEjmcfnlmj39iJxl1SUhuEkRXIqyUsnOec4wkRVz0shfevfiynX1O +9/23mxzOwRAE4jeFsa3JQpaCteYNBoZZIElNzsTM6Je3uB2RF3bahnXSG5Py/mZMzmrfS3SWRDDU Q2EYUIn+zloZQdPXVZol55QS9ZYXq039dYXjbDSF3NuHAYuXFhgRvKUL7Ygy2m22dS+QnwqPw60b4 4Za5cjZS2kMJTsFDSDOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpGO-000VNH-2Y; Fri, 03 Feb 2023 06:09:32 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpFy-000VDw-Sz for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:08 +0000 Received: by mail-oi1-x22e.google.com with SMTP id c15so3208875oic.8 for ; Thu, 02 Feb 2023 22:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=hGIg7efke9/GL7H7bmsFZBD24JST84PhbzNPSEQBcS0=; b=Gx3JJFW5AmJIEM9E+xl833GmF3UeU0UV7IAeZXgwSRigqwr6QDvIOTnKo2EkuZ4JBm K6DrHnjSeSmJoCoIh6M/27+RN5mb5f6nZnwydy6yGgHr5+c2x/Z/vTkvNBHWsFSIKOpf yqBBFZG3BxR8P0ZWskEJmKvJzK5oBXAGVqV8OaVNtpBtmnKKLrgqMfFGVTYFO0jnuafZ L07xfeGNfL/12k31PvlMuOkPxYvmIGj5X/g8e3VKVSP9wwjzij/2lODHwYoa/INsTTxX 7vYWKYSZi7zg3snrVindw0/0CaZt2VE9G4cWIdCmR/NSkvFIqDOxNLaAdXmaAok7Z3Yt po+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hGIg7efke9/GL7H7bmsFZBD24JST84PhbzNPSEQBcS0=; b=JvW471FbEl5PmRCLSeGZmHFtJQo+q7MV3yF+KhR+zhx1v1VaXZIgj+3iuZN5CC+r17 9mFg6ZcwZQFekGqCQUHIH/Omw7iO9KEhMqkv6CzYymf/LZElZIa/xkjIK4YHgu/gF9BM 8hieAUJQUDDtyB02l8pOk52S6B/uQlqM5URZnYS1lyVmdNLmeZf0az4fO5n9JDAohdEb 7yziSF5FRL7HG2pyNQYCzGokvPrebStshWEI+0BpUM7C6YR7x4Ol8TcKpdfF5OlzRvqU OwTsID+7rS3pykk9Mc8JmHsXdwgQlpniIgNOo4mpGFLpNjY5gtum74f8iFNm1OX5p1uC Qu4g== X-Gm-Message-State: AO0yUKWIiT4BatfwtIZzk31B84ozGpfme9bIFnrF5Bie7YB8WAW6R0SI JXJYUvfP+E/X76Io6hl2tOHo8Q== X-Google-Smtp-Source: AK7set9l6Dt74iN/9jGW0AVDX6iku7ADOWzwYFPSr3Jo+72AyEvOoSgqinrOWBW3zn3x3g4yc+CPKA== X-Received: by 2002:a05:6808:6182:b0:378:2467:5cf0 with SMTP id dn2-20020a056808618200b0037824675cf0mr3949544oib.25.1675404545734; Thu, 02 Feb 2023 22:09:05 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id d2-20020a056830044200b0066ca61230casm757387otc.8.2023.02.02.22.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:05 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] clk: samsung: Extract clocks registration to common function Date: Fri, 3 Feb 2023 00:09:22 -0600 Message-Id: <20230203060924.8257-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220906_963294_F5217EA6 X-CRM114-Status: GOOD ( 14.93 ) 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 It might be useful to have a separate clocks registration function, so it can be called from different users. Extract that common code from samsung_cmu_register_one() to samsung_cmu_register_clocks(). Also make that new function global as it's going to be used in other modules further. Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk.c | 46 ++++++++++++++++++++++++--------------- drivers/clk/samsung/clk.h | 2 ++ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 912dfbe5ac20..b6701905f254 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -335,6 +335,33 @@ void samsung_clk_extended_sleep_init(void __iomem *reg_base, } #endif +/** + * samsung_cmu_register_clocks() - Register all clocks provided in CMU object + * @ctx: Clock provider object + * @cmu: CMU object with clocks to register + */ +void __init samsung_cmu_register_clocks(struct samsung_clk_provider *ctx, + const struct samsung_cmu_info *cmu) +{ + if (cmu->pll_clks) + samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks); + if (cmu->mux_clks) + samsung_clk_register_mux(ctx, cmu->mux_clks, cmu->nr_mux_clks); + if (cmu->div_clks) + samsung_clk_register_div(ctx, cmu->div_clks, cmu->nr_div_clks); + if (cmu->gate_clks) + samsung_clk_register_gate(ctx, cmu->gate_clks, + cmu->nr_gate_clks); + if (cmu->fixed_clks) + samsung_clk_register_fixed_rate(ctx, cmu->fixed_clks, + cmu->nr_fixed_clks); + if (cmu->fixed_factor_clks) + samsung_clk_register_fixed_factor(ctx, cmu->fixed_factor_clks, + cmu->nr_fixed_factor_clks); + if (cmu->cpu_clks) + samsung_clk_register_cpu(ctx, cmu->cpu_clks, cmu->nr_cpu_clks); +} + /* * Common function which registers plls, muxes, dividers and gates * for each CMU. It also add CMU register list to register cache. @@ -353,29 +380,12 @@ struct samsung_clk_provider * __init samsung_cmu_register_one( } ctx = samsung_clk_init(NULL, reg_base, cmu->nr_clk_ids); + samsung_cmu_register_clocks(ctx, cmu); - if (cmu->pll_clks) - samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks); - if (cmu->mux_clks) - samsung_clk_register_mux(ctx, cmu->mux_clks, - cmu->nr_mux_clks); - if (cmu->div_clks) - samsung_clk_register_div(ctx, cmu->div_clks, cmu->nr_div_clks); - if (cmu->gate_clks) - samsung_clk_register_gate(ctx, cmu->gate_clks, - cmu->nr_gate_clks); - if (cmu->fixed_clks) - samsung_clk_register_fixed_rate(ctx, cmu->fixed_clks, - cmu->nr_fixed_clks); - if (cmu->fixed_factor_clks) - samsung_clk_register_fixed_factor(ctx, cmu->fixed_factor_clks, - cmu->nr_fixed_factor_clks); if (cmu->clk_regs) samsung_clk_extended_sleep_init(reg_base, cmu->clk_regs, cmu->nr_clk_regs, cmu->suspend_regs, cmu->nr_suspend_regs); - if (cmu->cpu_clks) - samsung_clk_register_cpu(ctx, cmu->cpu_clks, cmu->nr_cpu_clks); samsung_clk_of_add_provider(np, ctx); diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index 3fd6c0868921..ab9c3d7a25b3 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -377,6 +377,8 @@ void samsung_clk_register_pll(struct samsung_clk_provider *ctx, void samsung_clk_register_cpu(struct samsung_clk_provider *ctx, const struct samsung_cpu_clock *list, unsigned int nr_clk); +void samsung_cmu_register_clocks(struct samsung_clk_provider *ctx, + const struct samsung_cmu_info *cmu); struct samsung_clk_provider *samsung_cmu_register_one( struct device_node *, const struct samsung_cmu_info *); From patchwork Fri Feb 3 06:09:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127032 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 75E63C636D7 for ; Fri, 3 Feb 2023 06:10:50 +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=ASpxcKG6WqUf7LQHb0BuVdbVSIw/c+pJlPrglC4ldoI=; b=EMnkLm0f8KZnRQ EDRz+IZO0zh4RkHm5qs+Ea5c2yjKxNA+S+VUPfvq2E67oPDP/VYnTQy1bGAnTK/KM/kVaijBSFifC 3UQ01DJJxjcrK7SXojVHQSz68JvSfKhY/ibkxB5KAFJiomEAfkPEfc6Gyv/zsMzx+Fkk2dfPPYkvs UZsyaqs7+z/DCZmaJdEg6Yg/4ipLlTOmONlC+LGp6rmfyHu43YgfQ4tXVyYsFW6cWVLom4oHHW6UR ShOsftdrtVJecK/TvcB4SVUZGNxlrl27FeweyB0E5jAeU0PgdVpByTBefB74hr/0X9Skv3qX7ndGU 73dmtkC1TowlJUroCWkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpGl-000VXB-Kl; Fri, 03 Feb 2023 06:09:56 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpG0-000VEh-5r for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:09 +0000 Received: by mail-oi1-x230.google.com with SMTP id c15so3208902oic.8 for ; Thu, 02 Feb 2023 22:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ZFGVK/R7IvXJOW0JsMc8GEWmuVlJkiZ67MQd9wzMPas=; b=f0lvHe+RIZvGMkZgAgwmx4KWkCK8Zp2/njSt24OxDyyvDxYCbuU0NB9H1p+yJaaWaC R39D0bvTg9tZI5OMnUlRROenCJ3zbi5yCRr8gu3E6BJqHVFR14wHLR3TB3sK0rKjLH3M jaMGlcn4dA0BcMl5zGDe0S4Cqimu2CUGQDE2ri3Ddy9cA4Ajj1+wFi5o6kjJ8v1PCuQ6 6rhN3Vgs3RPulsjgWxlP4jEnghopSIoqgqPzYMA27MNLILBSkoMTBzXQb7vrSdDtyCIt doPnT9HRvNAIibc1HFN392CohVYLs6cbUtaPcQS7CLPLSyZbON6vm0211k5nzFcNEmQ8 OtiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZFGVK/R7IvXJOW0JsMc8GEWmuVlJkiZ67MQd9wzMPas=; b=3n0dZZW97eeRL7SYzf01vkKoydXLvrq2urtsQtuBUaKHyfRG5p69T3LV5MhRqwLtoy kzN+W8lrt+6Jt3Yh9eN1rJ6/Hjlqyretp1anJns8amQATIPA+rvwQuixNnTTfHzaOFhW Ivm5LGG7kTDTUGwmpyzH3/ZvKxDjk0+OVy835F444W/2ibBe4zaOEfqq7xvD73aHDFLT Tf28b6W2+HoESeFsyj7QcxXK52jYNLx/83SEKoYEWtDyZzCxQttBhwET5tZbD4IrMBeM +KcXBhhUi+fh03XhShdOrWziVgGxxymhwrrSNZOqbU5qEnNHGJ5SexchWbq3YbcwlQfS l4kw== X-Gm-Message-State: AO0yUKUGqVVdsXuV4YognJslbKgblJmCzWdvvBwtBVYE7XmcDJnqWTsJ awRLia1bTeYxXlTb5IHvwW9ujw== X-Google-Smtp-Source: AK7set+hV484I96OKvacApzyMi+v5hfOAHMNKGNJFQ9Su+QkLejUQN0sLqyh94gC3wT3nxzXwkVYVg== X-Received: by 2002:a05:6808:2021:b0:378:976a:9cb5 with SMTP id q33-20020a056808202100b00378976a9cb5mr6123598oiw.0.1675404546859; Thu, 02 Feb 2023 22:09:06 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id l18-20020a056830055200b00684152e9ff2sm781235otb.0.2023.02.02.22.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:06 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] clk: samsung: Extract parent clock enabling to common function Date: Fri, 3 Feb 2023 00:09:23 -0600 Message-Id: <20230203060924.8257-6-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220908_238580_E244B0BF X-CRM114-Status: GOOD ( 15.33 ) 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 Extract parent clock enabling from exynos_arm64_register_cmu() to dedicated function. No functional change. No functional change. Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk-exynos-arm64.c | 53 +++++++++++++++++--------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c index b921b9a1134a..361663223a24 100644 --- a/drivers/clk/samsung/clk-exynos-arm64.c +++ b/drivers/clk/samsung/clk-exynos-arm64.c @@ -56,6 +56,41 @@ static void __init exynos_arm64_init_clocks(struct device_node *np, iounmap(reg_base); } +/** + * exynos_arm64_enable_bus_clk - Enable parent clock of specified CMU + * + * @dev: Device object; may be NULL if this function is not being + * called from platform driver probe function + * @np: CMU device tree node + * @cmu: CMU data + * + * Keep CMU parent clock running (needed for CMU registers access). + * + * Return: 0 on success or negative error code on failure. + */ +static int __init exynos_arm64_enable_bus_clk(struct device *dev, + struct device_node *np, const struct samsung_cmu_info *cmu) +{ + struct clk *parent_clk; + + if (!cmu->clk_name) + return 0; + + if (dev) + parent_clk = clk_get(dev, cmu->clk_name); + else + parent_clk = of_clk_get_by_name(np, cmu->clk_name); + + if (IS_ERR(parent_clk)) { + pr_err("%s: could not find bus clock %s; err = %ld\n", + __func__, cmu->clk_name, PTR_ERR(parent_clk)); + return PTR_ERR(parent_clk); + } + + clk_prepare_enable(parent_clk); + return 0; +} + /** * exynos_arm64_register_cmu - Register specified Exynos CMU domain * @dev: Device object; may be NULL if this function is not being @@ -72,23 +107,7 @@ static void __init exynos_arm64_init_clocks(struct device_node *np, void __init exynos_arm64_register_cmu(struct device *dev, struct device_node *np, const struct samsung_cmu_info *cmu) { - /* Keep CMU parent clock running (needed for CMU registers access) */ - if (cmu->clk_name) { - struct clk *parent_clk; - - if (dev) - parent_clk = clk_get(dev, cmu->clk_name); - else - parent_clk = of_clk_get_by_name(np, cmu->clk_name); - - if (IS_ERR(parent_clk)) { - pr_err("%s: could not find bus clock %s; err = %ld\n", - __func__, cmu->clk_name, PTR_ERR(parent_clk)); - } else { - clk_prepare_enable(parent_clk); - } - } - + exynos_arm64_enable_bus_clk(dev, np, cmu); exynos_arm64_init_clocks(np, cmu->clk_regs, cmu->nr_clk_regs); samsung_cmu_register_one(np, cmu); } From patchwork Fri Feb 3 06:09:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 13127033 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 3FE4CC61DA4 for ; Fri, 3 Feb 2023 06:11:18 +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=VBUhNF3YYYPC2LNYUu/uIZS12Q/jiuddoi1RbwDe65s=; b=Qjq3FPiI3Bybcm UnxOEZ2y0+PgNiMioZbd/fLx6l0InxKLgoLzbKIb4e3rzFqyZH5UsRtLE42b1WZZzZIVDdo2lSYvK q0ZDxVUoS7I6Al/suT6HpJl7ZQ/efMbfDT9WF2Lx2Ts7xMD8OCxfNneTN6U28H+69GwpYqUDsf637 eK8LTexElMHUoR3rkhD5iJGNSAffRGDakeJG3IdwRWzgSH6p6dqX319gpDsN4vU8foe5F+ydG/DQD JQFDjT2MA8BzOR9yTIMYCz4y6D/RFJAuGi72gCtwbsjWqOm/w/BlYBXgOsVNSczIRUy9Z37bv/iZs /K/o21zGLu/RUu+c8Lkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpH7-000ViG-FJ; Fri, 03 Feb 2023 06:10:17 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpG1-000VFG-UN for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:09:12 +0000 Received: by mail-oi1-x234.google.com with SMTP id o66so3367302oia.6 for ; Thu, 02 Feb 2023 22:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=0IqpAkKor6fl5E4XSr9QGiievSOatqmS3OMiyiol20s=; b=c/dW1USsQ0CUt1XxlU02JP1cXNkqT6NfXxGzcs1Ft4xgqUF/1Rna/0M9nhdKZd5mkt N7HsIA3+rGGC5Cdm1zZ5vQooj5tZTH81jZuGoGERjJfC4tMPf3NJ40w7uTl62lyQQntg Bs0PMOItWAIrkJbPBf+YULOeUymQk7QBb4x/+jNOOz/4flrpb88FVg7ELUPKjmk8QnRK ZdX9eHw1JZuFP9JemJ+qYq9BrhzMLJWo8UScF73qzHlX3EQbBOQrSVeNIGvED5NctR2v a0CbxKVjVeR7oy29LMdLbjKSIT7/HmkW+MC3Kgu3m8o2SNmYxNihKyEERVesmTaUokOI +72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=0IqpAkKor6fl5E4XSr9QGiievSOatqmS3OMiyiol20s=; b=qq7HQM3mDbUQfjhu6tHoQmMy8PFbI5l4r5sDvqU1V1BjzBv3NJhZeJ/LN7aUjCWd3R To8aeQRGZSrPCh09yog8kyrsg9hR2LsXdQNTQTs3i7BQBmMeQjmkuhJL5kIAsoQMJe8W TPB94P8wci+7lQVXLZTvjtXtveU442MOTTY0WyfS/yFwuawxdj8M4Y4ztYP54sja7I8I RyjxAZpE7N2HKxgAL4R4KYfu88HNY65Z11KklBQLsQy7uvPYwzCzliYbQcAhtcAzw7v5 7dj176D6d6gIV4COmsBGeF7zXtn2Bs0TA/XvtoxgI/3CRHYxvVYpJ5UM7iLFozVqXGYD 5p6A== X-Gm-Message-State: AO0yUKWwDAgbPMO/g3B59TVjMJ4f8MXwuEz0I3WkbfTvKTLS5cXAXKLq tCuVhaxfbG3OrvEwbz9oUciRFg== X-Google-Smtp-Source: AK7set+d5MmbqVvE61qGcmqJg4T/E5+DAbkkhNzwI0o6IcbGYOKG4900HZJzQFwKKT1AmOnACZe6bA== X-Received: by 2002:aca:a8ca:0:b0:367:281:d2a5 with SMTP id r193-20020acaa8ca000000b003670281d2a5mr3893466oie.30.1675404547956; Thu, 02 Feb 2023 22:09:07 -0800 (PST) Received: from localhost ([136.49.140.41]) by smtp.gmail.com with ESMTPSA id n13-20020a9d6f0d000000b006884c42a38asm754340otq.41.2023.02.02.22.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 22:09:07 -0800 (PST) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi Cc: Tomasz Figa , Alim Akhtar , Chanho Park , David Virag , Sumit Semwal , Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] clk: samsung: exynos5433: Extract PM support to common ARM64 layer Date: Fri, 3 Feb 2023 00:09:24 -0600 Message-Id: <20230203060924.8257-7-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203060924.8257-1-semen.protsenko@linaro.org> References: <20230203060924.8257-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-20230202_220910_024693_FD95D563 X-CRM114-Status: GOOD ( 27.69 ) 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 Exynos5433 clock driver implements PM support internally, which might be also useful for other Exynos clock drivers. Extract all PM related code from clk-exynos5433 to common ARM64 functions. Signed-off-by: Sam Protsenko --- drivers/clk/samsung/clk-exynos-arm64.c | 170 ++++++++++++++++++++++++- drivers/clk/samsung/clk-exynos-arm64.h | 3 + drivers/clk/samsung/clk-exynos5433.c | 157 +---------------------- 3 files changed, 174 insertions(+), 156 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c index 361663223a24..4479c1c54dd2 100644 --- a/drivers/clk/samsung/clk-exynos-arm64.c +++ b/drivers/clk/samsung/clk-exynos-arm64.c @@ -10,6 +10,8 @@ */ #include #include +#include +#include #include "clk-exynos-arm64.h" @@ -21,6 +23,19 @@ #define GATE_OFF_START 0x2000 #define GATE_OFF_END 0x2fff +struct exynos_arm64_cmu_data { + struct samsung_clk_reg_dump *clk_save; + unsigned int nr_clk_save; + const struct samsung_clk_reg_dump *clk_suspend; + unsigned int nr_clk_suspend; + + struct clk *clk; + struct clk **pclks; + int nr_pclks; + + struct samsung_clk_provider *ctx; +}; + /** * exynos_arm64_init_clocks - Set clocks initial configuration * @np: CMU device tree node with "reg" property (CMU addr) @@ -76,10 +91,16 @@ static int __init exynos_arm64_enable_bus_clk(struct device *dev, if (!cmu->clk_name) return 0; - if (dev) + if (dev) { + struct exynos_arm64_cmu_data *data; + parent_clk = clk_get(dev, cmu->clk_name); - else + data = dev_get_drvdata(dev); + if (data) + data->clk = parent_clk; + } else { parent_clk = of_clk_get_by_name(np, cmu->clk_name); + } if (IS_ERR(parent_clk)) { pr_err("%s: could not find bus clock %s; err = %ld\n", @@ -91,6 +112,46 @@ static int __init exynos_arm64_enable_bus_clk(struct device *dev, return 0; } +static int __init exynos_arm64_cmu_prepare_pm(struct device *dev, + const struct samsung_cmu_info *cmu) +{ + struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev); + int i; + + data->clk_save = samsung_clk_alloc_reg_dump(cmu->clk_regs, + cmu->nr_clk_regs); + if (!data->clk_save) + return -ENOMEM; + + data->nr_clk_save = cmu->nr_clk_regs; + data->clk_suspend = cmu->suspend_regs; + data->nr_clk_suspend = cmu->nr_suspend_regs; + data->nr_pclks = of_clk_get_parent_count(dev->of_node); + if (!data->nr_pclks) + return 0; + + data->pclks = devm_kcalloc(dev, sizeof(struct clk *), data->nr_pclks, + GFP_KERNEL); + if (!data->pclks) { + kfree(data->clk_save); + return -ENOMEM; + } + + for (i = 0; i < data->nr_pclks; i++) { + struct clk *clk = of_clk_get(dev->of_node, i); + + if (IS_ERR(clk)) { + kfree(data->clk_save); + while (--i >= 0) + clk_put(data->pclks[i]); + return PTR_ERR(clk); + } + data->pclks[i] = clk; + } + + return 0; +} + /** * exynos_arm64_register_cmu - Register specified Exynos CMU domain * @dev: Device object; may be NULL if this function is not being @@ -111,3 +172,108 @@ void __init exynos_arm64_register_cmu(struct device *dev, exynos_arm64_init_clocks(np, cmu->clk_regs, cmu->nr_clk_regs); samsung_cmu_register_one(np, cmu); } + +/** + * exynos_arm64_register_cmu_pm - Register Exynos CMU domain with PM support + * + * @pdev: Platform device object + * @set_manual: If true, set gate clocks to manual mode + * + * It's a version of exynos_arm64_register_cmu() with PM support. Should be + * called from probe function of platform driver. + * + * Return: 0 on success, or negative error code on error. + */ +int __init exynos_arm64_register_cmu_pm(struct platform_device *pdev, + bool set_manual) +{ + const struct samsung_cmu_info *cmu; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct exynos_arm64_cmu_data *data; + void __iomem *reg_base; + int ret; + + cmu = of_device_get_match_data(dev); + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + platform_set_drvdata(pdev, data); + + ret = exynos_arm64_cmu_prepare_pm(dev, cmu); + if (ret) + return ret; + + ret = exynos_arm64_enable_bus_clk(dev, NULL, cmu); + if (ret) + return ret; + + if (set_manual) + exynos_arm64_init_clocks(np, cmu->clk_regs, cmu->nr_clk_regs); + + reg_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(reg_base)) + return PTR_ERR(reg_base); + + data->ctx = samsung_clk_init(dev, reg_base, cmu->nr_clk_ids); + + /* + * Enable runtime PM here to allow the clock core using runtime PM + * for the registered clocks. Additionally, we increase the runtime + * PM usage count before registering the clocks, to prevent the + * clock core from runtime suspending the device. + */ + pm_runtime_get_noresume(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + + samsung_cmu_register_clocks(data->ctx, cmu); + samsung_clk_of_add_provider(dev->of_node, data->ctx); + pm_runtime_put_sync(dev); + + return 0; +} + +int exynos_arm64_cmu_suspend(struct device *dev) +{ + struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev); + int i; + + samsung_clk_save(data->ctx->reg_base, data->clk_save, + data->nr_clk_save); + + for (i = 0; i < data->nr_pclks; i++) + clk_prepare_enable(data->pclks[i]); + + /* For suspend some registers have to be set to certain values */ + samsung_clk_restore(data->ctx->reg_base, data->clk_suspend, + data->nr_clk_suspend); + + for (i = 0; i < data->nr_pclks; i++) + clk_disable_unprepare(data->pclks[i]); + + clk_disable_unprepare(data->clk); + + return 0; +} + +int exynos_arm64_cmu_resume(struct device *dev) +{ + struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev); + int i; + + clk_prepare_enable(data->clk); + + for (i = 0; i < data->nr_pclks; i++) + clk_prepare_enable(data->pclks[i]); + + samsung_clk_restore(data->ctx->reg_base, data->clk_save, + data->nr_clk_save); + + for (i = 0; i < data->nr_pclks; i++) + clk_disable_unprepare(data->pclks[i]); + + return 0; +} diff --git a/drivers/clk/samsung/clk-exynos-arm64.h b/drivers/clk/samsung/clk-exynos-arm64.h index 0dd174693935..969979e714bc 100644 --- a/drivers/clk/samsung/clk-exynos-arm64.h +++ b/drivers/clk/samsung/clk-exynos-arm64.h @@ -16,5 +16,8 @@ void exynos_arm64_register_cmu(struct device *dev, struct device_node *np, const struct samsung_cmu_info *cmu); +int exynos_arm64_register_cmu_pm(struct platform_device *pdev, bool set_manual); +int exynos_arm64_cmu_suspend(struct device *dev); +int exynos_arm64_cmu_resume(struct device *dev); #endif /* __CLK_EXYNOS_ARM64_H */ diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c index eb72bf2aaee8..ed43233649ae 100644 --- a/drivers/clk/samsung/clk-exynos5433.c +++ b/drivers/clk/samsung/clk-exynos5433.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,7 @@ #include "clk.h" #include "clk-cpu.h" +#include "clk-exynos-arm64.h" #include "clk-pll.h" /* @@ -5478,160 +5478,9 @@ static const struct samsung_cmu_info imem_cmu_info __initconst = { .clk_name = "aclk_imem_200", }; -struct exynos5433_cmu_data { - struct samsung_clk_reg_dump *clk_save; - unsigned int nr_clk_save; - const struct samsung_clk_reg_dump *clk_suspend; - unsigned int nr_clk_suspend; - - struct clk *clk; - struct clk **pclks; - int nr_pclks; - - /* must be the last entry */ - struct samsung_clk_provider ctx; -}; - -static int __maybe_unused exynos5433_cmu_suspend(struct device *dev) -{ - struct exynos5433_cmu_data *data = dev_get_drvdata(dev); - int i; - - samsung_clk_save(data->ctx.reg_base, data->clk_save, - data->nr_clk_save); - - for (i = 0; i < data->nr_pclks; i++) - clk_prepare_enable(data->pclks[i]); - - /* for suspend some registers have to be set to certain values */ - samsung_clk_restore(data->ctx.reg_base, data->clk_suspend, - data->nr_clk_suspend); - - for (i = 0; i < data->nr_pclks; i++) - clk_disable_unprepare(data->pclks[i]); - - clk_disable_unprepare(data->clk); - - return 0; -} - -static int __maybe_unused exynos5433_cmu_resume(struct device *dev) -{ - struct exynos5433_cmu_data *data = dev_get_drvdata(dev); - int i; - - clk_prepare_enable(data->clk); - - for (i = 0; i < data->nr_pclks; i++) - clk_prepare_enable(data->pclks[i]); - - samsung_clk_restore(data->ctx.reg_base, data->clk_save, - data->nr_clk_save); - - for (i = 0; i < data->nr_pclks; i++) - clk_disable_unprepare(data->pclks[i]); - - return 0; -} - static int __init exynos5433_cmu_probe(struct platform_device *pdev) { - const struct samsung_cmu_info *info; - struct exynos5433_cmu_data *data; - struct samsung_clk_provider *ctx; - struct device *dev = &pdev->dev; - void __iomem *reg_base; - int i; - - info = of_device_get_match_data(dev); - - data = devm_kzalloc(dev, - struct_size(data, ctx.clk_data.hws, info->nr_clk_ids), - GFP_KERNEL); - if (!data) - return -ENOMEM; - ctx = &data->ctx; - - reg_base = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(reg_base)) - return PTR_ERR(reg_base); - - for (i = 0; i < info->nr_clk_ids; ++i) - ctx->clk_data.hws[i] = ERR_PTR(-ENOENT); - - ctx->clk_data.num = info->nr_clk_ids; - ctx->reg_base = reg_base; - ctx->dev = dev; - spin_lock_init(&ctx->lock); - - data->clk_save = samsung_clk_alloc_reg_dump(info->clk_regs, - info->nr_clk_regs); - if (!data->clk_save) - return -ENOMEM; - data->nr_clk_save = info->nr_clk_regs; - data->clk_suspend = info->suspend_regs; - data->nr_clk_suspend = info->nr_suspend_regs; - data->nr_pclks = of_clk_get_parent_count(dev->of_node); - - if (data->nr_pclks > 0) { - data->pclks = devm_kcalloc(dev, sizeof(struct clk *), - data->nr_pclks, GFP_KERNEL); - if (!data->pclks) { - kfree(data->clk_save); - return -ENOMEM; - } - for (i = 0; i < data->nr_pclks; i++) { - struct clk *clk = of_clk_get(dev->of_node, i); - - if (IS_ERR(clk)) { - kfree(data->clk_save); - while (--i >= 0) - clk_put(data->pclks[i]); - return PTR_ERR(clk); - } - data->pclks[i] = clk; - } - } - - if (info->clk_name) - data->clk = clk_get(dev, info->clk_name); - clk_prepare_enable(data->clk); - - platform_set_drvdata(pdev, data); - - /* - * Enable runtime PM here to allow the clock core using runtime PM - * for the registered clocks. Additionally, we increase the runtime - * PM usage count before registering the clocks, to prevent the - * clock core from runtime suspending the device. - */ - pm_runtime_get_noresume(dev); - pm_runtime_set_active(dev); - pm_runtime_enable(dev); - - if (info->pll_clks) - samsung_clk_register_pll(ctx, info->pll_clks, - info->nr_pll_clks); - if (info->mux_clks) - samsung_clk_register_mux(ctx, info->mux_clks, - info->nr_mux_clks); - if (info->div_clks) - samsung_clk_register_div(ctx, info->div_clks, - info->nr_div_clks); - if (info->gate_clks) - samsung_clk_register_gate(ctx, info->gate_clks, - info->nr_gate_clks); - if (info->fixed_clks) - samsung_clk_register_fixed_rate(ctx, info->fixed_clks, - info->nr_fixed_clks); - if (info->fixed_factor_clks) - samsung_clk_register_fixed_factor(ctx, info->fixed_factor_clks, - info->nr_fixed_factor_clks); - - samsung_clk_of_add_provider(dev->of_node, ctx); - pm_runtime_put_sync(dev); - - return 0; + return exynos_arm64_register_cmu_pm(pdev, false); } static const struct of_device_id exynos5433_cmu_of_match[] = { @@ -5679,7 +5528,7 @@ static const struct of_device_id exynos5433_cmu_of_match[] = { }; static const struct dev_pm_ops exynos5433_cmu_pm_ops = { - SET_RUNTIME_PM_OPS(exynos5433_cmu_suspend, exynos5433_cmu_resume, + SET_RUNTIME_PM_OPS(exynos_arm64_cmu_suspend, exynos_arm64_cmu_resume, NULL) SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)