mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
To: <linux-mips@linux-mips.org>, <linux-kernel@vger.kernel.org>,
	"Mike Turquette" <mturquette@linaro.org>, <sboyd@codeaurora.org>
Cc: Andrew Bresticker <abrestic@chromium.org>,
	James Hartley <james.hartley@imgtec.com>,
	<Govindraj.Raja@imgtec.com>, <Damien.Horsley@imgtec.com>,
	<cernekee@chromium.org>, James Hogan <james.hogan@imgtec.com>,
	Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Subject: [PATCH 7/9] clk: pistachio: Add a rate table for the MIPS PLL
Date: Thu, 21 May 2015 20:57:41 -0300	[thread overview]
Message-ID: <1432252663-31318-8-git-send-email-ezequiel.garcia@imgtec.com> (raw)
In-Reply-To: <1432252663-31318-1-git-send-email-ezequiel.garcia@imgtec.com>

This commit adds a rate parameter table, which makes it possible for
the MIPS PLL to support rate change.

Signed-off-by: Govindraj Raja <Govindraj.Raja@imgtec.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
---
 drivers/clk/pistachio/clk-pistachio.c | 12 +++++++++++-
 drivers/clk/pistachio/clk.h           | 12 ++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c
index 22a7ebd..0ac7429 100644
--- a/drivers/clk/pistachio/clk-pistachio.c
+++ b/drivers/clk/pistachio/clk-pistachio.c
@@ -145,8 +145,18 @@ static struct pistachio_mux pistachio_muxes[] __initdata = {
 	MUX(CLK_BT_PLL_MUX, "bt_pll_mux", mux_xtal_bt, 0x200, 17),
 };
 
+static struct pistachio_pll_rate_table mips_pll_rates[] = {
+	MIPS_PLL_RATES(52000000, 416000000, 1, 16, 2, 1),
+	MIPS_PLL_RATES(52000000, 442000000, 1, 17, 2, 1),
+	MIPS_PLL_RATES(52000000, 468000000, 1, 18, 2, 1),
+	MIPS_PLL_RATES(52000000, 494000000, 1, 19, 2, 1),
+	MIPS_PLL_RATES(52000000, 520000000, 1, 20, 2, 1),
+	MIPS_PLL_RATES(52000000, 546000000, 1, 21, 2, 1),
+};
+
 static struct pistachio_pll pistachio_plls[] __initdata = {
-	PLL_FIXED(CLK_MIPS_PLL, "mips_pll", "xtal", PLL_GF40LP_LAINT, 0x0),
+	PLL(CLK_MIPS_PLL, "mips_pll", "xtal", PLL_GF40LP_LAINT, 0x0,
+	    mips_pll_rates),
 	PLL_FIXED(CLK_AUDIO_PLL, "audio_pll", "audio_refclk_mux",
 		  PLL_GF40LP_FRAC, 0xc),
 	PLL_FIXED(CLK_RPU_V_PLL, "rpu_v_pll", "xtal", PLL_GF40LP_LAINT, 0x20),
diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h
index 3bb6bbe..b5d22d6 100644
--- a/drivers/clk/pistachio/clk.h
+++ b/drivers/clk/pistachio/clk.h
@@ -121,6 +121,18 @@ struct pistachio_pll_rate_table {
 	unsigned int frac;
 };
 
+#define MIPS_PLL_RATES(_fref, _fout, _refdiv, _fbdiv,	\
+		       _postdiv1, _postdiv2)		\
+{                                                       \
+	.fref           = _fref,                        \
+	.fout           = _fout,                        \
+	.refdiv         = _refdiv,                      \
+	.fbdiv          = _fbdiv,                       \
+	.postdiv1       = _postdiv1,                    \
+	.postdiv2       = _postdiv2,                    \
+	.frac           = 0,                            \
+}
+
 enum pistachio_pll_type {
 	PLL_GF40LP_LAINT,
 	PLL_GF40LP_FRAC,
-- 
2.3.3


  parent reply	other threads:[~2015-05-22  0:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 23:57 [PATCH 0/9] clk: pistachio: Assorted changes Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 1/9] clk: pistachio: Add a pll_lock() helper for clarity Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 2/9] clk: pistachio: Lock the PLL when enabled upon rate change Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 3/9] clk: pistachio: Implement PLL rate adjustment Ezequiel Garcia
2015-05-22 17:04   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 4/9] clk: pistachio: Extend DIV_F to pass clk_flags as well Ezequiel Garcia
2015-05-22 17:05   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 5/9] clk: pistachio: Add a MUX_F macro to pass clk_flags Ezequiel Garcia
2015-05-22 17:07   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 6/9] clk: pistachio: Propagate rate changes in the MIPS PLL clock sub-tree Ezequiel Garcia
2015-05-22 17:42   ` Andrew Bresticker
2015-05-22 17:52     ` Ezequiel Garcia
2015-05-22 18:07       ` Andrew Bresticker
2015-05-21 23:57 ` Ezequiel Garcia [this message]
2015-05-22 17:45   ` [PATCH 7/9] clk: pistachio: Add a rate table for the MIPS PLL Andrew Bresticker
2015-05-22 17:45     ` Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 8/9] clk: pistachio: Add sanity checks on PLL configuration Ezequiel Garcia
2015-05-22 17:48   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 9/9] clk: pistachio: Correct critical clock list Ezequiel Garcia
2015-05-22 17:56   ` Andrew Bresticker
2015-05-22 17:54     ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432252663-31318-8-git-send-email-ezequiel.garcia@imgtec.com \
    --to=ezequiel.garcia@imgtec.com \
    --cc=Damien.Horsley@imgtec.com \
    --cc=Govindraj.Raja@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=cernekee@chromium.org \
    --cc=james.hartley@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®