From nobody Sun Sep 22 11:33:36 2024 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 F1B37C433F5 for ; Wed, 2 Feb 2022 13:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344489AbiBBNtv (ORCPT ); Wed, 2 Feb 2022 08:49:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344475AbiBBNtr (ORCPT ); Wed, 2 Feb 2022 08:49:47 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C01C061744 for ; Wed, 2 Feb 2022 05:49:45 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id h125so1414370pgc.3 for ; Wed, 02 Feb 2022 05:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MyQRwL6DQLrE4xYNw8mcC0XQoGB02nn/7BR8gOXw12k=; b=NK4YiiG50hLCWW7qrayFHDYOcnbrImJU+goMnLjQsBS0f/CxfUGlpHC4pVOWiKG3fN rSRcfrqrLj7IqMGTuyIgDwVddgHV70pVyPfC5bvgF3zu7I+0lI8jMhUZtU8YY1kKicvG HTr7ZcyBbY3OePwWetp1EXwJPg+7X3uzvMl30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MyQRwL6DQLrE4xYNw8mcC0XQoGB02nn/7BR8gOXw12k=; b=MGCiwUxV+AQCL/7R/gATH2tkFZxuYI14pc/qciW6m2Lj+a4Ss6YHlBmaMvhxXddrkI 3TYb3ML+KlhuuEQ43/tCYQr9+l/Am0H10yNrXWIoRXX1avr9TGAdyg2jcIBWzUJ4QQhw vGSWwFTpaZCvPS+AiTJQRDzLLJO40t45XSYqyPIlKku2gnDBmOBl3Dw7YS+srmJ71Sfw /z13ofuikx7H6c6jS9KCP1xrCVwudMjwRzfbClCy4vWNjdXIk/pqPvBHKGgG+WhjHLbG z0Thtt9tHtq4nZ8f1S57u8sN9O83ZJeeuKMhb//XS98W8lwt44zNzCCMEYVOiflZHkDa 7EnA== X-Gm-Message-State: AOAM531lLw4WScvkkBPku7+DR5iqj8UgFba911h81tfqKhHe69Y2EL9Z IhLMGtkDkbrXxiraVcb/zbbHkQ== X-Google-Smtp-Source: ABdhPJxChN04B73w38gJYqKkMrX28K/rq+/lHQmKeoCJv2N1BvoTeTJonWoE6d0/86Dq5UJT8ZgveQ== X-Received: by 2002:aa7:9498:: with SMTP id z24mr29581913pfk.80.1643809784501; Wed, 02 Feb 2022 05:49:44 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:78b5:214c:c81:b9aa]) by smtp.gmail.com with ESMTPSA id w19sm27335684pfu.47.2022.02.02.05.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 05:49:44 -0800 (PST) From: Chen-Yu Tsai To: Stephen Boyd , Michael Turquette , Matthias Brugger Cc: Chen-Yu Tsai , Chun-Jie Chen , Miles Chen , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/31] clk: mediatek: gate: Internalize clk implementation Date: Wed, 2 Feb 2022 21:48:06 +0800 Message-Id: <20220202134834.690675-4-wenst@chromium.org> X-Mailer: git-send-email 2.35.0.rc2.247.g8bbb082509-goog In-Reply-To: <20220202134834.690675-1-wenst@chromium.org> References: <20220202134834.690675-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" struct mtk_clk_gate and mtk_clk_register_gate() are not used outside of the gate clk library. Only the API that handles a list of clks is used by the individual platform clk drivers. Internalize the parts that aren't used outside of the implementation. Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen --- drivers/clk/mediatek/clk-gate.c | 35 ++++++++++++++++++++++----------- drivers/clk/mediatek/clk-gate.h | 31 ++--------------------------- 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gat= e.c index 54921768bfba..e51cfd8c653c 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c @@ -11,11 +11,28 @@ #include #include #include +#include +#include #include #include +#include =20 #include "clk-gate.h" =20 +struct mtk_clk_gate { + struct clk_hw hw; + struct regmap *regmap; + int set_ofs; + int clr_ofs; + int sta_ofs; + u8 bit; +}; + +static inline struct mtk_clk_gate *to_mtk_clk_gate(struct clk_hw *hw) +{ + return container_of(hw, struct mtk_clk_gate, hw); +} + static u32 mtk_get_clockgating(struct clk_hw *hw) { struct mtk_clk_gate *cg =3D to_mtk_clk_gate(hw); @@ -140,17 +157,12 @@ const struct clk_ops mtk_clk_gate_ops_no_setclr_inv = =3D { }; EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_no_setclr_inv); =20 -struct clk *mtk_clk_register_gate( - const char *name, - const char *parent_name, - struct regmap *regmap, - int set_ofs, - int clr_ofs, - int sta_ofs, - u8 bit, - const struct clk_ops *ops, - unsigned long flags, - struct device *dev) +static struct clk *mtk_clk_register_gate(const char *name, + const char *parent_name, + struct regmap *regmap, int set_ofs, + int clr_ofs, int sta_ofs, u8 bit, + const struct clk_ops *ops, + unsigned long flags, struct device *dev) { struct mtk_clk_gate *cg; struct clk *clk; @@ -180,7 +192,6 @@ struct clk *mtk_clk_register_gate( =20 return clk; } -EXPORT_SYMBOL_GPL(mtk_clk_register_gate); =20 int mtk_clk_register_gates_with_dev(struct device_node *node, const struct mtk_gate *clks, int num, diff --git a/drivers/clk/mediatek/clk-gate.h b/drivers/clk/mediatek/clk-gat= e.h index 432b571d23b3..3d75521ba20c 100644 --- a/drivers/clk/mediatek/clk-gate.h +++ b/drivers/clk/mediatek/clk-gate.h @@ -7,42 +7,15 @@ #ifndef __DRV_CLK_GATE_H #define __DRV_CLK_GATE_H =20 -#include #include - -struct clk; - -struct mtk_clk_gate { - struct clk_hw hw; - struct regmap *regmap; - int set_ofs; - int clr_ofs; - int sta_ofs; - u8 bit; -}; - -static inline struct mtk_clk_gate *to_mtk_clk_gate(struct clk_hw *hw) -{ - return container_of(hw, struct mtk_clk_gate, hw); -} +#include +#include =20 extern const struct clk_ops mtk_clk_gate_ops_setclr; extern const struct clk_ops mtk_clk_gate_ops_setclr_inv; extern const struct clk_ops mtk_clk_gate_ops_no_setclr; extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv; =20 -struct clk *mtk_clk_register_gate( - const char *name, - const char *parent_name, - struct regmap *regmap, - int set_ofs, - int clr_ofs, - int sta_ofs, - u8 bit, - const struct clk_ops *ops, - unsigned long flags, - struct device *dev); - struct mtk_gate_regs { u32 sta_ofs; u32 clr_ofs; --=20 2.35.0.rc2.247.g8bbb082509-goog