* [PATCH V2 0/2] fix clock issue for fsl,spdi
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo, mturquette, kernel, sboyd, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, linux
Cc: linux-arm-kernel, linux-clk, linux-kernel, devicetree
fix clock issue for fsl,spdi in imx6.
Changes in v2:
move the dts change to another patch
Shengjiu Wang (2):
clk: imx6: Add SPDIF_GCLK clock in clock tree
ARM: dts: imx6: change the core clock of spdif
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
9 files changed, 31 insertions(+), 7 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 0/2] fix clock issue for fsl,spdi
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo, mturquette, kernel, sboyd, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, linux
Cc: devicetree, linux-clk, linux-arm-kernel, linux-kernel
fix clock issue for fsl,spdi in imx6.
Changes in v2:
move the dts change to another patch
Shengjiu Wang (2):
clk: imx6: Add SPDIF_GCLK clock in clock tree
ARM: dts: imx6: change the core clock of spdif
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
9 files changed, 31 insertions(+), 7 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 0/2] fix clock issue for fsl,spdi
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: linux-arm-kernel
fix clock issue for fsl,spdi in imx6.
Changes in v2:
move the dts change to another patch
Shengjiu Wang (2):
clk: imx6: Add SPDIF_GCLK clock in clock tree
ARM: dts: imx6: change the core clock of spdif
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
9 files changed, 31 insertions(+), 7 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo, mturquette, kernel, sboyd, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, linux
Cc: linux-arm-kernel, linux-clk, linux-kernel, devicetree
As spdif driver will register SPDIF clock to regmap, regmap will do
clk_prepare in init function, so SPDIF clock is prepared in probe, then its
root clock (pll clock) is prepared also, which cause the arm can't enter
low power mode.
Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
Its root clock is ipg clock, and register it to regmap, then the issue cam
be fixed.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
---
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
6 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index b2c1c04..e6b5944 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
static unsigned int share_count_mipi_core_cfg;
+static unsigned int share_count_spdif;
static inline int clk_on_imx6q(void)
{
@@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
+ clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
+ clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
index a0d4cf2..a73cedd 100644
--- a/drivers/clk/imx/clk-imx6sl.c
+++ b/drivers/clk/imx/clk-imx6sl.c
@@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
+static unsigned int share_count_spdif;
static struct clk *clks[IMX6SL_CLK_END];
static struct clk_onecell_data clk_data;
@@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
+ clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
+ clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index 5b95c2c..f2bc511 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
+ clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
index 8de173f..77985cc 100644
--- a/include/dt-bindings/clock/imx6qdl-clock.h
+++ b/include/dt-bindings/clock/imx6qdl-clock.h
@@ -254,6 +254,7 @@
#define IMX6QDL_CLK_CAAM_MEM 241
#define IMX6QDL_CLK_CAAM_ACLK 242
#define IMX6QDL_CLK_CAAM_IPG 243
-#define IMX6QDL_CLK_END 244
+#define IMX6QDL_CLK_SPDIF_GCLK 244
+#define IMX6QDL_CLK_END 245
#endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
index 9ce4e42..e14573e 100644
--- a/include/dt-bindings/clock/imx6sl-clock.h
+++ b/include/dt-bindings/clock/imx6sl-clock.h
@@ -174,6 +174,7 @@
#define IMX6SL_CLK_SSI1_IPG 161
#define IMX6SL_CLK_SSI2_IPG 162
#define IMX6SL_CLK_SSI3_IPG 163
-#define IMX6SL_CLK_END 164
+#define IMX6SL_CLK_SPDIF_GCLK 164
+#define IMX6SL_CLK_END 165
#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
index 9957091..36f0324 100644
--- a/include/dt-bindings/clock/imx6sx-clock.h
+++ b/include/dt-bindings/clock/imx6sx-clock.h
@@ -274,6 +274,7 @@
#define IMX6SX_PLL5_BYPASS 261
#define IMX6SX_PLL6_BYPASS 262
#define IMX6SX_PLL7_BYPASS 263
-#define IMX6SX_CLK_CLK_END 264
+#define IMX6SX_CLK_SPDIF_GCLK 264
+#define IMX6SX_CLK_CLK_END 265
#endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo-DgEjT+Ai2ygdnm+yROfE0A,
mturquette-rdvid1DuHRBWk0Htik3J/w, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-clk-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
As spdif driver will register SPDIF clock to regmap, regmap will do
clk_prepare in init function, so SPDIF clock is prepared in probe, then its
root clock (pll clock) is prepared also, which cause the arm can't enter
low power mode.
Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
Its root clock is ipg clock, and register it to regmap, then the issue cam
be fixed.
Signed-off-by: Shengjiu Wang <shengjiu.wang-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
6 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index b2c1c04..e6b5944 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
static unsigned int share_count_mipi_core_cfg;
+static unsigned int share_count_spdif;
static inline int clk_on_imx6q(void)
{
@@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
+ clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
+ clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
index a0d4cf2..a73cedd 100644
--- a/drivers/clk/imx/clk-imx6sl.c
+++ b/drivers/clk/imx/clk-imx6sl.c
@@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
+static unsigned int share_count_spdif;
static struct clk *clks[IMX6SL_CLK_END];
static struct clk_onecell_data clk_data;
@@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
+ clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
+ clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index 5b95c2c..f2bc511 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
+ clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
index 8de173f..77985cc 100644
--- a/include/dt-bindings/clock/imx6qdl-clock.h
+++ b/include/dt-bindings/clock/imx6qdl-clock.h
@@ -254,6 +254,7 @@
#define IMX6QDL_CLK_CAAM_MEM 241
#define IMX6QDL_CLK_CAAM_ACLK 242
#define IMX6QDL_CLK_CAAM_IPG 243
-#define IMX6QDL_CLK_END 244
+#define IMX6QDL_CLK_SPDIF_GCLK 244
+#define IMX6QDL_CLK_END 245
#endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
index 9ce4e42..e14573e 100644
--- a/include/dt-bindings/clock/imx6sl-clock.h
+++ b/include/dt-bindings/clock/imx6sl-clock.h
@@ -174,6 +174,7 @@
#define IMX6SL_CLK_SSI1_IPG 161
#define IMX6SL_CLK_SSI2_IPG 162
#define IMX6SL_CLK_SSI3_IPG 163
-#define IMX6SL_CLK_END 164
+#define IMX6SL_CLK_SPDIF_GCLK 164
+#define IMX6SL_CLK_END 165
#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
index 9957091..36f0324 100644
--- a/include/dt-bindings/clock/imx6sx-clock.h
+++ b/include/dt-bindings/clock/imx6sx-clock.h
@@ -274,6 +274,7 @@
#define IMX6SX_PLL5_BYPASS 261
#define IMX6SX_PLL6_BYPASS 262
#define IMX6SX_PLL7_BYPASS 263
-#define IMX6SX_CLK_CLK_END 264
+#define IMX6SX_CLK_SPDIF_GCLK 264
+#define IMX6SX_CLK_CLK_END 265
#endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: linux-arm-kernel
As spdif driver will register SPDIF clock to regmap, regmap will do
clk_prepare in init function, so SPDIF clock is prepared in probe, then its
root clock (pll clock) is prepared also, which cause the arm can't enter
low power mode.
Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
Its root clock is ipg clock, and register it to regmap, then the issue cam
be fixed.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
---
drivers/clk/imx/clk-imx6q.c | 4 +++-
drivers/clk/imx/clk-imx6sl.c | 4 +++-
drivers/clk/imx/clk-imx6sx.c | 1 +
include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
6 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index b2c1c04..e6b5944 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
static unsigned int share_count_mipi_core_cfg;
+static unsigned int share_count_spdif;
static inline int clk_on_imx6q(void)
{
@@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
+ clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
+ clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
index a0d4cf2..a73cedd 100644
--- a/drivers/clk/imx/clk-imx6sl.c
+++ b/drivers/clk/imx/clk-imx6sl.c
@@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
static unsigned int share_count_ssi1;
static unsigned int share_count_ssi2;
static unsigned int share_count_ssi3;
+static unsigned int share_count_spdif;
static struct clk *clks[IMX6SL_CLK_END];
static struct clk_onecell_data clk_data;
@@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
- clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
+ clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
+ clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index 5b95c2c..f2bc511 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
+ clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
index 8de173f..77985cc 100644
--- a/include/dt-bindings/clock/imx6qdl-clock.h
+++ b/include/dt-bindings/clock/imx6qdl-clock.h
@@ -254,6 +254,7 @@
#define IMX6QDL_CLK_CAAM_MEM 241
#define IMX6QDL_CLK_CAAM_ACLK 242
#define IMX6QDL_CLK_CAAM_IPG 243
-#define IMX6QDL_CLK_END 244
+#define IMX6QDL_CLK_SPDIF_GCLK 244
+#define IMX6QDL_CLK_END 245
#endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
index 9ce4e42..e14573e 100644
--- a/include/dt-bindings/clock/imx6sl-clock.h
+++ b/include/dt-bindings/clock/imx6sl-clock.h
@@ -174,6 +174,7 @@
#define IMX6SL_CLK_SSI1_IPG 161
#define IMX6SL_CLK_SSI2_IPG 162
#define IMX6SL_CLK_SSI3_IPG 163
-#define IMX6SL_CLK_END 164
+#define IMX6SL_CLK_SPDIF_GCLK 164
+#define IMX6SL_CLK_END 165
#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
index 9957091..36f0324 100644
--- a/include/dt-bindings/clock/imx6sx-clock.h
+++ b/include/dt-bindings/clock/imx6sx-clock.h
@@ -274,6 +274,7 @@
#define IMX6SX_PLL5_BYPASS 261
#define IMX6SX_PLL6_BYPASS 262
#define IMX6SX_PLL7_BYPASS 263
-#define IMX6SX_CLK_CLK_END 264
+#define IMX6SX_CLK_SPDIF_GCLK 264
+#define IMX6SX_CLK_CLK_END 265
#endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 2/2] ARM: dts: imx6: change the core clock of spdif
2015-09-15 10:01 ` Shengjiu Wang
(?)
@ 2015-09-15 10:01 ` Shengjiu Wang
-1 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo, mturquette, kernel, sboyd, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, linux
Cc: linux-arm-kernel, linux-clk, linux-kernel, devicetree
As core clock is changed in clock tree, the dts also need to be
updated.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
---
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index e716e6f..53044b0 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -218,7 +218,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_OSC>,
+ clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
<&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 320a27f..c247756 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -135,8 +135,24 @@
ranges;
spdif: spdif@02004000 {
+ compatible = "fsl,imx6sl-spdif",
+ "fsl,imx35-spdif";
reg = <0x02004000 0x4000>;
interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&sdma 14 18 0>,
+ <&sdma 15 18 0>;
+ dma-names = "rx", "tx";
+ clocks = <&clks IMX6SL_CLK_SPDIF_GCLK>, <&clks IMX6SL_CLK_OSC>,
+ <&clks IMX6SL_CLK_SPDIF>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_IPG>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_SPBA>;
+ clock-names = "core", "rxtx0",
+ "rxtx1", "rxtx2",
+ "rxtx3", "rxtx4",
+ "rxtx5", "rxtx6",
+ "rxtx7", "dma";
+ status = "disabled";
};
ecspi1: ecspi@02008000 {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index c94f2ea..167f77b 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -211,7 +211,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6SX_CLK_SPDIF>,
+ clocks = <&clks IMX6SX_CLK_SPDIF_GCLK>,
<&clks IMX6SX_CLK_OSC>,
<&clks IMX6SX_CLK_SPDIF>,
<&clks 0>, <&clks 0>, <&clks 0>,
--
1.9.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 2/2] ARM: dts: imx6: change the core clock of spdif
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: shawnguo, mturquette, kernel, sboyd, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, linux
Cc: linux-arm-kernel, linux-clk, linux-kernel, devicetree
As core clock is changed in clock tree, the dts also need to be
updated.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
---
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index e716e6f..53044b0 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -218,7 +218,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_OSC>,
+ clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
<&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 320a27f..c247756 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -135,8 +135,24 @@
ranges;
spdif: spdif@02004000 {
+ compatible = "fsl,imx6sl-spdif",
+ "fsl,imx35-spdif";
reg = <0x02004000 0x4000>;
interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&sdma 14 18 0>,
+ <&sdma 15 18 0>;
+ dma-names = "rx", "tx";
+ clocks = <&clks IMX6SL_CLK_SPDIF_GCLK>, <&clks IMX6SL_CLK_OSC>,
+ <&clks IMX6SL_CLK_SPDIF>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_IPG>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_SPBA>;
+ clock-names = "core", "rxtx0",
+ "rxtx1", "rxtx2",
+ "rxtx3", "rxtx4",
+ "rxtx5", "rxtx6",
+ "rxtx7", "dma";
+ status = "disabled";
};
ecspi1: ecspi@02008000 {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index c94f2ea..167f77b 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -211,7 +211,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6SX_CLK_SPDIF>,
+ clocks = <&clks IMX6SX_CLK_SPDIF_GCLK>,
<&clks IMX6SX_CLK_OSC>,
<&clks IMX6SX_CLK_SPDIF>,
<&clks 0>, <&clks 0>, <&clks 0>,
--
1.9.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V2 2/2] ARM: dts: imx6: change the core clock of spdif
@ 2015-09-15 10:01 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-15 10:01 UTC (permalink / raw)
To: linux-arm-kernel
As core clock is changed in clock tree, the dts also need to be
updated.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
---
arch/arm/boot/dts/imx6qdl.dtsi | 2 +-
arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++
arch/arm/boot/dts/imx6sx.dtsi | 2 +-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index e716e6f..53044b0 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -218,7 +218,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_OSC>,
+ clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
<&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
<&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 320a27f..c247756 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -135,8 +135,24 @@
ranges;
spdif: spdif at 02004000 {
+ compatible = "fsl,imx6sl-spdif",
+ "fsl,imx35-spdif";
reg = <0x02004000 0x4000>;
interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&sdma 14 18 0>,
+ <&sdma 15 18 0>;
+ dma-names = "rx", "tx";
+ clocks = <&clks IMX6SL_CLK_SPDIF_GCLK>, <&clks IMX6SL_CLK_OSC>,
+ <&clks IMX6SL_CLK_SPDIF>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_IPG>, <&clks IMX6SL_CLK_DUMMY>,
+ <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_SPBA>;
+ clock-names = "core", "rxtx0",
+ "rxtx1", "rxtx2",
+ "rxtx3", "rxtx4",
+ "rxtx5", "rxtx6",
+ "rxtx7", "dma";
+ status = "disabled";
};
ecspi1: ecspi at 02008000 {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index c94f2ea..167f77b 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -211,7 +211,7 @@
dmas = <&sdma 14 18 0>,
<&sdma 15 18 0>;
dma-names = "rx", "tx";
- clocks = <&clks IMX6SX_CLK_SPDIF>,
+ clocks = <&clks IMX6SX_CLK_SPDIF_GCLK>,
<&clks IMX6SX_CLK_OSC>,
<&clks IMX6SX_CLK_SPDIF>,
<&clks 0>, <&clks 0>, <&clks 0>,
--
1.9.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-09-15 10:01 ` Shengjiu Wang
@ 2015-09-23 15:33 ` Shawn Guo
-1 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-09-23 15:33 UTC (permalink / raw)
To: Shengjiu Wang
Cc: mturquette, kernel, sboyd, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, linux, linux-arm-kernel, linux-clk,
linux-kernel, devicetree
On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> As spdif driver will register SPDIF clock to regmap, regmap will do
> clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> root clock (pll clock) is prepared also, which cause the arm can't enter
> low power mode.
Can you help me understand why ARM cannot enter low power mode when pll
clock is prepared?
Shawn
> Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
> Its root clock is ipg clock, and register it to regmap, then the issue cam
> be fixed.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> ---
> drivers/clk/imx/clk-imx6q.c | 4 +++-
> drivers/clk/imx/clk-imx6sl.c | 4 +++-
> drivers/clk/imx/clk-imx6sx.c | 1 +
> include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
> include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
> include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
> 6 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> index b2c1c04..e6b5944 100644
> --- a/drivers/clk/imx/clk-imx6q.c
> +++ b/drivers/clk/imx/clk-imx6q.c
> @@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
> static unsigned int share_count_ssi2;
> static unsigned int share_count_ssi3;
> static unsigned int share_count_mipi_core_cfg;
> +static unsigned int share_count_spdif;
>
> static inline int clk_on_imx6q(void)
> {
> @@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
> clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
> clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> - clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
> + clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
> + clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
> index a0d4cf2..a73cedd 100644
> --- a/drivers/clk/imx/clk-imx6sl.c
> +++ b/drivers/clk/imx/clk-imx6sl.c
> @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
> static unsigned int share_count_ssi1;
> static unsigned int share_count_ssi2;
> static unsigned int share_count_ssi3;
> +static unsigned int share_count_spdif;
>
> static struct clk *clks[IMX6SL_CLK_END];
> static struct clk_onecell_data clk_data;
> @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
> clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
> clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
> clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
> + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
> + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> index 5b95c2c..f2bc511 100644
> --- a/drivers/clk/imx/clk-imx6sx.c
> +++ b/drivers/clk/imx/clk-imx6sx.c
> @@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
> clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
> clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
> + clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
> clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
> index 8de173f..77985cc 100644
> --- a/include/dt-bindings/clock/imx6qdl-clock.h
> +++ b/include/dt-bindings/clock/imx6qdl-clock.h
> @@ -254,6 +254,7 @@
> #define IMX6QDL_CLK_CAAM_MEM 241
> #define IMX6QDL_CLK_CAAM_ACLK 242
> #define IMX6QDL_CLK_CAAM_IPG 243
> -#define IMX6QDL_CLK_END 244
> +#define IMX6QDL_CLK_SPDIF_GCLK 244
> +#define IMX6QDL_CLK_END 245
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
> diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
> index 9ce4e42..e14573e 100644
> --- a/include/dt-bindings/clock/imx6sl-clock.h
> +++ b/include/dt-bindings/clock/imx6sl-clock.h
> @@ -174,6 +174,7 @@
> #define IMX6SL_CLK_SSI1_IPG 161
> #define IMX6SL_CLK_SSI2_IPG 162
> #define IMX6SL_CLK_SSI3_IPG 163
> -#define IMX6SL_CLK_END 164
> +#define IMX6SL_CLK_SPDIF_GCLK 164
> +#define IMX6SL_CLK_END 165
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
> diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
> index 9957091..36f0324 100644
> --- a/include/dt-bindings/clock/imx6sx-clock.h
> +++ b/include/dt-bindings/clock/imx6sx-clock.h
> @@ -274,6 +274,7 @@
> #define IMX6SX_PLL5_BYPASS 261
> #define IMX6SX_PLL6_BYPASS 262
> #define IMX6SX_PLL7_BYPASS 263
> -#define IMX6SX_CLK_CLK_END 264
> +#define IMX6SX_CLK_SPDIF_GCLK 264
> +#define IMX6SX_CLK_CLK_END 265
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-23 15:33 ` Shawn Guo
0 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-09-23 15:33 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> As spdif driver will register SPDIF clock to regmap, regmap will do
> clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> root clock (pll clock) is prepared also, which cause the arm can't enter
> low power mode.
Can you help me understand why ARM cannot enter low power mode when pll
clock is prepared?
Shawn
> Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
> Its root clock is ipg clock, and register it to regmap, then the issue cam
> be fixed.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> ---
> drivers/clk/imx/clk-imx6q.c | 4 +++-
> drivers/clk/imx/clk-imx6sl.c | 4 +++-
> drivers/clk/imx/clk-imx6sx.c | 1 +
> include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
> include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
> include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
> 6 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> index b2c1c04..e6b5944 100644
> --- a/drivers/clk/imx/clk-imx6q.c
> +++ b/drivers/clk/imx/clk-imx6q.c
> @@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
> static unsigned int share_count_ssi2;
> static unsigned int share_count_ssi3;
> static unsigned int share_count_mipi_core_cfg;
> +static unsigned int share_count_spdif;
>
> static inline int clk_on_imx6q(void)
> {
> @@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
> clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
> clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> - clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
> + clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
> + clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
> index a0d4cf2..a73cedd 100644
> --- a/drivers/clk/imx/clk-imx6sl.c
> +++ b/drivers/clk/imx/clk-imx6sl.c
> @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
> static unsigned int share_count_ssi1;
> static unsigned int share_count_ssi2;
> static unsigned int share_count_ssi3;
> +static unsigned int share_count_spdif;
>
> static struct clk *clks[IMX6SL_CLK_END];
> static struct clk_onecell_data clk_data;
> @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
> clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
> clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
> clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
> + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
> + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> index 5b95c2c..f2bc511 100644
> --- a/drivers/clk/imx/clk-imx6sx.c
> +++ b/drivers/clk/imx/clk-imx6sx.c
> @@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
> clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
> clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
> + clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
> clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
> index 8de173f..77985cc 100644
> --- a/include/dt-bindings/clock/imx6qdl-clock.h
> +++ b/include/dt-bindings/clock/imx6qdl-clock.h
> @@ -254,6 +254,7 @@
> #define IMX6QDL_CLK_CAAM_MEM 241
> #define IMX6QDL_CLK_CAAM_ACLK 242
> #define IMX6QDL_CLK_CAAM_IPG 243
> -#define IMX6QDL_CLK_END 244
> +#define IMX6QDL_CLK_SPDIF_GCLK 244
> +#define IMX6QDL_CLK_END 245
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
> diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
> index 9ce4e42..e14573e 100644
> --- a/include/dt-bindings/clock/imx6sl-clock.h
> +++ b/include/dt-bindings/clock/imx6sl-clock.h
> @@ -174,6 +174,7 @@
> #define IMX6SL_CLK_SSI1_IPG 161
> #define IMX6SL_CLK_SSI2_IPG 162
> #define IMX6SL_CLK_SSI3_IPG 163
> -#define IMX6SL_CLK_END 164
> +#define IMX6SL_CLK_SPDIF_GCLK 164
> +#define IMX6SL_CLK_END 165
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
> diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
> index 9957091..36f0324 100644
> --- a/include/dt-bindings/clock/imx6sx-clock.h
> +++ b/include/dt-bindings/clock/imx6sx-clock.h
> @@ -274,6 +274,7 @@
> #define IMX6SX_PLL5_BYPASS 261
> #define IMX6SX_PLL6_BYPASS 262
> #define IMX6SX_PLL7_BYPASS 263
> -#define IMX6SX_CLK_CLK_END 264
> +#define IMX6SX_CLK_SPDIF_GCLK 264
> +#define IMX6SX_CLK_CLK_END 265
>
> #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-09-23 15:33 ` Shawn Guo
(?)
@ 2015-09-24 5:43 ` Shengjiu Wang
-1 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-24 5:43 UTC (permalink / raw)
To: Shawn Guo
Cc: mturquette, kernel, sboyd, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, linux, linux-arm-kernel, linux-clk,
linux-kernel, devicetree
On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > As spdif driver will register SPDIF clock to regmap, regmap will do
> > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > root clock (pll clock) is prepared also, which cause the arm can't enter
> > low power mode.
>
> Can you help me understand why ARM cannot enter low power mode when pll
> clock is prepared?
>
> Shawn
Hi Shawn
In i.mx clock framework, when pll clk is prepared, it will be powerup. when
enterring low power idle mode, the powerdown bit is checked, when pll is not
powerdown state, chip will not enter low power idle mode.
best regards
wang shengjiu
>
> > Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
> > Its root clock is ipg clock, and register it to regmap, then the issue cam
> > be fixed.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > ---
> > drivers/clk/imx/clk-imx6q.c | 4 +++-
> > drivers/clk/imx/clk-imx6sl.c | 4 +++-
> > drivers/clk/imx/clk-imx6sx.c | 1 +
> > include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
> > 6 files changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> > index b2c1c04..e6b5944 100644
> > --- a/drivers/clk/imx/clk-imx6q.c
> > +++ b/drivers/clk/imx/clk-imx6q.c
> > @@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > static unsigned int share_count_mipi_core_cfg;
> > +static unsigned int share_count_spdif;
> >
> > static inline int clk_on_imx6q(void)
> > {
> > @@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> > clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
> > clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
> > clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
> > + clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
> > + clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
> > index a0d4cf2..a73cedd 100644
> > --- a/drivers/clk/imx/clk-imx6sl.c
> > +++ b/drivers/clk/imx/clk-imx6sl.c
> > @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
> > static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > +static unsigned int share_count_spdif;
> >
> > static struct clk *clks[IMX6SL_CLK_END];
> > static struct clk_onecell_data clk_data;
> > @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
> > clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
> > clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
> > + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
> > + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> > index 5b95c2c..f2bc511 100644
> > --- a/drivers/clk/imx/clk-imx6sx.c
> > +++ b/drivers/clk/imx/clk-imx6sx.c
> > @@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
> > + clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
> > index 8de173f..77985cc 100644
> > --- a/include/dt-bindings/clock/imx6qdl-clock.h
> > +++ b/include/dt-bindings/clock/imx6qdl-clock.h
> > @@ -254,6 +254,7 @@
> > #define IMX6QDL_CLK_CAAM_MEM 241
> > #define IMX6QDL_CLK_CAAM_ACLK 242
> > #define IMX6QDL_CLK_CAAM_IPG 243
> > -#define IMX6QDL_CLK_END 244
> > +#define IMX6QDL_CLK_SPDIF_GCLK 244
> > +#define IMX6QDL_CLK_END 245
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
> > diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
> > index 9ce4e42..e14573e 100644
> > --- a/include/dt-bindings/clock/imx6sl-clock.h
> > +++ b/include/dt-bindings/clock/imx6sl-clock.h
> > @@ -174,6 +174,7 @@
> > #define IMX6SL_CLK_SSI1_IPG 161
> > #define IMX6SL_CLK_SSI2_IPG 162
> > #define IMX6SL_CLK_SSI3_IPG 163
> > -#define IMX6SL_CLK_END 164
> > +#define IMX6SL_CLK_SPDIF_GCLK 164
> > +#define IMX6SL_CLK_END 165
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
> > diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
> > index 9957091..36f0324 100644
> > --- a/include/dt-bindings/clock/imx6sx-clock.h
> > +++ b/include/dt-bindings/clock/imx6sx-clock.h
> > @@ -274,6 +274,7 @@
> > #define IMX6SX_PLL5_BYPASS 261
> > #define IMX6SX_PLL6_BYPASS 262
> > #define IMX6SX_PLL7_BYPASS 263
> > -#define IMX6SX_CLK_CLK_END 264
> > +#define IMX6SX_CLK_SPDIF_GCLK 264
> > +#define IMX6SX_CLK_CLK_END 265
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
> > --
> > 1.9.1
> >
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-24 5:43 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-24 5:43 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, linux, pawel.moll, ijc+devicetree,
mturquette, sboyd, linux-kernel, robh+dt, kernel, galak,
linux-clk, linux-arm-kernel
On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > As spdif driver will register SPDIF clock to regmap, regmap will do
> > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > root clock (pll clock) is prepared also, which cause the arm can't enter
> > low power mode.
>
> Can you help me understand why ARM cannot enter low power mode when pll
> clock is prepared?
>
> Shawn
Hi Shawn
In i.mx clock framework, when pll clk is prepared, it will be powerup. when
enterring low power idle mode, the powerdown bit is checked, when pll is not
powerdown state, chip will not enter low power idle mode.
best regards
wang shengjiu
>
> > Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
> > Its root clock is ipg clock, and register it to regmap, then the issue cam
> > be fixed.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > ---
> > drivers/clk/imx/clk-imx6q.c | 4 +++-
> > drivers/clk/imx/clk-imx6sl.c | 4 +++-
> > drivers/clk/imx/clk-imx6sx.c | 1 +
> > include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
> > 6 files changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> > index b2c1c04..e6b5944 100644
> > --- a/drivers/clk/imx/clk-imx6q.c
> > +++ b/drivers/clk/imx/clk-imx6q.c
> > @@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > static unsigned int share_count_mipi_core_cfg;
> > +static unsigned int share_count_spdif;
> >
> > static inline int clk_on_imx6q(void)
> > {
> > @@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> > clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
> > clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
> > clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
> > + clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
> > + clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
> > index a0d4cf2..a73cedd 100644
> > --- a/drivers/clk/imx/clk-imx6sl.c
> > +++ b/drivers/clk/imx/clk-imx6sl.c
> > @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
> > static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > +static unsigned int share_count_spdif;
> >
> > static struct clk *clks[IMX6SL_CLK_END];
> > static struct clk_onecell_data clk_data;
> > @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
> > clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
> > clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
> > + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
> > + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> > index 5b95c2c..f2bc511 100644
> > --- a/drivers/clk/imx/clk-imx6sx.c
> > +++ b/drivers/clk/imx/clk-imx6sx.c
> > @@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
> > + clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
> > index 8de173f..77985cc 100644
> > --- a/include/dt-bindings/clock/imx6qdl-clock.h
> > +++ b/include/dt-bindings/clock/imx6qdl-clock.h
> > @@ -254,6 +254,7 @@
> > #define IMX6QDL_CLK_CAAM_MEM 241
> > #define IMX6QDL_CLK_CAAM_ACLK 242
> > #define IMX6QDL_CLK_CAAM_IPG 243
> > -#define IMX6QDL_CLK_END 244
> > +#define IMX6QDL_CLK_SPDIF_GCLK 244
> > +#define IMX6QDL_CLK_END 245
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
> > diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
> > index 9ce4e42..e14573e 100644
> > --- a/include/dt-bindings/clock/imx6sl-clock.h
> > +++ b/include/dt-bindings/clock/imx6sl-clock.h
> > @@ -174,6 +174,7 @@
> > #define IMX6SL_CLK_SSI1_IPG 161
> > #define IMX6SL_CLK_SSI2_IPG 162
> > #define IMX6SL_CLK_SSI3_IPG 163
> > -#define IMX6SL_CLK_END 164
> > +#define IMX6SL_CLK_SPDIF_GCLK 164
> > +#define IMX6SL_CLK_END 165
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
> > diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
> > index 9957091..36f0324 100644
> > --- a/include/dt-bindings/clock/imx6sx-clock.h
> > +++ b/include/dt-bindings/clock/imx6sx-clock.h
> > @@ -274,6 +274,7 @@
> > #define IMX6SX_PLL5_BYPASS 261
> > #define IMX6SX_PLL6_BYPASS 262
> > #define IMX6SX_PLL7_BYPASS 263
> > -#define IMX6SX_CLK_CLK_END 264
> > +#define IMX6SX_CLK_SPDIF_GCLK 264
> > +#define IMX6SX_CLK_CLK_END 265
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
> > --
> > 1.9.1
> >
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-24 5:43 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-09-24 5:43 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > As spdif driver will register SPDIF clock to regmap, regmap will do
> > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > root clock (pll clock) is prepared also, which cause the arm can't enter
> > low power mode.
>
> Can you help me understand why ARM cannot enter low power mode when pll
> clock is prepared?
>
> Shawn
Hi Shawn
In i.mx clock framework, when pll clk is prepared, it will be powerup. when
enterring low power idle mode, the powerdown bit is checked, when pll is not
powerdown state, chip will not enter low power idle mode.
best regards
wang shengjiu
>
> > Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock.
> > Its root clock is ipg clock, and register it to regmap, then the issue cam
> > be fixed.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > ---
> > drivers/clk/imx/clk-imx6q.c | 4 +++-
> > drivers/clk/imx/clk-imx6sl.c | 4 +++-
> > drivers/clk/imx/clk-imx6sx.c | 1 +
> > include/dt-bindings/clock/imx6qdl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sl-clock.h | 3 ++-
> > include/dt-bindings/clock/imx6sx-clock.h | 3 ++-
> > 6 files changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> > index b2c1c04..e6b5944 100644
> > --- a/drivers/clk/imx/clk-imx6q.c
> > +++ b/drivers/clk/imx/clk-imx6q.c
> > @@ -119,6 +119,7 @@ static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > static unsigned int share_count_mipi_core_cfg;
> > +static unsigned int share_count_spdif;
> >
> > static inline int clk_on_imx6q(void)
> > {
> > @@ -456,7 +457,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> > clk[IMX6QDL_CLK_SATA] = imx_clk_gate2("sata", "ahb", base + 0x7c, 4);
> > clk[IMX6QDL_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
> > clk[IMX6QDL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif_podf", base + 0x7c, 14);
> > + clk[IMX6QDL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_spdif);
> > + clk[IMX6QDL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clk[IMX6QDL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clk[IMX6QDL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clk[IMX6QDL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
> > index a0d4cf2..a73cedd 100644
> > --- a/drivers/clk/imx/clk-imx6sl.c
> > +++ b/drivers/clk/imx/clk-imx6sl.c
> > @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = {
> > static unsigned int share_count_ssi1;
> > static unsigned int share_count_ssi2;
> > static unsigned int share_count_ssi3;
> > +static unsigned int share_count_spdif;
> >
> > static struct clk *clks[IMX6SL_CLK_END];
> > static struct clk_onecell_data clk_data;
> > @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22);
> > clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6);
> > clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14);
> > + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif);
> > + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif);
> > clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> > index 5b95c2c..f2bc511 100644
> > --- a/drivers/clk/imx/clk-imx6sx.c
> > +++ b/drivers/clk/imx/clk-imx6sx.c
> > @@ -454,6 +454,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
> > clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
> > clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio);
> > + clks[IMX6SX_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_audio);
> > clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1);
> > clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2);
> > clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3);
> > diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
> > index 8de173f..77985cc 100644
> > --- a/include/dt-bindings/clock/imx6qdl-clock.h
> > +++ b/include/dt-bindings/clock/imx6qdl-clock.h
> > @@ -254,6 +254,7 @@
> > #define IMX6QDL_CLK_CAAM_MEM 241
> > #define IMX6QDL_CLK_CAAM_ACLK 242
> > #define IMX6QDL_CLK_CAAM_IPG 243
> > -#define IMX6QDL_CLK_END 244
> > +#define IMX6QDL_CLK_SPDIF_GCLK 244
> > +#define IMX6QDL_CLK_END 245
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6QDL_H */
> > diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
> > index 9ce4e42..e14573e 100644
> > --- a/include/dt-bindings/clock/imx6sl-clock.h
> > +++ b/include/dt-bindings/clock/imx6sl-clock.h
> > @@ -174,6 +174,7 @@
> > #define IMX6SL_CLK_SSI1_IPG 161
> > #define IMX6SL_CLK_SSI2_IPG 162
> > #define IMX6SL_CLK_SSI3_IPG 163
> > -#define IMX6SL_CLK_END 164
> > +#define IMX6SL_CLK_SPDIF_GCLK 164
> > +#define IMX6SL_CLK_END 165
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
> > diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h
> > index 9957091..36f0324 100644
> > --- a/include/dt-bindings/clock/imx6sx-clock.h
> > +++ b/include/dt-bindings/clock/imx6sx-clock.h
> > @@ -274,6 +274,7 @@
> > #define IMX6SX_PLL5_BYPASS 261
> > #define IMX6SX_PLL6_BYPASS 262
> > #define IMX6SX_PLL7_BYPASS 263
> > -#define IMX6SX_CLK_CLK_END 264
> > +#define IMX6SX_CLK_SPDIF_GCLK 264
> > +#define IMX6SX_CLK_CLK_END 265
> >
> > #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */
> > --
> > 1.9.1
> >
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-09-24 5:43 ` Shengjiu Wang
@ 2015-09-24 11:57 ` Shawn Guo
-1 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-09-24 11:57 UTC (permalink / raw)
To: Shengjiu Wang
Cc: mturquette, kernel, sboyd, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, linux, linux-arm-kernel, linux-clk,
linux-kernel, devicetree
On Thu, Sep 24, 2015 at 01:43:24PM +0800, Shengjiu Wang wrote:
> On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> > On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > > As spdif driver will register SPDIF clock to regmap, regmap will do
> > > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > > root clock (pll clock) is prepared also, which cause the arm can't enter
> > > low power mode.
> >
> > Can you help me understand why ARM cannot enter low power mode when pll
> > clock is prepared?
> >
> > Shawn
> Hi Shawn
>
> In i.mx clock framework, when pll clk is prepared, it will be powerup. when
> enterring low power idle mode, the powerdown bit is checked, when pll is not
> powerdown state, chip will not enter low power idle mode.
So this is not a SPDIF specific problem, and any device driver preparing
its clock that is a child of pll clock will run into this problem,
right? If so, we should purchase a more generic solution than such
device specific one.
Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-09-24 11:57 ` Shawn Guo
0 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-09-24 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 24, 2015 at 01:43:24PM +0800, Shengjiu Wang wrote:
> On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> > On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > > As spdif driver will register SPDIF clock to regmap, regmap will do
> > > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > > root clock (pll clock) is prepared also, which cause the arm can't enter
> > > low power mode.
> >
> > Can you help me understand why ARM cannot enter low power mode when pll
> > clock is prepared?
> >
> > Shawn
> Hi Shawn
>
> In i.mx clock framework, when pll clk is prepared, it will be powerup. when
> enterring low power idle mode, the powerdown bit is checked, when pll is not
> powerdown state, chip will not enter low power idle mode.
So this is not a SPDIF specific problem, and any device driver preparing
its clock that is a child of pll clock will run into this problem,
right? If so, we should purchase a more generic solution than such
device specific one.
Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-09-24 11:57 ` Shawn Guo
(?)
@ 2015-10-09 9:15 ` Shengjiu Wang
-1 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-09 9:15 UTC (permalink / raw)
To: Shawn Guo
Cc: mturquette, kernel, sboyd, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, linux, linux-arm-kernel, linux-clk,
linux-kernel, devicetree
On Thu, Sep 24, 2015 at 04:57:37AM -0700, Shawn Guo wrote:
> On Thu, Sep 24, 2015 at 01:43:24PM +0800, Shengjiu Wang wrote:
> > On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> > > On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > > > As spdif driver will register SPDIF clock to regmap, regmap will do
> > > > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > > > root clock (pll clock) is prepared also, which cause the arm can't enter
> > > > low power mode.
> > >
> > > Can you help me understand why ARM cannot enter low power mode when pll
> > > clock is prepared?
> > >
> > > Shawn
> > Hi Shawn
> >
> > In i.mx clock framework, when pll clk is prepared, it will be powerup. when
> > enterring low power idle mode, the powerdown bit is checked, when pll is not
> > powerdown state, chip will not enter low power idle mode.
>
> So this is not a SPDIF specific problem, and any device driver preparing
> its clock that is a child of pll clock will run into this problem,
> right? If so, we should purchase a more generic solution than such
> device specific one.
>
> Shawn
Hi shawn
SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
We didn't separate them in clock tree before.
I can't find a generic solution. But anyway if there is a solution or not, I
think we'd better to separate them.
best regards
wang shengjiu
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-10-09 9:15 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-09 9:15 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, linux, pawel.moll, ijc+devicetree,
mturquette, sboyd, linux-kernel, robh+dt, kernel, galak,
linux-clk, linux-arm-kernel
On Thu, Sep 24, 2015 at 04:57:37AM -0700, Shawn Guo wrote:
> On Thu, Sep 24, 2015 at 01:43:24PM +0800, Shengjiu Wang wrote:
> > On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> > > On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > > > As spdif driver will register SPDIF clock to regmap, regmap will do
> > > > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > > > root clock (pll clock) is prepared also, which cause the arm can't enter
> > > > low power mode.
> > >
> > > Can you help me understand why ARM cannot enter low power mode when pll
> > > clock is prepared?
> > >
> > > Shawn
> > Hi Shawn
> >
> > In i.mx clock framework, when pll clk is prepared, it will be powerup. when
> > enterring low power idle mode, the powerdown bit is checked, when pll is not
> > powerdown state, chip will not enter low power idle mode.
>
> So this is not a SPDIF specific problem, and any device driver preparing
> its clock that is a child of pll clock will run into this problem,
> right? If so, we should purchase a more generic solution than such
> device specific one.
>
> Shawn
Hi shawn
SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
We didn't separate them in clock tree before.
I can't find a generic solution. But anyway if there is a solution or not, I
think we'd better to separate them.
best regards
wang shengjiu
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-10-09 9:15 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-09 9:15 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 24, 2015 at 04:57:37AM -0700, Shawn Guo wrote:
> On Thu, Sep 24, 2015 at 01:43:24PM +0800, Shengjiu Wang wrote:
> > On Wed, Sep 23, 2015 at 08:33:41AM -0700, Shawn Guo wrote:
> > > On Tue, Sep 15, 2015 at 06:01:01PM +0800, Shengjiu Wang wrote:
> > > > As spdif driver will register SPDIF clock to regmap, regmap will do
> > > > clk_prepare in init function, so SPDIF clock is prepared in probe, then its
> > > > root clock (pll clock) is prepared also, which cause the arm can't enter
> > > > low power mode.
> > >
> > > Can you help me understand why ARM cannot enter low power mode when pll
> > > clock is prepared?
> > >
> > > Shawn
> > Hi Shawn
> >
> > In i.mx clock framework, when pll clk is prepared, it will be powerup. when
> > enterring low power idle mode, the powerdown bit is checked, when pll is not
> > powerdown state, chip will not enter low power idle mode.
>
> So this is not a SPDIF specific problem, and any device driver preparing
> its clock that is a child of pll clock will run into this problem,
> right? If so, we should purchase a more generic solution than such
> device specific one.
>
> Shawn
Hi shawn
SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
We didn't separate them in clock tree before.
I can't find a generic solution. But anyway if there is a solution or not, I
think we'd better to separate them.
best regards
wang shengjiu
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-10-09 9:15 ` Shengjiu Wang
@ 2015-10-10 1:11 ` Shawn Guo
-1 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-10-10 1:11 UTC (permalink / raw)
To: Shengjiu Wang
Cc: mark.rutland, devicetree, linux, pawel.moll, ijc+devicetree,
mturquette, sboyd, linux-kernel, robh+dt, kernel, galak,
linux-clk, linux-arm-kernel
On Fri, Oct 09, 2015 at 05:15:30PM +0800, Shengjiu Wang wrote:
> SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
> We didn't separate them in clock tree before.
Is it the clock described as "Global clock" in Reference Manual, SPDIF
chapter? If that's the case, you are just adding a missing SPDIF clock
rather than fixing a low power mode issue, and I will be fine. But
still you should reword the commit log to make it clear, that the patch
is to correct a SPDIF clock setting issue, which is just discovered by
low power mode support.
Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-10-10 1:11 ` Shawn Guo
0 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2015-10-10 1:11 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 09, 2015 at 05:15:30PM +0800, Shengjiu Wang wrote:
> SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
> We didn't separate them in clock tree before.
Is it the clock described as "Global clock" in Reference Manual, SPDIF
chapter? If that's the case, you are just adding a missing SPDIF clock
rather than fixing a low power mode issue, and I will be fine. But
still you should reword the commit log to make it clear, that the patch
is to correct a SPDIF clock setting issue, which is just discovered by
low power mode support.
Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
2015-10-10 1:11 ` Shawn Guo
(?)
@ 2015-10-10 1:45 ` Shengjiu Wang
-1 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-10 1:45 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, linux, pawel.moll, ijc+devicetree,
mturquette, sboyd, linux-kernel, robh+dt, kernel, galak,
linux-clk, linux-arm-kernel
On Sat, Oct 10, 2015 at 09:11:55AM +0800, Shawn Guo wrote:
> On Fri, Oct 09, 2015 at 05:15:30PM +0800, Shengjiu Wang wrote:
> > SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
> > We didn't separate them in clock tree before.
>
> Is it the clock described as "Global clock" in Reference Manual, SPDIF
Yes.
> chapter? If that's the case, you are just adding a missing SPDIF clock
> rather than fixing a low power mode issue, and I will be fine. But
> still you should reword the commit log to make it clear, that the patch
> is to correct a SPDIF clock setting issue, which is just discovered by
> low power mode support.
>
Ok, I will refine the patch comments, and send it later.
> Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-10-10 1:45 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-10 1:45 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, linux, pawel.moll, ijc+devicetree,
mturquette, sboyd, linux-kernel, robh+dt, kernel, galak,
linux-clk, linux-arm-kernel
On Sat, Oct 10, 2015 at 09:11:55AM +0800, Shawn Guo wrote:
> On Fri, Oct 09, 2015 at 05:15:30PM +0800, Shengjiu Wang wrote:
> > SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
> > We didn't separate them in clock tree before.
>
> Is it the clock described as "Global clock" in Reference Manual, SPDIF
Yes.
> chapter? If that's the case, you are just adding a missing SPDIF clock
> rather than fixing a low power mode issue, and I will be fine. But
> still you should reword the commit log to make it clear, that the patch
> is to correct a SPDIF clock setting issue, which is just discovered by
> low power mode support.
>
Ok, I will refine the patch comments, and send it later.
> Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree
@ 2015-10-10 1:45 ` Shengjiu Wang
0 siblings, 0 replies; 24+ messages in thread
From: Shengjiu Wang @ 2015-10-10 1:45 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 10, 2015 at 09:11:55AM +0800, Shawn Guo wrote:
> On Fri, Oct 09, 2015 at 05:15:30PM +0800, Shengjiu Wang wrote:
> > SPDIF_GCLK is also spdif's clock, it use a same enable bit with SPDIF_ROOT_CLK,
> > We didn't separate them in clock tree before.
>
> Is it the clock described as "Global clock" in Reference Manual, SPDIF
Yes.
> chapter? If that's the case, you are just adding a missing SPDIF clock
> rather than fixing a low power mode issue, and I will be fine. But
> still you should reword the commit log to make it clear, that the patch
> is to correct a SPDIF clock setting issue, which is just discovered by
> low power mode support.
>
Ok, I will refine the patch comments, and send it later.
> Shawn
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2015-10-10 1:46 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-15 10:01 [PATCH V2 0/2] fix clock issue for fsl,spdi Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
2015-09-15 10:01 ` [PATCH V2 1/2] clk: imx6: Add SPDIF_GCLK clock in clock tree Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
2015-09-23 15:33 ` Shawn Guo
2015-09-23 15:33 ` Shawn Guo
2015-09-24 5:43 ` Shengjiu Wang
2015-09-24 5:43 ` Shengjiu Wang
2015-09-24 5:43 ` Shengjiu Wang
2015-09-24 11:57 ` Shawn Guo
2015-09-24 11:57 ` Shawn Guo
2015-10-09 9:15 ` Shengjiu Wang
2015-10-09 9:15 ` Shengjiu Wang
2015-10-09 9:15 ` Shengjiu Wang
2015-10-10 1:11 ` Shawn Guo
2015-10-10 1:11 ` Shawn Guo
2015-10-10 1:45 ` Shengjiu Wang
2015-10-10 1:45 ` Shengjiu Wang
2015-10-10 1:45 ` Shengjiu Wang
2015-09-15 10:01 ` [PATCH V2 2/2] ARM: dts: imx6: change the core clock of spdif Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
2015-09-15 10:01 ` Shengjiu Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.