From patchwork Mon Jul 17 21:03:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 121602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1345308vqt; Mon, 17 Jul 2023 14:07:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7r1XUF7taMXAlFrKMnp7FqBppRyEnfy+lIglcOBjFiZrIcoOM98a4q4BitAxUt32w4YS6 X-Received: by 2002:a17:902:f68c:b0:1b8:c8bc:c81b with SMTP id l12-20020a170902f68c00b001b8c8bcc81bmr14025985plg.21.1689628078087; Mon, 17 Jul 2023 14:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689628078; cv=none; d=google.com; s=arc-20160816; b=uENOowF7SsxkeOQj+PXrjS23AUE+5ib0HV3BntOJAxjK/2426Sh2S37irzJWktZ2d5 Pvc93U3nzJCqkM2E/QW7Wq1Tzk9qKZwSaokwKa7teCYIqHeFo7Y3fV5kRK44NJ4fhkKZ GquucXxuLQbkRrYkNHSdkCG7Rgbb5Ce9WPIQBzPip/c278T32bqW5LImebMGuzB3Bmv+ dcZW85qq3Hwgu9ZXoqib0FBigA/07xuwbB5urEABHV963089URW/mF/4r0Cj6XPAyQuU UHA1UNDeoYmzaNfKHNcxIv4WB3bp9/f0wlg4fS3Jvw9uFnRGuRFfzSF35ZMZHstQCL7b DbfQ== 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=o1J3PrW+KELul59iWMsbn0NuwlLctvPQuEIvtb6UgWY=; fh=V9Xck45qPFN0TvedmPO96tSa2mJAy70z60JjH1TFHjo=; b=wNPQGkgZPbbUH1y5sJQuq0++cpyuKkJhKUghuZOaKnF3t0OPnogxZPbWfSiBecuzo7 SPlXz2jyRv8XS94XphhyUauwN2dwIYWWkXohQxYjnJQPS2H8eE0xn15+iSj+OzFhPa3k 4wAUlkXOaucWMyF8lb4e5bgLx5Jd3qjuKj1D7JPgPtTAfVeVQezzmvzm73cuPm8ktIFg c1HxHtJLOKVs8f1Ge/rbKkCmMVLjBgFu2Rc/PSpZwPkyziB+e/rzoAMAJZny7jiS8cgB Nc/2k5MtC5+8j3eFGSQxn7fHVuEBv72gJjld99CsFIylq8B1lG9dFgjOvAgiOC/PK6ZA 2HQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Ku8I0fun; 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 t12-20020a17090340cc00b001ab089f7329si448138pld.73.2023.07.17.14.07.44; Mon, 17 Jul 2023 14:07:58 -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=Ku8I0fun; 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 S230502AbjGQVEB (ORCPT + 99 others); Mon, 17 Jul 2023 17:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjGQVD7 (ORCPT ); Mon, 17 Jul 2023 17:03:59 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A989121 for ; Mon, 17 Jul 2023 14:03:58 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-666edfc50deso3020272b3a.0 for ; Mon, 17 Jul 2023 14:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689627838; x=1692219838; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=o1J3PrW+KELul59iWMsbn0NuwlLctvPQuEIvtb6UgWY=; b=Ku8I0funEqrw0TX6rYaGXYYIHrttNyMTFVvrgZZGUya0wgLsLsxRwq4M1BtrN7gi6j PCbSF9+xrLXT26UHSIGTbFUp2b1xnr4ITMhmHMJVPsQOblGAQLmEmKV2mdsWTorMTljb JmsVEGyxnFlw4/sOEAReNkqylFfUlMcYHnHgi/7e4ELG/3iJrZ2+KTCIVkNy6+f56CkI xx603jKovuSBX1guw5etp3sUmolhDDjr/apHn5nHypc+NOj+g2iuKidRWC+hxQdjdG5P 0EzE2Qih3mmpiiLY3oho1QgNIPLTv4n6B5DKMqNi3hLG/W9LFX2K835TLTMHoTXkMWLk oJFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689627838; x=1692219838; 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=o1J3PrW+KELul59iWMsbn0NuwlLctvPQuEIvtb6UgWY=; b=WxntL5agXbDGARJQh5cxQIfMOCo6v+haqrI921bzqIZEpzkgIPtdfA5AQRxo1PiO2Y w5aBBMxIwxs8Otl/K8QMYkHH386Cp/OultG3W94g/AuZm2w+pC0dj4MYPDzm1ne+DRWG aXB5zthjb/eEt2d8wbiu9P6agjVt0ozG0TJVJ20ohcolbrQa7iPBFAgdiVu5D/NkwVh/ HqTBUKL7fNa7eJxyketcOhGKKUopdYGYqxtRVNIGsBbox5L8Mqs+5EkRPLU3v1X6W/Md qcQTFWjX++WqsoG3nN/IGlPKCPp+k3aPageEjNRl7n7KcPomU0rzqWYDi+A+oxw6y5/p dFow== X-Gm-Message-State: ABy/qLbc2m8BWQYCUlJJyCFRNITWtPTk+RDztnW1hQNSAMBbU3beh4Xe UffKK0BF0d3mmQc4GMcq3gaBsA== X-Received: by 2002:a05:6a20:8425:b0:12b:40d3:aeb1 with SMTP id c37-20020a056a20842500b0012b40d3aeb1mr16273429pzd.25.1689627837974; Mon, 17 Jul 2023 14:03:57 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id j24-20020aa78d18000000b006732786b5f1sm191915pfe.213.2023.07.17.14.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 14:03:57 -0700 (PDT) From: Samuel Holland To: Michael Turquette , Stephen Boyd Cc: Samuel Holland , Paul Walmsley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] clk: analogbits: Allow building the library as a module Date: Mon, 17 Jul 2023 14:03:55 -0700 Message-Id: <20230717210356.2794736-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 autolearn=unavailable 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: 1771703451470790910 X-GMAIL-MSGID: 1771703451470790910 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 --- drivers/clk/analogbits/Kconfig | 2 +- drivers/clk/analogbits/wrpll-cln28hpc.c | 6 ++++++ 2 files changed, 7 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..760b51031795 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,6 @@ 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_LICENSE("GPL"); From patchwork Mon Jul 17 20:53:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 121600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1344870vqt; Mon, 17 Jul 2023 14:07:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7q9Lt2ttqZVhdOlQEVwvJToX86AK/N5QScBu1wylkP39oIO8i42kOkw98uCiwVZWUSmBr X-Received: by 2002:a05:6a00:418c:b0:668:8ad5:778f with SMTP id ca12-20020a056a00418c00b006688ad5778fmr12867733pfb.17.1689628021706; Mon, 17 Jul 2023 14:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689628021; cv=none; d=google.com; s=arc-20160816; b=r1jAA2CNCIScq5UhmJhhiblE5Y/u8c9LGdjhTR1K57hAGJuoAi4Vbhr8Bmx3qbVAtS MLl5IA42yugaCHGhwN/55rhlvR4EbSCPHj22aT4jDX/xtsVEIDuIdGTW8VZN42HcquCT qyfAg1CgoRUqBF+XtmwHxxZLWDA3lmspYdk3lyg7VJyMecVEq2tejrq1UAPOS702YOd7 OD/jJvC3ZcaibmT0VrVkZ2Didw1UphzItW3wAnxyIg+pvXU87d4Jxc4ab3luFLtd0KZq m7QmydgHYNT9IsUGrGbKvAzDwnX0o77jgrEx1PAY6vL3iQCSh9YA9DwF5md27RpIWIyg vJ2w== 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=rPXSCcl7xyJKFXuJ0sfDEh5nIT26utMEmgdVi+YRduc=; fh=sbkPInvQTTWwR8kcDHsLRpLGMwcswGQUr2GMWQdoqBc=; b=0sZ0XOkovjGAlT8QBP4LzVCA953GqUqSkqwgbu3ufGSXvKeIl0z/1KZnE/BpWJrdFh iggLGdJliQczQJlom/7LJ+i0Y01cSjb/O6gE10ViP7ncee4RwlDIcze2DLmDW5Nr+gZV 6gRURoBn+TyVmiYbDfUBirD6Ygvm3rBgdk3WvIEmybCnBLWLlX7RCRLtJgy7hQY3l83N RhJYWMxVBp/n6ISUwO61vHyAMk9v7eRoktU+QAmphQ4jNOw2uQirid6bLfwyLFCM1wVY IZxYkbqbB0KEOjgm6rAXzm5JdOxeVGZJSj2PwZ1bUgJs9jklvxhV4o6EEYy1JNy1v3j8 kc+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=VzNOXhf+; 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 t38-20020a634466000000b0055aff745fe2si368566pgk.406.2023.07.17.14.06.48; Mon, 17 Jul 2023 14:07:01 -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=VzNOXhf+; 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 S231314AbjGQUyY (ORCPT + 99 others); Mon, 17 Jul 2023 16:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbjGQUyE (ORCPT ); Mon, 17 Jul 2023 16:54:04 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1371E10C4 for ; Mon, 17 Jul 2023 13:54:02 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-262c42d3fafso3061544a91.0 for ; Mon, 17 Jul 2023 13:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689627241; x=1692219241; 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=rPXSCcl7xyJKFXuJ0sfDEh5nIT26utMEmgdVi+YRduc=; b=VzNOXhf+impRuQDbYHrHRlqKEi4dq4XPmar0nNzv6mvU84AiDYv9Z8hDwrbcuh/mS0 AgX5iAz4at+qFL9Qlc9V9bUmdwa+KLbCIrTMUe+/rwDoMrjNS01UNaZCPQPFEYNXMfGq XrOpEMqW2ID2b5Kv7fLAl/V9ydXP2MBLtM4tZYZkv79U6vGznTx8gSRmlBPtNuu83jN/ +CZvicmJK8bHZurlYy33pU0fBP0I6KRiOPK42VmiMb77zsTfwcERc3OiLqnHUiPRx0Od 41lB6iSmwxSSceokNRnKYx2C1p2NehPKLu8wdS5NoDzDgEpmu7ywu/phkTrFWHNF6ApV tLcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689627241; x=1692219241; 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=rPXSCcl7xyJKFXuJ0sfDEh5nIT26utMEmgdVi+YRduc=; b=DpXUHIcNAqIUi52SWbM1TMxM8VpAiWFB2H8E8kp8sCtB3ZUxBCVlBuPeAvkMDx7OFy ixqZUQkDtZdEZrLeNB75xMFjDF4doQXgMCWl9eXJvGiVDh6EDhjbGmwbiNq7e6TtC1f1 YNNwGff3ssfx3NgQlFujs/bJpRCAsXOXYKF9gnGoeWIP15RgRsUcoFWunUexRdcpM8Yi OU9ZJm3vYfbPTaul28zxFNcM46zDEVf/BaFlIWvGIkdHHcZ708sZjsujurtGh04p0Fed VeDOeQ71DJVKq2mDINeZY1Oekm6fj9bvkp6nAIqESLesKH4S0wqB1V2wApZbvz3n4eT6 tOtA== X-Gm-Message-State: ABy/qLZpUC/ek1Usct/t65G6wZe64e+efcshFd5bASWlEhZjIlAVcWJ8 CmwP0EsbHmv4kH8pL6LJV6r9EiTWq0dBLQ9GlGlIQw== X-Received: by 2002:a17:90a:a614:b0:263:f3d0:7ea2 with SMTP id c20-20020a17090aa61400b00263f3d07ea2mr13459056pjq.8.1689627241539; Mon, 17 Jul 2023 13:54:01 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id z8-20020a63b048000000b0053031f7a367sm206991pgo.85.2023.07.17.13.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 13:54:01 -0700 (PDT) From: Samuel Holland To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Frank Rowand Cc: Samuel Holland , Palmer Dabbelt , Paul Walmsley , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 2/2] gpio: sifive: Allow building the driver as a module Date: Mon, 17 Jul 2023 13:53:57 -0700 Message-Id: <20230717205357.2779473-3-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230717205357.2779473-1-samuel.holland@sifive.com> References: <20230717205357.2779473-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_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 1771703392394635998 X-GMAIL-MSGID: 1771703392394635998 This can reduce the kernel image size in multiplatform configurations. Signed-off-by: Samuel Holland --- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-sifive.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index e382dfebad7c..1a8e8a8c85d6 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -564,7 +564,7 @@ config GPIO_SAMA5D2_PIOBU maintain their value during backup/self-refresh. config GPIO_SIFIVE - bool "SiFive GPIO support" + tristate "SiFive GPIO support" depends on OF_GPIO select IRQ_DOMAIN_HIERARCHY select GPIO_GENERIC diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index 745e5f67254e..5941a817491c 100644 --- a/drivers/gpio/gpio-sifive.c +++ b/drivers/gpio/gpio-sifive.c @@ -277,4 +277,6 @@ static struct platform_driver sifive_gpio_driver = { .of_match_table = sifive_gpio_match, }, }; -builtin_platform_driver(sifive_gpio_driver) +module_platform_driver(sifive_gpio_driver) + +MODULE_LICENSE("GPL");