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 4/9] clk: pistachio: Extend DIV_F to pass clk_flags as well
Date: Thu, 21 May 2015 20:57:38 -0300 [thread overview]
Message-ID: <1432252663-31318-5-git-send-email-ezequiel.garcia@imgtec.com> (raw)
In-Reply-To: <1432252663-31318-1-git-send-email-ezequiel.garcia@imgtec.com>
As preparation work to support MIPS PLL rate change propagation, this
commit extends the DIV_F macro to pass clk_flags in addition to div_flags.
Signed-off-by: Govindraj Raja <Govindraj.Raja@imgtec.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
---
drivers/clk/pistachio/clk-pistachio.c | 24 ++++++++++++------------
drivers/clk/pistachio/clk.c | 3 ++-
drivers/clk/pistachio/clk.h | 7 +++++--
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c
index 8c0fe88..47e2fb1 100644
--- a/drivers/clk/pistachio/clk-pistachio.c
+++ b/drivers/clk/pistachio/clk-pistachio.c
@@ -61,13 +61,13 @@ static struct pistachio_div pistachio_divs[] __initdata = {
0x204, 2),
DIV(CLK_MIPS_DIV, "mips_div", "mips_internal_div", 0x208, 8),
DIV_F(CLK_AUDIO_DIV, "audio_div", "audio_mux",
- 0x20c, 8, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x20c, 8, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_I2S_DIV, "i2s_div", "audio_pll_mux",
- 0x210, 8, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x210, 8, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_SPDIF_DIV, "spdif_div", "audio_pll_mux",
- 0x214, 8, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x214, 8, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_AUDIO_DAC_DIV, "audio_dac_div", "audio_pll_mux",
- 0x218, 8, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x218, 8, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV(CLK_RPU_V_DIV, "rpu_v_div", "rpu_v_pll_mux", 0x21c, 2),
DIV(CLK_RPU_L_DIV, "rpu_l_div", "rpu_l_mux", 0x220, 2),
DIV(CLK_RPU_SLEEP_DIV, "rpu_sleep_div", "xtal", 0x224, 10),
@@ -75,13 +75,13 @@ static struct pistachio_div pistachio_divs[] __initdata = {
DIV(CLK_USB_PHY_DIV, "usb_phy_div", "sys_internal_div", 0x22c, 6),
DIV(CLK_ENET_DIV, "enet_div", "enet_mux", 0x230, 6),
DIV_F(CLK_UART0_INTERNAL_DIV, "uart0_internal_div", "sys_pll_mux",
- 0x234, 3, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x234, 3, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_UART0_DIV, "uart0_div", "uart0_internal_div", 0x238, 10,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_UART1_INTERNAL_DIV, "uart1_internal_div", "sys_pll_mux",
- 0x23c, 3, CLK_DIVIDER_ROUND_CLOSEST),
+ 0x23c, 3, 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(CLK_UART1_DIV, "uart1_div", "uart1_internal_div", 0x240, 10,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV(CLK_SYS_INTERNAL_DIV, "sys_internal_div", "sys_pll_mux", 0x244, 3),
DIV(CLK_SPI0_INTERNAL_DIV, "spi0_internal_div", "sys_pll_mux",
0x248, 3),
@@ -226,13 +226,13 @@ static struct pistachio_div pistachio_periph_divs[] __initdata = {
DIV(PERIPH_CLK_COUNTER_SLOW_DIV, "counter_slow_div",
"counter_slow_pre_div", 0x118, 7),
DIV_F(PERIPH_CLK_IR_PRE_DIV, "ir_pre_div", "periph_sys", 0x11c, 7,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(PERIPH_CLK_IR_DIV, "ir_div", "ir_pre_div", 0x120, 7,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(PERIPH_CLK_WD_PRE_DIV, "wd_pre_div", "periph_sys", 0x124, 7,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV_F(PERIPH_CLK_WD_DIV, "wd_div", "wd_pre_div", 0x128, 7,
- CLK_DIVIDER_ROUND_CLOSEST),
+ 0, CLK_DIVIDER_ROUND_CLOSEST),
DIV(PERIPH_CLK_PDM_PRE_DIV, "pdm_pre_div", "periph_sys", 0x12c, 7),
DIV(PERIPH_CLK_PDM_DIV, "pdm_div", "pdm_pre_div", 0x130, 7),
DIV(PERIPH_CLK_PWM_PRE_DIV, "pwm_pre_div", "periph_sys", 0x134, 7),
diff --git a/drivers/clk/pistachio/clk.c b/drivers/clk/pistachio/clk.c
index 85faa83..380879b 100644
--- a/drivers/clk/pistachio/clk.c
+++ b/drivers/clk/pistachio/clk.c
@@ -99,7 +99,8 @@ void pistachio_clk_register_div(struct pistachio_clk_provider *p,
for (i = 0; i < num; i++) {
clk = clk_register_divider(NULL, div[i].name, div[i].parent,
- 0, p->base + div[i].reg, 0,
+ div[i].clk_flags,
+ p->base + div[i].reg, 0,
div[i].width, div[i].div_flags,
NULL);
p->clk_data.clks[div[i].id] = clk;
diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h
index ea48d15..1589227 100644
--- a/drivers/clk/pistachio/clk.h
+++ b/drivers/clk/pistachio/clk.h
@@ -54,6 +54,7 @@ struct pistachio_div {
unsigned int id;
unsigned long reg;
unsigned int width;
+ unsigned int clk_flags;
unsigned int div_flags;
const char *name;
const char *parent;
@@ -64,17 +65,19 @@ struct pistachio_div {
.id = _id, \
.reg = _reg, \
.width = _width, \
+ .clk_flags = 0, \
.div_flags = 0, \
.name = _name, \
.parent = _pname, \
}
-#define DIV_F(_id, _name, _pname, _reg, _width, _div_flags) \
+#define DIV_F(_id, _name, _pname, _reg, _width, _clkf, _divf) \
{ \
.id = _id, \
.reg = _reg, \
.width = _width, \
- .div_flags = _div_flags, \
+ .clk_flags = _clkf, \
+ .div_flags = _divf, \
.name = _name, \
.parent = _pname, \
}
--
2.3.3
next prev parent reply other threads:[~2015-05-22 0:04 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 ` Ezequiel Garcia [this message]
2015-05-22 17:05 ` [PATCH 4/9] clk: pistachio: Extend DIV_F to pass clk_flags as well 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 ` [PATCH 7/9] clk: pistachio: Add a rate table for the MIPS PLL Ezequiel Garcia
2015-05-22 17:45 ` 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-5-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®