From patchwork Mon Jan 28 18:04:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 156830 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3720822jaa; Mon, 28 Jan 2019 10:06:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Y+iGzRwfhXQ9EApZ45maSymlfq+WFY9OOr4db9/+8eGnQ/isCvfOOx2R+EeNOabhyKD7I X-Received: by 2002:a63:a553:: with SMTP id r19mr20572704pgu.53.1548698763293; Mon, 28 Jan 2019 10:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548698763; cv=none; d=google.com; s=arc-20160816; b=H40ifuUK0SUu6sIJm8PlPha2/z3bREMqlXJkb5Wx5FeyDH976fOx1vITsfr8wmRez/ 0K8hoK5TLxtz20xBLJbU377NmXnncVswK4vptNUzk8qpSW7hdpXTc/gsol9Stxoi6CcP 6Shf+UTpwtnJbmaw/OWBAe7JR7DfnLe4eJCmBDIIL0i4AJ47R4rOPngaYfqrG9OxQ5Pn Z26OWKYTS82yV14RR+rUEzZZPdQkILxWm7Dq1xNR4hdzdwL+SwaZ3Cw5ONBwzpzwitqr KR91ovxQRCUuUGVdDnGyK07f31dPNw2CI5tnJKDN4MhNBQbILXd9szyc39NCa4H5ssEQ d4ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QOU9VANN01oYzixQ2SqSDGpNeAWTMaXr29IPiC4ltR8=; b=Hj/+fq2ftw2N8Oh075UnDYdlhZthRAnRK/Y/eGQ6z/7Kt9MBSslKaEO6D6SZFM7+bu e6KG66qj/149yBj6tGSIIIE9F8GGXuNX7O+gIropvDubVtqqIMS8hoCsZCqllbASBKwM PbTCVYMoW8RxySbnkhlqkJGiKbODc4/wb6jXv9sYfXifjV1+lFYd9pTwq6DSLji2vUNh 0x6Fd9UrNUTn1WJvA9nV0SFDDwzpM3nw4ESFD8WPSN49iFNbJSImB2tt/uzdimOsn6xH 8ScV2vaB6o2XDsW9ljLBxSK/tOTo2L07R+pX+S6E+/1GXCx+utAhVp48izuDXEqNf1ox cUhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=UNS3dypv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si30696917pfh.229.2019.01.28.10.06.02; Mon, 28 Jan 2019 10:06:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=UNS3dypv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727598AbfA1SGA (ORCPT + 31 others); Mon, 28 Jan 2019 13:06:00 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52309 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbfA1SEy (ORCPT ); Mon, 28 Jan 2019 13:04:54 -0500 Received: by mail-wm1-f68.google.com with SMTP id m1so15022699wml.2 for ; Mon, 28 Jan 2019 10:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QOU9VANN01oYzixQ2SqSDGpNeAWTMaXr29IPiC4ltR8=; b=UNS3dypviQhzKGAyIux4UBVegpH8d7NnTH48r9ub3dKe9mRrUo+mRzH4sNRPwL6uK4 6DSUHtr+GsMJymI6ZORqhsVF9P1vbBgdqSCge4pF+ucLmwH2YPlv5/z4TtVPXc5mDeGa iz1m6RQaZblm5tpS0L6syaeQ9TwMpNVNQUyWPVKdHv5LHfp33X3Y8z8AA4OcMZHID5Vl zDiJK2qKneL+X/wsE6ecETzast5Su5MvCi9kuBxgvQaSTlznO9TvcLpNT4cExn9iMa85 9+nHj3JEHn9U31H3kkjbc+FEFbyhIS7Q0nuNf/eaZMIUA8ajQLF3NbJjOmbxbk2/t5KH ZxAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QOU9VANN01oYzixQ2SqSDGpNeAWTMaXr29IPiC4ltR8=; b=Qo7OHVADQBq9WgZGkLIS2Td8inBFb0DQOSaXgK6B0wl5kAX1KBmuQwqCA3PwyEt4np adcvqiBhPC6Be/G5tHv1qjM839t966kp88jh18IvfM0/1LVHnt7FBT2NBbo2Hd+bdBMw UqeZBzwyjPyu80nwdwQtdN1Kc1xWDx6N7Dh5S9QjbTIRYTrgtH7Gj+61uMX7soBGIB9B OqY67MRmPHMWNKOeLMpYnXgguvnMYvwwAq7zoVHBGXBM1Cy7YWn74tjnofjs6bCn1o3W saqLYJbSkhwaZ9frrD+805AbL0hgRW9PnRhfPe3fBYTxnUL6CNDsyQq4nlNKX85owCzt xOMg== X-Gm-Message-State: AJcUukfYmuEsqlYw5QkjlaOyzlHVlYGNN/s3x2AdmesqrSL4Kq9mBgTt T9zntYeMuiIgnsV2MFADJfHhFw== X-Received: by 2002:a1c:ce0e:: with SMTP id e14mr18991607wmg.53.1548698691559; Mon, 28 Jan 2019 10:04:51 -0800 (PST) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id p6sm145548193wrx.50.2019.01.28.10.04.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 10:04:50 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , Stephen Boyd , Michael Turquette Cc: Jerome Brunet , Kevin Hilman , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/14] clk: meson: take the pll driver out of clkc Date: Mon, 28 Jan 2019 19:04:22 +0100 Message-Id: <20190128180430.28689-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128180430.28689-1-jbrunet@baylibre.com> References: <20190128180430.28689-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Jerome Brunet --- drivers/clk/meson/axg.c | 1 + drivers/clk/meson/clk-pll.c | 13 +++++++---- drivers/clk/meson/clk-pll.h | 43 +++++++++++++++++++++++++++++++++++++ drivers/clk/meson/clkc.h | 30 -------------------------- drivers/clk/meson/gxbb.c | 1 + drivers/clk/meson/meson8b.c | 1 + 6 files changed, 55 insertions(+), 34 deletions(-) create mode 100644 drivers/clk/meson/clk-pll.h -- 2.20.1 diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c index 474412234633..8a3896fa343f 100644 --- a/drivers/clk/meson/axg.c +++ b/drivers/clk/meson/axg.c @@ -19,6 +19,7 @@ #include "clkc.h" #include "clk-regmap.h" +#include "clk-pll.h" #include "axg.h" #define IN_PREFIX "ee-in-" diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index afffc1547e20..4a8c68ae8801 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -32,11 +32,9 @@ #include #include #include -#include -#include -#include -#include "clkc.h" +#include "clk-regmap.h" +#include "clk-pll.h" static inline struct meson_clk_pll_data * meson_clk_pll_data(struct clk_regmap *clk) @@ -309,8 +307,15 @@ const struct clk_ops meson_clk_pll_ops = { .enable = meson_clk_pll_enable, .disable = meson_clk_pll_disable }; +EXPORT_SYMBOL_GPL(meson_clk_pll_ops); const struct clk_ops meson_clk_pll_ro_ops = { .recalc_rate = meson_clk_pll_recalc_rate, .is_enabled = meson_clk_pll_is_enabled, }; +EXPORT_SYMBOL_GPL(meson_clk_pll_ro_ops); + +MODULE_DESCRIPTION("Amlogic PLL driver"); +MODULE_AUTHOR("Carlo Caione "); +MODULE_AUTHOR("Jerome Brunet "); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/clk/meson/clk-pll.h b/drivers/clk/meson/clk-pll.h new file mode 100644 index 000000000000..5ccf0854d932 --- /dev/null +++ b/drivers/clk/meson/clk-pll.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2019 BayLibre, SAS. + * Author: Jerome Brunet + */ + +#ifndef __MESON_CLK_PLL_H +#define __MESON_CLK_PLL_H + +#include +#include +#include "parm.h" + +struct pll_params_table { + u16 m; + u16 n; +}; + +#define PLL_PARAMS(_m, _n) \ + { \ + .m = (_m), \ + .n = (_n), \ + } + +#define CLK_MESON_PLL_ROUND_CLOSEST BIT(0) + +struct meson_clk_pll_data { + struct parm en; + struct parm m; + struct parm n; + struct parm frac; + struct parm l; + struct parm rst; + const struct reg_sequence *init_regs; + unsigned int init_count; + const struct pll_params_table *table; + u8 flags; +}; + +extern const struct clk_ops meson_clk_pll_ro_ops; +extern const struct clk_ops meson_clk_pll_ops; + +#endif /* __MESON_CLK_PLL_H */ diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h index 58a343fa94e6..4857c8fa1ac4 100644 --- a/drivers/clk/meson/clkc.h +++ b/drivers/clk/meson/clkc.h @@ -11,34 +11,6 @@ #include "clk-regmap.h" #include "parm.h" -struct pll_params_table { - u16 m; - u16 n; -}; - -#define PLL_PARAMS(_m, _n) \ - { \ - .m = (_m), \ - .n = (_n), \ - } - -#define CLK_MESON_PLL_ROUND_CLOSEST BIT(0) - -struct meson_clk_pll_data { - struct parm en; - struct parm m; - struct parm n; - struct parm frac; - struct parm l; - struct parm rst; - const struct reg_sequence *init_regs; - unsigned int init_count; - const struct pll_params_table *table; - u8 flags; -}; - -#define to_meson_clk_pll(_hw) container_of(_hw, struct meson_clk_pll, hw) - struct meson_clk_mpll_data { struct parm sdm; struct parm sdm_en; @@ -81,8 +53,6 @@ struct meson_clk_dualdiv_data { }; /* clk_ops */ -extern const struct clk_ops meson_clk_pll_ro_ops; -extern const struct clk_ops meson_clk_pll_ops; extern const struct clk_ops meson_clk_cpu_ops; extern const struct clk_ops meson_clk_mpll_ro_ops; extern const struct clk_ops meson_clk_mpll_ops; diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index ecf9a8f6281c..813822ec5f57 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -15,6 +15,7 @@ #include "clkc.h" #include "gxbb.h" #include "clk-regmap.h" +#include "clk-pll.h" #define IN_PREFIX "ee-in-" diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 748552c5f6c8..9b35d5e08378 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -19,6 +19,7 @@ #include "clkc.h" #include "meson8b.h" #include "clk-regmap.h" +#include "clk-pll.h" static DEFINE_SPINLOCK(meson_clk_lock);