From patchwork Thu Jun 22 14:13:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 13289213 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 77E91EB64DB for ; Thu, 22 Jun 2023 14:14:28 +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=/7nGAKpF0CEWpkjlVXPmAfaCMaezEAHwBZ36axxr0tk=; b=QemqnFqCfLYPb5 YMNDe1YJJuGy3KZfc7km5vhUKX7wYvxaJiw+oPt4FGWh+Xg7HNjoLQHi5uKYR/jbJpEURhDpdaPK2 QowgQTa+YtKHYVCrWgb/QaaIGiYtCy3xc1RbfHiZPYLiDX2KV6gebg88RdkHNlNHTWra1q7KnKtZS W7tf/DN/abXvS9wgVM+zoaQVbjNdEPR6JJ7S/dQxEyMD6wXYnBYmPWOzcCBSCLk21x85r1h1gdDpo 1w3oHRrC4yeWyWEHceGJcM+PGXuAelhC4DSbLSlbvLsY8sJTq5qujB3FahblJ4/r9R/AEZ6kXfePE kTar8XXNYi9WG0TWuW9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qCL4T-000vXE-26; Thu, 22 Jun 2023 14:14:01 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qCL4K-000vQt-24 for linux-arm-kernel@lists.infradead.org; Thu, 22 Jun 2023 14:13:54 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-66872d4a141so2941557b3a.1 for ; Thu, 22 Jun 2023 07:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687443231; x=1690035231; 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=uck4efyxSDISYaLtLdpY/TFsx4URlVDC4giZ3DrD9s0=; b=gKCrPDh8tcKTl9WlIrPCoDRriKK/t2zA27OoQ47QjaPoueNs+BFilnZ4/V2TunI8hz xF8I2fyLOXBNckRcIM615JSSHb5txh8ycE1HFSRY+vm3s06+VrlKGl7cuKx1v5nmRVwl RNbeR+4KS+Rf/EGFkZXf45x3KP0Bkcfwrx/P74Kftd6EqDrma08EbqlVpQMrYDSyStKA aUeOkz+6CdTH64UMGyfYkj0Zai1QXbUNUAs2IKTilK8xyHvEHo9JYr12cmwgNKgwbgDr BCqZUh9k7G5dWg5k8/tJGrxWHjcbEwFoeCoBgb5m7PHinWmV2r5+ww9oG6ftJ8OPWoyb gGiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687443231; x=1690035231; 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=uck4efyxSDISYaLtLdpY/TFsx4URlVDC4giZ3DrD9s0=; b=gQdLijNm6d+s063/raVt1cRr4pwT5tg0mDriOKGU/vl7GFEAw9XWvn5L2Rkvzphb70 I7ylqaSOy4xPrBxVqm0/1eFgwWr6W1QM6hMTOOlleIwH0Cgnf02VP4KUog3IDYLx4U5P TcOJ9Bnfz9ls/s+siO/4m419JLdmPkTflKSCTbDOoOWZytml+kOmEaz+7SctuVclchBN Rlu1nfsB7e0p7IbLD6ljhpI/UjqqyLzmcpoUi1EAHW19pudontfWgYia/uCYevfeWEvj nZTdlXvaLlEnW2PrgXkN3LO1Rmw+1noOzBfP532XK+eNBLLrEYfFGy3AOJ0/4+mdRkcP JCdA== X-Gm-Message-State: AC+VfDz4nvroOlXNBqnORS4XFFRm6tbyOY8rg/Ek81FpcYXzAtyF7zzv 4MJWFo5vyAh859DXfo2KRMw= X-Google-Smtp-Source: ACHHUZ6nW/obAwCMBV+IDoUm2Io38lec0kRWhmDvJ5FKR5pT0fSD98L544RPbtAyb9uRiFDQHqRxCg== X-Received: by 2002:a05:6a00:c8a:b0:66a:5260:36c3 with SMTP id a10-20020a056a000c8a00b0066a526036c3mr2530547pfv.17.1687443231390; Thu, 22 Jun 2023 07:13:51 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id i20-20020aa79094000000b0065a1b05193asm4604268pfa.185.2023.06.22.07.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 07:13:51 -0700 (PDT) From: Jacky Huang To: mturquette@baylibre.com, sboyd@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, soc@kernel.org, krzysztof.kozlowski+dt@linaro.org, schung@nuvoton.com, Jacky Huang Subject: [PATCH v3 1/3] clk: nuvoton: Add clk-ma35d1.h for driver extern functions Date: Thu, 22 Jun 2023 14:13:41 +0000 Message-Id: <20230622141343.13595-2-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622141343.13595-1-ychuang570808@gmail.com> References: <20230622141343.13595-1-ychuang570808@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230622_071352_680070_FC650E93 X-CRM114-Status: GOOD ( 17.12 ) 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 From: Jacky Huang Moved the declaration of extern functions ma35d1_reg_clk_pll() and ma35d1_reg_adc_clkdiv() from the .c files to the newly created header file clk-ma35d1.h. Signed-off-by: Jacky Huang --- drivers/clk/nuvoton/clk-ma35d1-divider.c | 7 ++----- drivers/clk/nuvoton/clk-ma35d1-pll.c | 5 ++--- drivers/clk/nuvoton/clk-ma35d1.c | 10 ++-------- drivers/clk/nuvoton/clk-ma35d1.h | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 drivers/clk/nuvoton/clk-ma35d1.h diff --git a/drivers/clk/nuvoton/clk-ma35d1-divider.c b/drivers/clk/nuvoton/clk-ma35d1-divider.c index 0c2bed47909a..bb8c23d2b895 100644 --- a/drivers/clk/nuvoton/clk-ma35d1-divider.c +++ b/drivers/clk/nuvoton/clk-ma35d1-divider.c @@ -9,6 +9,8 @@ #include #include +#include "clk-ma35d1.h" + struct ma35d1_adc_clk_div { struct clk_hw hw; void __iomem *reg; @@ -20,11 +22,6 @@ struct ma35d1_adc_clk_div { spinlock_t *lock; }; -struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, - struct clk_hw *parent_hw, spinlock_t *lock, - unsigned long flags, void __iomem *reg, - u8 shift, u8 width, u32 mask_bit); - static inline struct ma35d1_adc_clk_div *to_ma35d1_adc_clk_div(struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_adc_clk_div, hw); diff --git a/drivers/clk/nuvoton/clk-ma35d1-pll.c b/drivers/clk/nuvoton/clk-ma35d1-pll.c index e4c9f94e6796..ff3fb8b87c24 100644 --- a/drivers/clk/nuvoton/clk-ma35d1-pll.c +++ b/drivers/clk/nuvoton/clk-ma35d1-pll.c @@ -15,6 +15,8 @@ #include #include +#include "clk-ma35d1.h" + /* PLL frequency limits */ #define PLL_FREF_MAX_FREQ (200 * HZ_PER_MHZ) #define PLL_FREF_MIN_FREQ (1 * HZ_PER_MHZ) @@ -71,9 +73,6 @@ struct ma35d1_clk_pll { void __iomem *ctl2_base; }; -struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name, - struct clk_hw *parent_hw, void __iomem *base); - static inline struct ma35d1_clk_pll *to_ma35d1_clk_pll(struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_clk_pll, hw); diff --git a/drivers/clk/nuvoton/clk-ma35d1.c b/drivers/clk/nuvoton/clk-ma35d1.c index 297b11585f00..8dfa762494fe 100644 --- a/drivers/clk/nuvoton/clk-ma35d1.c +++ b/drivers/clk/nuvoton/clk-ma35d1.c @@ -12,6 +12,8 @@ #include #include +#include "clk-ma35d1.h" + static DEFINE_SPINLOCK(ma35d1_lock); #define PLL_MAX_NUM 5 @@ -60,14 +62,6 @@ static DEFINE_SPINLOCK(ma35d1_lock); #define PLL_MODE_FRAC 1 #define PLL_MODE_SS 2 -struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, - const char *name, struct clk_hw *parent_hw, - void __iomem *base); -struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, - struct clk_hw *hw, spinlock_t *lock, - unsigned long flags, void __iomem *reg, - u8 shift, u8 width, u32 mask_bit); - static const struct clk_parent_data ca35clk_sel_clks[] = { { .index = 0 }, /* HXT */ { .index = 1 }, /* CAPLL */ diff --git a/drivers/clk/nuvoton/clk-ma35d1.h b/drivers/clk/nuvoton/clk-ma35d1.h new file mode 100644 index 000000000000..3adee440f60a --- /dev/null +++ b/drivers/clk/nuvoton/clk-ma35d1.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2023 Nuvoton Technology Corp. + * Author: Chi-Fang Li + */ + +#ifndef __DRV_CLK_NUVOTON_MA35D1_H +#define __DRV_CLK_NUVOTON_MA35D1_H + +struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name, + struct clk_hw *parent_hw, void __iomem *base); + +struct clk_hw *ma35d1_reg_adc_clkdiv(struct device *dev, const char *name, + struct clk_hw *parent_hw, spinlock_t *lock, + unsigned long flags, void __iomem *reg, + u8 shift, u8 width, u32 mask_bit); + +#endif /* __DRV_CLK_NUVOTON_MA35D1_H */