From patchwork Tue Jul 25 00:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13325474 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BE5FC001B0 for ; Tue, 25 Jul 2023 00:43:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231278AbjGYAnA (ORCPT ); Mon, 24 Jul 2023 20:43:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbjGYAm7 (ORCPT ); Mon, 24 Jul 2023 20:42:59 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 246BA173F for ; Mon, 24 Jul 2023 17:42:51 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3460815fde5so27656085ab.2 for ; Mon, 24 Jul 2023 17:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1690245770; x=1690850570; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VMbfUxW794QAHn8O7xONypqcfryJoPheb9KV8GnOtDw=; b=fIFB8VFZKbD/dM3uNH3oQmbNNxhTAEUbQdntzDoVvNdgl4OZ87Xcb24w1eZw/2Crb1 9P84i+uSNF4COjqedNXiWsezm2Lf+ypYM2ZKEm4g+4zufkNciK+1BnGXlQxpvocF7A1N TzwFrGNIpJRkjUhQkWCSO/k50PlZdU2rkclr4FvtU0A0g2cxkTUsLK+q/lVm7n5IBC/q uQVnpXtXdv6FYnCcaftbgNrAPHtopHfmubjBhW/thyh10ieXYYsY8DIVrbFQjFLMz1Fo QRtmHIBo9yWWeqVO98bF2Pu6Yh9bsV77uIekl2WGtTv7KbP0j2OOqE1Ftjz0J2nDfuqG P/bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690245770; x=1690850570; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VMbfUxW794QAHn8O7xONypqcfryJoPheb9KV8GnOtDw=; b=bsAp3k4N/u6stLHfuEY6p9eTD4R5TpgELrHpINFAdJZu++KvFHgAlKOc/iazHo9yN0 9jGX9TBjncE5mhtTnwY5ghj79AC28u/76lhHpZ9a9r6SOaeK4c2NeoC+nmP6KUYxZDxy woFYPgvircxM9Nar6H3wwB9rcja6IzG91Z9UWF73XEVJ/HPTNhEoy1zBJVpgb4Tcfa3c bFqrnTvlT5QBOTSh14VwwrfZsQzfNwpgbv4Vr31I9AWNK69g8b/LXwRpNK3WC93OQlYI WufaC5uZP4soHL/YPUymy5JT1MEZ7KhQs9teSKCyt0i9DO5uSJqixdLNGwvU4rnfGJG0 9NGg== X-Gm-Message-State: ABy/qLaLVIiFpQ2ksHcUZC/Njk0rlLbWOFOcEnLJ+jojcx0H9lPIclmk GBlk1zcyhntrM8WxktT6ZBOH+A== X-Google-Smtp-Source: APBJJlEtRPkgpTVNveS+DU2sHwiqbLYAX1gq+wxxyXTAj816C1YFo7Imtr9pSD1VToBMj3DAJvIphA== X-Received: by 2002:a05:6e02:20c2:b0:348:d52a:8f8 with SMTP id 2-20020a056e0220c200b00348d52a08f8mr1499328ilq.25.1690245770327; Mon, 24 Jul 2023 17:42:50 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id u135-20020a63798d000000b00553b9e0510esm9042655pgc.60.2023.07.24.17.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 17:42:49 -0700 (PDT) From: Samuel Holland To: Michael Turquette , Stephen Boyd Cc: Emil Renner Berthing , Samuel Holland , Paul Walmsley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] clk: analogbits: Allow building the library as a module Date: Mon, 24 Jul 2023 17:42:47 -0700 Message-Id: <20230725004248.381868-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org This library is only used by the SiFive PRCI driver. When that driver is built as a module, it makes sense to build this library as a module too. Signed-off-by: Samuel Holland --- Changes in v2: - Add MODULE_AUTHOR and MODULE_DESCRIPTION drivers/clk/analogbits/Kconfig | 2 +- drivers/clk/analogbits/wrpll-cln28hpc.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/clk/analogbits/Kconfig b/drivers/clk/analogbits/Kconfig index 1e291b185438..7d73db0fcd49 100644 --- a/drivers/clk/analogbits/Kconfig +++ b/drivers/clk/analogbits/Kconfig @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only config CLK_ANALOGBITS_WRPLL_CLN28HPC - bool + tristate diff --git a/drivers/clk/analogbits/wrpll-cln28hpc.c b/drivers/clk/analogbits/wrpll-cln28hpc.c index 09ca82356399..65d422a588e1 100644 --- a/drivers/clk/analogbits/wrpll-cln28hpc.c +++ b/drivers/clk/analogbits/wrpll-cln28hpc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -312,6 +313,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate, return 0; } +EXPORT_SYMBOL_GPL(wrpll_configure_for_rate); /** * wrpll_calc_output_rate() - calculate the PLL's target output rate @@ -349,6 +351,7 @@ unsigned long wrpll_calc_output_rate(const struct wrpll_cfg *c, return n; } +EXPORT_SYMBOL_GPL(wrpll_calc_output_rate); /** * wrpll_calc_max_lock_us() - return the time for the PLL to lock @@ -366,3 +369,8 @@ unsigned int wrpll_calc_max_lock_us(const struct wrpll_cfg *c) { return MAX_LOCK_US; } +EXPORT_SYMBOL_GPL(wrpll_calc_max_lock_us); + +MODULE_AUTHOR("Paul Walmsley "); +MODULE_DESCRIPTION("Analog Bits Wide-Range PLL library"); +MODULE_LICENSE("GPL"); From patchwork Tue Jul 25 00:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13325475 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84720EB64DD for ; Tue, 25 Jul 2023 00:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbjGYAnB (ORCPT ); Mon, 24 Jul 2023 20:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbjGYAnA (ORCPT ); Mon, 24 Jul 2023 20:43:00 -0400 Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F511999 for ; Mon, 24 Jul 2023 17:42:52 -0700 (PDT) Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-56352146799so3493861eaf.3 for ; Mon, 24 Jul 2023 17:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1690245772; x=1690850572; 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=cb3Vvpjv1LmFtv57q/x9jijKmz7uqCPq02odS2uEdoE=; b=NJz5PqvzKA92Zx6p/keou7qhR4dQjMQTGZKceWN2gyyZABNNExi9h9o6AsUcaoHajk l2JHilIUtr+3NvwhkDMJHlH7sAUJQRGdWWLCPwhZWey4RMvp8ksoxj3Q+7fb6fXuQu2S FIlXGfZFfparRohpUUi7z8Aa58ncz1lz0ihykjLa8mM3fdx9rBxIei/vy4OcsRc0OxRz Nbpp5bkxj6JFCFYct3COrH2sM7Lh8rrWSATU1tzBP0K7o3qOO/YomOpvn6ExEeKE0DBh 0V4ipv7rGgmC2k1QtEcavM2waIfEj41z2ths0NsmFwxUs2TlDUXssTL2sG+D8vkbbGNH ImPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690245772; x=1690850572; 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=cb3Vvpjv1LmFtv57q/x9jijKmz7uqCPq02odS2uEdoE=; b=akaXvKjlUCaOGnYbpStHuk058SMDrbnE2KjW1CiHT3Kw0hB5wpGsOQnfrggFm1Vlun h8NFAEsCjGxvX4l8JL6wVNlmADTV/rQcBtBNt1awEZ+PJHEq9t9mKCviYOk8iZwpubha ROHHfy87ycJYF/aXoSGXJlI8llZ36WhtoXvNZW6Lqtp5+kZnraOTZJ1/WKlkX//ooTPd /1SGE+wKWWnrqNsmwemMsPEL7kVy5oZpQkaHQrNT0HbDJqYNzQNN8jmurmgpK3BqhRW0 /nIq1/6V7ooWHN3rA/XzfvKRhEeSzw4IJnQnfXcloLw7kq5K9t/BAxi8nzAq+m9mWmhp mZoQ== X-Gm-Message-State: ABy/qLYY4rH566a2u5k5JRZYnOr2MmoZb7Hk00rA0T8LQhtS114J6wZn 9lQNYDnQoVUbax9FucuUrYv44w== X-Google-Smtp-Source: APBJJlEx7Lam5DEiLmiCEtXu/zND0jtP2cw7V2ldx1yMXL+Jl9Vp1s5OuX0uRGjreEk9+0xSHerGvQ== X-Received: by 2002:a05:6358:52d0:b0:132:d07d:8f3b with SMTP id z16-20020a05635852d000b00132d07d8f3bmr11668726rwz.28.1690245771818; Mon, 24 Jul 2023 17:42:51 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id u135-20020a63798d000000b00553b9e0510esm9042655pgc.60.2023.07.24.17.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 17:42:51 -0700 (PDT) From: Samuel Holland To: Michael Turquette , Stephen Boyd Cc: Emil Renner Berthing , Samuel Holland , Conor Dooley , Palmer Dabbelt , Paul Walmsley , Yang Li , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 2/2] clk: sifive: Allow building the driver as a module Date: Mon, 24 Jul 2023 17:42:48 -0700 Message-Id: <20230725004248.381868-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230725004248.381868-1-samuel.holland@sifive.com> References: <20230725004248.381868-1-samuel.holland@sifive.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org This can reduce the kernel image size in multiplatform configurations. Signed-off-by: Samuel Holland --- Changes in v2: - Add MODULE_AUTHOR and MODULE_DESCRIPTION drivers/clk/sifive/Kconfig | 2 +- drivers/clk/sifive/sifive-prci.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig index 2322f634a910..49597d95602e 100644 --- a/drivers/clk/sifive/Kconfig +++ b/drivers/clk/sifive/Kconfig @@ -10,7 +10,7 @@ menuconfig CLK_SIFIVE if CLK_SIFIVE config CLK_SIFIVE_PRCI - bool "PRCI driver for SiFive SoCs" + tristate "PRCI driver for SiFive SoCs" default ARCH_SIFIVE select RESET_CONTROLLER select RESET_SIMPLE diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index e317f3454e93..09a76248a710 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "sifive-prci.h" #include "fu540-prci.h" @@ -618,9 +619,8 @@ static struct platform_driver sifive_prci_driver = { }, .probe = sifive_prci_probe, }; +module_platform_driver(sifive_prci_driver); -static int __init sifive_prci_init(void) -{ - return platform_driver_register(&sifive_prci_driver); -} -core_initcall(sifive_prci_init); +MODULE_AUTHOR("Paul Walmsley "); +MODULE_DESCRIPTION("SiFive Power Reset Clock Interface (PRCI) driver"); +MODULE_LICENSE("GPL");