devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: imx6: cleanup for fixed-clock
@ 2014-04-11  8:04 Shawn Guo
       [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:04 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Shawn Guo

The series cleans up fixed-clock handling for imx6 a little bit, so that
we can have clock driver simply call of_clk_get_by_name() than
imx_obtain_fixed_clock() to retrieve the clocks, and generic name can
just be used for these clocks.

Shawn Guo (4):
  ARM: dts: imx: add required #clock-cells for fixed-clock
  ARM: dts: imx6: define input clocks to CCM block
  ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock
  ARM: dts: imx6: use generic name for fixed-clock nodes

 arch/arm/boot/dts/imx25.dtsi      |  1 +
 arch/arm/boot/dts/imx27-apf27.dts |  1 +
 arch/arm/boot/dts/imx27.dtsi      |  1 +
 arch/arm/boot/dts/imx50.dtsi      |  4 ++++
 arch/arm/boot/dts/imx51.dtsi      |  4 ++++
 arch/arm/boot/dts/imx53.dtsi      |  4 ++++
 arch/arm/boot/dts/imx6qdl.dtsi    | 23 +++++++++++++++++------
 arch/arm/boot/dts/imx6sl.dtsi     | 12 ++++++++++--
 arch/arm/boot/dts/vf610-twr.dts   |  2 ++
 arch/arm/boot/dts/vf610.dtsi      |  2 ++
 arch/arm/mach-imx/clk-imx6q.c     |  6 +++---
 arch/arm/mach-imx/clk-imx6sl.c    |  4 ++--
 12 files changed, 51 insertions(+), 13 deletions(-)

-- 
1.8.3.2


--
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	[flat|nested] 7+ messages in thread

* [PATCH 1/4] ARM: dts: imx: add required #clock-cells for fixed-clock
       [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2014-04-11  8:04   ` Shawn Guo
  2014-04-11  8:04   ` [PATCH 2/4] ARM: dts: imx6: define input clocks to CCM block Shawn Guo
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:04 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Shawn Guo

Per bindings of fixed-clock, #clock-cells is a required property.  Let's
add it for those fixed rate clocks.

Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 arch/arm/boot/dts/imx25.dtsi      | 1 +
 arch/arm/boot/dts/imx27-apf27.dts | 1 +
 arch/arm/boot/dts/imx27.dtsi      | 1 +
 arch/arm/boot/dts/imx50.dtsi      | 4 ++++
 arch/arm/boot/dts/imx51.dtsi      | 4 ++++
 arch/arm/boot/dts/imx53.dtsi      | 4 ++++
 arch/arm/boot/dts/imx6qdl.dtsi    | 3 +++
 arch/arm/boot/dts/imx6sl.dtsi     | 2 ++
 arch/arm/boot/dts/vf610-twr.dts   | 2 ++
 arch/arm/boot/dts/vf610.dtsi      | 2 ++
 10 files changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index 32f760e..ea323f0 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -56,6 +56,7 @@
 
 		osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts
index 09f57b3..73aae4f 100644
--- a/arch/arm/boot/dts/imx27-apf27.dts
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -29,6 +29,7 @@
 
 		osc26m {
 			compatible = "fsl,imx-osc26m", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 6279e0b..137e010e 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -48,6 +48,7 @@
 
 		osc26m {
 			compatible = "fsl,imx-osc26m", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <26000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi
index 0c75fe3..9c89d1c 100644
--- a/arch/arm/boot/dts/imx50.dtsi
+++ b/arch/arm/boot/dts/imx50.dtsi
@@ -53,21 +53,25 @@
 
 		ckil {
 			compatible = "fsl,imx-ckil", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		ckih1 {
 			compatible = "fsl,imx-ckih1", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <22579200>;
 		};
 
 		ckih2 {
 			compatible = "fsl,imx-ckih2", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
 		osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 5f8216d..150bb4e 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -50,21 +50,25 @@
 
 		ckil {
 			compatible = "fsl,imx-ckil", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		ckih1 {
 			compatible = "fsl,imx-ckih1", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
 		ckih2 {
 			compatible = "fsl,imx-ckih2", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
 		osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index b57ab577..3d0bfd5 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -70,21 +70,25 @@
 
 		ckil {
 			compatible = "fsl,imx-ckil", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		ckih1 {
 			compatible = "fsl,imx-ckih1", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <22579200>;
 		};
 
 		ckih2 {
 			compatible = "fsl,imx-ckih2", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
 		osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 55cb926..8ee6361 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -59,16 +59,19 @@
 
 		ckil {
 			compatible = "fsl,imx-ckil", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		ckih1 {
 			compatible = "fsl,imx-ckih1", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
 		osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 3cb4941..ebaad63 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -81,11 +81,13 @@
 
 		ckil {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		osc {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
index 7dd1d6e..ded3610 100644
--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -25,11 +25,13 @@
 	clocks {
 		audio_ext {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24576000>;
 		};
 
 		enet_ext {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <50000000>;
 		};
 	};
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index 8048733..e3db854 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -45,11 +45,13 @@
 
 		sxosc {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
 		fxosc {
 			compatible = "fixed-clock";
+			#clock-cells = <0>;
 			clock-frequency = <24000000>;
 		};
 	};
-- 
1.8.3.2


--
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] 7+ messages in thread

* [PATCH 2/4] ARM: dts: imx6: define input clocks to CCM block
       [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2014-04-11  8:04   ` [PATCH 1/4] ARM: dts: imx: add required #clock-cells " Shawn Guo
@ 2014-04-11  8:04   ` Shawn Guo
  2014-04-11  8:04   ` [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock Shawn Guo
  2014-04-11  8:04   ` [PATCH 4/4] ARM: dts: imx6: use generic name for fixed-clock nodes Shawn Guo
  3 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:04 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Shawn Guo

Inspired by commit 1771b10 (clk: respect the clock dependencies in
of_clk_init), we should define the input clocks to CCM block to reflect
the dependencies on those fixed rate clocks.

Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 arch/arm/boot/dts/imx6qdl.dtsi | 8 +++++---
 arch/arm/boot/dts/imx6sl.dtsi  | 6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 8ee6361..2a35b08 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -57,19 +57,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		ckil {
+		ckil: ckil {
 			compatible = "fsl,imx-ckil", "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
-		ckih1 {
+		ckih1: ckih1 {
 			compatible = "fsl,imx-ckih1", "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <0>;
 		};
 
-		osc {
+		osc: osc {
 			compatible = "fsl,imx-osc", "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <24000000>;
@@ -483,6 +483,8 @@
 				interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>,
 					     <0 88 IRQ_TYPE_LEVEL_HIGH>;
 				#clock-cells = <1>;
+				clocks = <&ckil>, <&ckih1>, <&osc>;
+				clock-names = "ckil", "ckih1", "osc";
 			};
 
 			anatop: anatop@020c8000 {
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index ebaad63..a6d3afb 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -79,13 +79,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		ckil {
+		ckil: ckil {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <32768>;
 		};
 
-		osc {
+		osc: osc {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <24000000>;
@@ -427,6 +427,8 @@
 				interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>,
 					     <0 88 IRQ_TYPE_LEVEL_HIGH>;
 				#clock-cells = <1>;
+				clocks = <&ckil>, <&osc>;
+				clock-names = "ckil", "osc";
 			};
 
 			anatop: anatop@020c8000 {
-- 
1.8.3.2


--
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] 7+ messages in thread

* [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock
       [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2014-04-11  8:04   ` [PATCH 1/4] ARM: dts: imx: add required #clock-cells " Shawn Guo
  2014-04-11  8:04   ` [PATCH 2/4] ARM: dts: imx6: define input clocks to CCM block Shawn Guo
@ 2014-04-11  8:04   ` Shawn Guo
       [not found]     ` <1397203447-22965-4-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2014-04-11  8:04   ` [PATCH 4/4] ARM: dts: imx6: use generic name for fixed-clock nodes Shawn Guo
  3 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:04 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Shawn Guo

With the dependencies of those fixed input clocks reflected in device
tree, we now can just call of_clk_get_by_name() to retrieve the clocks.

Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 arch/arm/mach-imx/clk-imx6q.c  | 6 +++---
 arch/arm/mach-imx/clk-imx6sl.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index b0e7f9d..862c80e 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -148,9 +148,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	int ret;
 
 	clk[dummy] = imx_clk_fixed("dummy", 0);
-	clk[ckil] = imx_obtain_fixed_clock("ckil", 0);
-	clk[ckih] = imx_obtain_fixed_clock("ckih1", 0);
-	clk[osc] = imx_obtain_fixed_clock("osc", 0);
+	clk[ckil] = of_clk_get_by_name(ccm_node, "ckil");
+	clk[ckih] = of_clk_get_by_name(ccm_node, "ckih1");
+	clk[osc] = of_clk_get_by_name(ccm_node, "osc");
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
 	base = of_iomap(np, 0);
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index f7073c07..397f01a 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -174,8 +174,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
 	int ret;
 
 	clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-	clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
-	clks[IMX6SL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
+	clks[IMX6SL_CLK_CKIL] = of_clk_get_by_name(ccm_node, "ckil");
+	clks[IMX6SL_CLK_OSC] = of_clk_get_by_name(ccm_node, "osc");
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
 	base = of_iomap(np, 0);
-- 
1.8.3.2


--
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] 7+ messages in thread

* [PATCH 4/4] ARM: dts: imx6: use generic name for fixed-clock nodes
       [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
                     ` (2 preceding siblings ...)
  2014-04-11  8:04   ` [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock Shawn Guo
@ 2014-04-11  8:04   ` Shawn Guo
  3 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:04 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Shawn Guo

Per device tree spec, we should use generic name for device node when
possible.  Let's do that for the fixed-clock nodes, and use property
clock-output-names to define the name for clock.

While at it, let's drop those unneeded imx specific compatible string
for these fixed rate clocks.

Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 arch/arm/boot/dts/imx6qdl.dtsi | 18 ++++++++++++------
 arch/arm/boot/dts/imx6sl.dtsi  |  8 ++++++--
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 2a35b08..400f75c 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -57,22 +57,28 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		ckil: ckil {
-			compatible = "fsl,imx-ckil", "fixed-clock";
+		ckil: clock@0 {
+			compatible = "fixed-clock";
+			reg = <0>;
 			#clock-cells = <0>;
 			clock-frequency = <32768>;
+			clock-output-names = "ckil";
 		};
 
-		ckih1: ckih1 {
-			compatible = "fsl,imx-ckih1", "fixed-clock";
+		ckih1: clock@1 {
+			compatible = "fixed-clock";
+			reg = <1>;
 			#clock-cells = <0>;
 			clock-frequency = <0>;
+			clock-output-names = "ckih1";
 		};
 
-		osc: osc {
-			compatible = "fsl,imx-osc", "fixed-clock";
+		osc: clock@2 {
+			compatible = "fixed-clock";
+			reg = <2>;
 			#clock-cells = <0>;
 			clock-frequency = <24000000>;
+			clock-output-names = "osc";
 		};
 	};
 
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index a6d3afb..275eb30 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -79,16 +79,20 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		ckil: ckil {
+		ckil: clock@0 {
 			compatible = "fixed-clock";
+			reg = <0>;
 			#clock-cells = <0>;
 			clock-frequency = <32768>;
+			clock-output-names = "ckil";
 		};
 
-		osc: osc {
+		osc: clock@1 {
 			compatible = "fixed-clock";
+			reg = <1>;
 			#clock-cells = <0>;
 			clock-frequency = <24000000>;
+			clock-output-names = "osc";
 		};
 	};
 
-- 
1.8.3.2


--
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] 7+ messages in thread

* Re: [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock
       [not found]     ` <1397203447-22965-4-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2014-04-11  8:40       ` Shawn Guo
  2014-04-14  2:20         ` Shawn Guo
  0 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2014-04-11  8:40 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Fri, Apr 11, 2014 at 04:04:06PM +0800, Shawn Guo wrote:
> With the dependencies of those fixed input clocks reflected in device
> tree, we now can just call of_clk_get_by_name() to retrieve the clocks.
> 
> Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
>  arch/arm/mach-imx/clk-imx6q.c  | 6 +++---
>  arch/arm/mach-imx/clk-imx6sl.c | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
> index b0e7f9d..862c80e 100644
> --- a/arch/arm/mach-imx/clk-imx6q.c
> +++ b/arch/arm/mach-imx/clk-imx6q.c
> @@ -148,9 +148,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
>  	int ret;
>  
>  	clk[dummy] = imx_clk_fixed("dummy", 0);
> -	clk[ckil] = imx_obtain_fixed_clock("ckil", 0);
> -	clk[ckih] = imx_obtain_fixed_clock("ckih1", 0);
> -	clk[osc] = imx_obtain_fixed_clock("osc", 0);
> +	clk[ckil] = of_clk_get_by_name(ccm_node, "ckil");
> +	clk[ckih] = of_clk_get_by_name(ccm_node, "ckih1");
> +	clk[osc] = of_clk_get_by_name(ccm_node, "osc");

Damn.  The change will break existing DTB.  Will fix it in v2.

Shawn

>  
>  	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
>  	base = of_iomap(np, 0);
> diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
> index f7073c07..397f01a 100644
> --- a/arch/arm/mach-imx/clk-imx6sl.c
> +++ b/arch/arm/mach-imx/clk-imx6sl.c
> @@ -174,8 +174,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
>  	int ret;
>  
>  	clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
> -	clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
> -	clks[IMX6SL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
> +	clks[IMX6SL_CLK_CKIL] = of_clk_get_by_name(ccm_node, "ckil");
> +	clks[IMX6SL_CLK_OSC] = of_clk_get_by_name(ccm_node, "osc");
>  
>  	np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
>  	base = of_iomap(np, 0);
> -- 
> 1.8.3.2
> 
> 

--
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	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock
  2014-04-11  8:40       ` Shawn Guo
@ 2014-04-14  2:20         ` Shawn Guo
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2014-04-14  2:20 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Fri, Apr 11, 2014 at 04:40:44PM +0800, Shawn Guo wrote:
> On Fri, Apr 11, 2014 at 04:04:06PM +0800, Shawn Guo wrote:
> > With the dependencies of those fixed input clocks reflected in device
> > tree, we now can just call of_clk_get_by_name() to retrieve the clocks.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > ---
> >  arch/arm/mach-imx/clk-imx6q.c  | 6 +++---
> >  arch/arm/mach-imx/clk-imx6sl.c | 4 ++--
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
> > index b0e7f9d..862c80e 100644
> > --- a/arch/arm/mach-imx/clk-imx6q.c
> > +++ b/arch/arm/mach-imx/clk-imx6q.c
> > @@ -148,9 +148,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> >  	int ret;
> >  
> >  	clk[dummy] = imx_clk_fixed("dummy", 0);
> > -	clk[ckil] = imx_obtain_fixed_clock("ckil", 0);
> > -	clk[ckih] = imx_obtain_fixed_clock("ckih1", 0);
> > -	clk[osc] = imx_obtain_fixed_clock("osc", 0);
> > +	clk[ckil] = of_clk_get_by_name(ccm_node, "ckil");
> > +	clk[ckih] = of_clk_get_by_name(ccm_node, "ckih1");
> > +	clk[osc] = of_clk_get_by_name(ccm_node, "osc");
> 
> Damn.  The change will break existing DTB.  Will fix it in v2.

The code will need to be like:

	clk[ckil] = of_clk_get_by_name(ccm_node, "ckil");
	if (IS_ERR(clk[ckil]))
		clk[ckil] = imx_obtain_fixed_clock("ckil", 0);

I think the new clock driver will just need to call of_clk_get_by_name()
and stay away from imx_obtain_fixed_clock(), but it's unnecessary to
churn the existing clock drivers.  That said, I will only apply the
first patch and drop all others.

Shawn

--
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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-14  2:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11  8:04 [PATCH 0/4] ARM: imx6: cleanup for fixed-clock Shawn Guo
     [not found] ` <1397203447-22965-1-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-04-11  8:04   ` [PATCH 1/4] ARM: dts: imx: add required #clock-cells " Shawn Guo
2014-04-11  8:04   ` [PATCH 2/4] ARM: dts: imx6: define input clocks to CCM block Shawn Guo
2014-04-11  8:04   ` [PATCH 3/4] ARM: dts: imx6: use of_clk_get_by_name() to retrieve fixed-clock Shawn Guo
     [not found]     ` <1397203447-22965-4-git-send-email-shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-04-11  8:40       ` Shawn Guo
2014-04-14  2:20         ` Shawn Guo
2014-04-11  8:04   ` [PATCH 4/4] ARM: dts: imx6: use generic name for fixed-clock nodes Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).