mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock
@ 2014-11-06  3:37 Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 1/4] clk: sunxi: unify APB1 clock Chen-Yu Tsai
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2014-11-06  3:37 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel

Hi everyone,

This series unifies the apb1 clock driver for sun4i, which was
previously split into apb1-mux and apb1. This also fixes the
apb2 clock on sun6i/sun8i, which we now have documents for.

The first 2 patches were done by Emilio.

Patch 1 unifies the apb1-mux and apb1 clock drivers using a
factors clock.

Patch 2 unifies said clocks in the dtsi.

Patch 3 switches the compatibles for apb2 clock on sun6i/sun8i to
the unified sun4i apb1 clock.

Patch 4 gets rid of the incorrect and now unused sun6i apb2 clock
driver.


Cheers
ChenYu


Chen-Yu Tsai (2):
  ARM: dts: sunxi: Use sun4i-a10-apb1-clk for sun6i/sun8i apb2 clocks.
  clk: sunxi: Removed unused/incorrect sun6i-a31-apb2-clk driver

Emilio López (2):
  clk: sunxi: unify APB1 clock
  ARM: dts: sunxi: unify APB1 clock

 Documentation/devicetree/bindings/clock/sunxi.txt |  2 --
 arch/arm/boot/dts/sun4i-a10.dtsi                  | 12 ++----------
 arch/arm/boot/dts/sun5i-a10s.dtsi                 | 12 ++----------
 arch/arm/boot/dts/sun5i-a13.dtsi                  | 12 ++----------
 arch/arm/boot/dts/sun6i-a31.dtsi                  | 12 ++----------
 arch/arm/boot/dts/sun7i-a20.dtsi                  | 12 ++----------
 arch/arm/boot/dts/sun8i-a23.dtsi                  | 12 ++----------
 drivers/clk/sunxi/clk-sunxi.c                     | 14 ++------------
 8 files changed, 14 insertions(+), 74 deletions(-)

-- 
2.1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] clk: sunxi: unify APB1 clock
  2014-11-06  3:37 [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock Chen-Yu Tsai
@ 2014-11-06  3:38 ` Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 2/4] ARM: dts: " Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2014-11-06  3:38 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard
  Cc: linux-kernel, Chen-Yu Tsai

From: Emilio López <emilio@elopez.com.ar>

This commit unifies the APB1 mux with the APB1 clock, using the new
factors infrastructure.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
[wens@csie.org: Add mux mask bits]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/clock/sunxi.txt | 1 -
 drivers/clk/sunxi/clk-sunxi.c                     | 7 ++-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index 0455cb9..6ddcf6e 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -45,7 +45,6 @@ Required properties:
 	"allwinner,sun9i-a80-apb0-gates-clk" - for the APB0 gates on A80
 	"allwinner,sun4i-a10-apb1-clk" - for the APB1 clock
 	"allwinner,sun9i-a80-apb1-clk" - for the APB1 bus clock on A80
-	"allwinner,sun4i-a10-apb1-mux-clk" - for the APB1 clock muxing
 	"allwinner,sun4i-a10-apb1-gates-clk" - for the APB1 gates on A10
 	"allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13
 	"allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 20f47c6..4133e27 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -507,6 +507,8 @@ static const struct factors_data sun6i_a31_pll6_data __initconst = {
 };
 
 static const struct factors_data sun4i_apb1_data __initconst = {
+	.mux = 24,
+	.muxmask = BIT(1) | BIT(0),
 	.table = &sun4i_apb1_config,
 	.getter = sun4i_get_apb1_factors,
 };
@@ -545,10 +547,6 @@ static const struct mux_data sun6i_a31_ahb1_mux_data __initconst = {
 	.shift = 12,
 };
 
-static const struct mux_data sun4i_apb1_mux_data __initconst = {
-	.shift = 24,
-};
-
 static void __init sunxi_mux_clk_setup(struct device_node *node,
 				       struct mux_data *data)
 {
@@ -1109,7 +1107,6 @@ static const struct of_device_id clk_divs_match[] __initconst = {
 /* Matches for mux clocks */
 static const struct of_device_id clk_mux_match[] __initconst = {
 	{.compatible = "allwinner,sun4i-a10-cpu-clk", .data = &sun4i_cpu_mux_data,},
-	{.compatible = "allwinner,sun4i-a10-apb1-mux-clk", .data = &sun4i_apb1_mux_data,},
 	{.compatible = "allwinner,sun6i-a31-ahb1-mux-clk", .data = &sun6i_a31_ahb1_mux_data,},
 	{}
 };
-- 
2.1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] ARM: dts: sunxi: unify APB1 clock
  2014-11-06  3:37 [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 1/4] clk: sunxi: unify APB1 clock Chen-Yu Tsai
@ 2014-11-06  3:38 ` Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 3/4] ARM: dts: sunxi: Use sun4i-a10-apb1-clk for sun6i/sun8i apb2 clocks Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 4/4] clk: sunxi: Removed unused/incorrect sun6i-a31-apb2-clk driver Chen-Yu Tsai
  3 siblings, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2014-11-06  3:38 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard
  Cc: linux-kernel, Chen-Yu Tsai

From: Emilio López <emilio@elopez.com.ar>

With the new factors infrastructure in place, we can unify apb1 and
apb1_mux as a single clock now.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
[wens@csie.org: Change apb1 node label to "apb1"; reword commit title]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun4i-a10.dtsi  | 12 ++----------
 arch/arm/boot/dts/sun5i-a10s.dtsi | 12 ++----------
 arch/arm/boot/dts/sun5i-a13.dtsi  | 12 ++----------
 arch/arm/boot/dts/sun7i-a20.dtsi  | 12 ++----------
 4 files changed, 8 insertions(+), 40 deletions(-)

diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 380f914..5e2ec2d 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -174,19 +174,11 @@
 				"apb0_ir1", "apb0_keypad";
 		};
 
-		apb1_mux: apb1_mux@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-			clock-output-names = "apb1_mux";
-		};
-
-		apb1: apb1@01c20058 {
+		apb1: clk@01c20058 {
 			#clock-cells = <0>;
 			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
-			clocks = <&apb1_mux>;
+			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
 			clock-output-names = "apb1";
 		};
 
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index 531272c..d2a8514 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -162,19 +162,11 @@
 				"apb0_ir", "apb0_keypad";
 		};
 
-		apb1_mux: apb1_mux@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-			clock-output-names = "apb1_mux";
-		};
-
-		apb1: apb1@01c20058 {
+		apb1: clk@01c20058 {
 			#clock-cells = <0>;
 			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
-			clocks = <&apb1_mux>;
+			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
 			clock-output-names = "apb1";
 		};
 
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index b131068..c35217e 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -161,19 +161,11 @@
 			clock-output-names = "apb0_codec", "apb0_pio", "apb0_ir";
 		};
 
-		apb1_mux: apb1_mux@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-			clock-output-names = "apb1_mux";
-		};
-
-		apb1: apb1@01c20058 {
+		apb1: clk@01c20058 {
 			#clock-cells = <0>;
 			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
-			clocks = <&apb1_mux>;
+			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
 			clock-output-names = "apb1";
 		};
 
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index 45bb916..8605f2b 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -222,19 +222,11 @@
 				"apb0_iis2", "apb0_keypad";
 		};
 
-		apb1_mux: apb1_mux@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-			clock-output-names = "apb1_mux";
-		};
-
-		apb1: apb1@01c20058 {
+		apb1: clk@01c20058 {
 			#clock-cells = <0>;
 			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
-			clocks = <&apb1_mux>;
+			clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
 			clock-output-names = "apb1";
 		};
 
-- 
2.1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] ARM: dts: sunxi: Use sun4i-a10-apb1-clk for sun6i/sun8i apb2 clocks.
  2014-11-06  3:37 [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 1/4] clk: sunxi: unify APB1 clock Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 2/4] ARM: dts: " Chen-Yu Tsai
@ 2014-11-06  3:38 ` Chen-Yu Tsai
  2014-11-06  3:38 ` [PATCH 4/4] clk: sunxi: Removed unused/incorrect sun6i-a31-apb2-clk driver Chen-Yu Tsai
  3 siblings, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2014-11-06  3:38 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel

The apb2 clocks are actually the same as apb1 clocks on the other sunxi
platforms, hence compatible with "allwinner,sun4i-a10-apb1-clk".

Update the dtsi to use the new unified apb1 clk.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 12 ++----------
 arch/arm/boot/dts/sun8i-a23.dtsi | 12 ++----------
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index e80288e..3a51151 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -217,19 +217,11 @@
 					"apb1_daudio1";
 		};
 
-		apb2_mux: apb2_mux@01c20058 {
+		apb2: clk@01c20058 {
 			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
+			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
 			clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>;
-			clock-output-names = "apb2_mux";
-		};
-
-		apb2: apb2@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun6i-a31-apb2-div-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&apb2_mux>;
 			clock-output-names = "apb2";
 		};
 
diff --git a/arch/arm/boot/dts/sun8i-a23.dtsi b/arch/arm/boot/dts/sun8i-a23.dtsi
index 6086adb..0746cd1 100644
--- a/arch/arm/boot/dts/sun8i-a23.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23.dtsi
@@ -189,19 +189,11 @@
 					"apb1_daudio0",	"apb1_daudio1";
 		};
 
-		apb2_mux: apb2_mux_clk@01c20058 {
+		apb2: clk@01c20058 {
 			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-apb1-mux-clk";
+			compatible = "allwinner,sun4i-a10-apb1-clk";
 			reg = <0x01c20058 0x4>;
 			clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>;
-			clock-output-names = "apb2_mux";
-		};
-
-		apb2: apb2_clk@01c20058 {
-			#clock-cells = <0>;
-			compatible = "allwinner,sun6i-a31-apb2-div-clk";
-			reg = <0x01c20058 0x4>;
-			clocks = <&apb2_mux>;
 			clock-output-names = "apb2";
 		};
 
-- 
2.1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] clk: sunxi: Removed unused/incorrect sun6i-a31-apb2-clk driver
  2014-11-06  3:37 [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2014-11-06  3:38 ` [PATCH 3/4] ARM: dts: sunxi: Use sun4i-a10-apb1-clk for sun6i/sun8i apb2 clocks Chen-Yu Tsai
@ 2014-11-06  3:38 ` Chen-Yu Tsai
  3 siblings, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2014-11-06  3:38 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel

This driver does not match the hardware, which is actually compatible
to sun4i-a10-apb1-clk. Since we've switch to the correct one, drop
this driver.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/clock/sunxi.txt | 1 -
 drivers/clk/sunxi/clk-sunxi.c                     | 7 -------
 2 files changed, 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index 6ddcf6e..d199f91 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -52,7 +52,6 @@ Required properties:
 	"allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20
 	"allwinner,sun8i-a23-apb1-gates-clk" - for the APB1 gates on A23
 	"allwinner,sun9i-a80-apb1-gates-clk" - for the APB1 gates on A80
-	"allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31
 	"allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31
 	"allwinner,sun8i-a23-apb2-gates-clk" - for the APB2 gates on A23
 	"allwinner,sun5i-a13-mbus-clk" - for the MBUS clock on A13
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 4133e27..46d98e3 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -632,12 +632,6 @@ static const struct div_data sun4i_apb0_data __initconst = {
 	.table	= sun4i_apb0_table,
 };
 
-static const struct div_data sun6i_a31_apb2_div_data __initconst = {
-	.shift	= 0,
-	.pow	= 0,
-	.width	= 4,
-};
-
 static void __init sunxi_divider_clk_setup(struct device_node *node,
 					   struct div_data *data)
 {
@@ -1093,7 +1087,6 @@ static const struct of_device_id clk_div_match[] __initconst = {
 	{.compatible = "allwinner,sun8i-a23-axi-clk", .data = &sun8i_a23_axi_data,},
 	{.compatible = "allwinner,sun4i-a10-ahb-clk", .data = &sun4i_ahb_data,},
 	{.compatible = "allwinner,sun4i-a10-apb0-clk", .data = &sun4i_apb0_data,},
-	{.compatible = "allwinner,sun6i-a31-apb2-div-clk", .data = &sun6i_a31_apb2_div_data,},
 	{}
 };
 
-- 
2.1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-06  3:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-06  3:37 [PATCH 0/4] clk: sunxi: Unify sun4i apb1 clock Chen-Yu Tsai
2014-11-06  3:38 ` [PATCH 1/4] clk: sunxi: unify APB1 clock Chen-Yu Tsai
2014-11-06  3:38 ` [PATCH 2/4] ARM: dts: " Chen-Yu Tsai
2014-11-06  3:38 ` [PATCH 3/4] ARM: dts: sunxi: Use sun4i-a10-apb1-clk for sun6i/sun8i apb2 clocks Chen-Yu Tsai
2014-11-06  3:38 ` [PATCH 4/4] clk: sunxi: Removed unused/incorrect sun6i-a31-apb2-clk driver Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®