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: 125247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2153809vqg; Mon, 24 Jul 2023 18:03:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzs+H5eWwM2vetl8hvL+b4n65+iAZJV7FcBbfQrEx88m2ouKXBcNKPONzWi+0emB1xqpfd X-Received: by 2002:a2e:9b17:0:b0:2b6:dec9:2812 with SMTP id u23-20020a2e9b17000000b002b6dec92812mr6838783lji.33.1690247023406; Mon, 24 Jul 2023 18:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690247023; cv=none; d=google.com; s=arc-20160816; b=xVVlF/GVUsFvlCBLz5k0depz0X9Kl/hvN8il1N2A7+1WfnHF1zKLITcVjp08PP7oSJ bqmuqiOckfWsn3ieXhqFZdVPJGQfdqpnTOa+zANd2HvNf4+YrvTcEM3JYFNPr+Rdi4/o qYEBsxD3LVxEX+oueWl2fDZJl/jvRu3hK3xeVC+CUcaRNcoAaKeibXN/ShVL30LPULkn WgKueahYpz78FB/lODR0f/kCiNZL1qWFCInmoh/MLcSOTIgq2Ha68UPy/Hmk4/2MaAJ7 MvoaCmZRBg9PXbWaWnQhVLis6zerf16z84nspRP7nkKVTbz/f6edN2EOi2yiwPsZN++O aNsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VMbfUxW794QAHn8O7xONypqcfryJoPheb9KV8GnOtDw=; fh=6Mc74FF3OQV6bFtoyhaPGVVIvW7iVJ2B0Bkc3DyV1zo=; b=rmZP6sAHuB4Y+GGkMUV8Eqxep50qVSlBVYE4VGlklP96xqtCJnsuE2T3achSj6HFJA EqCGB9zf25ixBy5L+nCXtyo2/z4FXJWcl5A5Pv7NITK6+7/aX73O5hNCRoowaEkoeuuz b6ef7ztKrTiaPeeMLgCltt6zuJJPK+9bOp5O2Z2RSrnlvPSzoLHl1/1oxdJyvggmAuYv qkzY1V1gmMsywTex09xZGu1l3dM5qbPk/901sP/wPONh5v0BSJ9wTdwe3Hpf7pHj+KKD K0Pb1ifGhKKNkP24HfBCh7ClZgm188TyJ97rf/JBGbUVC4u/Jya9EMSR3Skd8A+149DV QyUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=fIFB8VFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me13-20020a170906aecd00b00982762e2cc4si7014106ejb.775.2023.07.24.18.03.19; Mon, 24 Jul 2023 18:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=fIFB8VFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbjGYAnB (ORCPT + 99 others); Mon, 24 Jul 2023 20:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjGYAm7 (ORCPT ); Mon, 24 Jul 2023 20:42:59 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F395A173E for ; Mon, 24 Jul 2023 17:42:50 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-348d6bc349eso5524235ab.0 for ; Mon, 24 Jul 2023 17:42:50 -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=aaVKMspyjj7QJXfez33kLyOgnX7juaJJ82QDbLFW4aLTdUHjxspUFm5kyiW+kQ7hST zBIX5yKmZjheT7oBtwSsD7XchnNYo74neCZ2AOWe6tZLFmU32C79kscAu6tVBv+284w+ oQ8MCFNCszM6fT8TFt79a/XFAK9HIMhigI7IDucOVPVPlOFm4OtxeXn/elV5rLwviHRi OlXhiMKtvUNOyT/xcMvFgrbLN9x/gC5+a3dtq4cJfO7Wzu34pmb1kIKDhFOFdMCjz0I5 22yMcO8yEfcjbmWVaWPUl69FLjPrWsnJlGR6GHwW2/FzkobOeiKhm9FAisDb9PxvyuKQ 12SA== X-Gm-Message-State: ABy/qLadvFrJKJrYizQWW9ie9363GKu+E0a9TdyVJs+xsYXBmbPsSIzN j5z6WNk5ksWc2xZAUOiu7iFyIw== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772352462506112258 X-GMAIL-MSGID: 1772352462506112258 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: 125257 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2169950vqg; Mon, 24 Jul 2023 18:47:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGMxRU+w87lyb0gqNXoFRCcB46Ai+3TpvoRTcBdA8Wb8LnBGfKwBRAgDsqrghBFxOEkYlD3 X-Received: by 2002:a25:d2d6:0:b0:d0a:fa7f:2fbf with SMTP id j205-20020a25d2d6000000b00d0afa7f2fbfmr5116565ybg.48.1690249667839; Mon, 24 Jul 2023 18:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690249667; cv=none; d=google.com; s=arc-20160816; b=bGlWhfuRAPeFvrmLA0Y5lzoY+tTNjDOaCfjWS16oyxaeqc81JwCepCq2VMTi2r7Ck6 uf1sjwVPqFww4C9QgR3I3nZjsZZmotMteuwZSheVcaXRy9iYFv8TRR0Ci6imho6aDJnj 7H2hzHG/Pe4Swm0x2LtiSCMBM81Ef7IcYUApbcI5kx8PAN0eWutJQmuySB6Y5ckqTPGM m/nOOa3MOC/UF9EXWD4HrARE2NjKEI4rvDhxCBUSc5A56+xSo88CsYDxNt1IXhRYymT4 X5jO7nZYmzEVcyOGHbFUcvFyrAT2qnQ+tAISUONKTzArjZswlHQ33X3UWtwaa/Vt547B IiZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cb3Vvpjv1LmFtv57q/x9jijKmz7uqCPq02odS2uEdoE=; fh=c18xmANgcW2kOO3w8g1Fr9CSWOxaOKK/VpT/WGyCUXg=; b=Ysd7Cso1v4grPm3rUfQg0OXzL+1Gg+XEkDEjOO71FVqvcfskUN2tqA/wNu4uaTCcY5 h6wQyXhNzmKIu6nse1ogOywWCRRS13bDk4JowS/ffY1nz7yOrRTZf/IqDrmSJh66Rq6l vwJy3FsufumKzxNOByK7f2kug/s4Q/B4rC/XKfSl6PTHrwhh1cFC5hWFcKl3YLjPq3KT gosZifi7hWdBuSvEf1wOHjN7IOJWxzUux1M69NuZcWhQAO1/WMF1qgVuzOJjttVJkm00 mj2Abmkn7np9r0WPGD1UHKea71miZPnmIwV+ZIF2/1lGG2YUctFoWY8tDtuoCnrxzUOs EpxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=NJz5Pqvz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q21-20020a656a95000000b0054ff0e193fesi10800768pgu.225.2023.07.24.18.47.35; Mon, 24 Jul 2023 18:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=NJz5Pqvz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjGYAnG (ORCPT + 99 others); Mon, 24 Jul 2023 20:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjGYAnA (ORCPT ); Mon, 24 Jul 2023 20:43:00 -0400 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908FE1993 for ; Mon, 24 Jul 2023 17:42:52 -0700 (PDT) Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-565f3881cbeso3483773eaf.2 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=Vd1QQviVPUeLaUNxt8fNTGRHDwUadGfhiYe06F0Cs5WEYjm1f7KuI+e7w0d7LAirLI grpMTPWDEAtGRs/0SW9bHik33DC5eld/5IcRBQkv7G2Sb3EmbuGnzf9v3h7xhnmHgfBn cWRkcEi/qHOn5oBE9eylcsS28UWT+K7vijVAgAx0Ko48BHcd+1y8x4lCQrZjMg5f8g9m T0g0+PzG9ebws//qazoEoZyE5S/GNMxBdAodtyU4z9ecYI48F+NzpAZZvW1MDw9rSOR3 Ox+Nu8N37G3GVNrkJbIcRVCcgrcLTxafG69uNnG3875+OyhEoPqfSoTL74UyHFnbOO9U DFOQ== X-Gm-Message-State: ABy/qLYIQayWdsIEylhpa5jfHMrm+L2HUnQMZsHH0sj1J+AyjBrF8bcr iV7OUcnixyVS4kpCC1TDy3pegw== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772355235543439680 X-GMAIL-MSGID: 1772355235543439680 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");