devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: qcom: Disable i2c device on gsbi4 for ipq806x
@ 2015-08-18 22:21 Mathieu Olivari
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Olivari @ 2015-08-18 22:21 UTC (permalink / raw)
  To: sboyd, agross, rnayak, architt
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	mturquette, mathieu, mturquette, georgi.djakov, devicetree,
	linux-arm-kernel, linux-kernel, linux-clk

Disable the i2c device on gsbi4 and mark gsbi4_h and gsbi4_qup clks as
unused. If they are enabled, clock framework will turn them off at end
of probe. On ipq806x by design gsbi4_qup, gsbi4_h clks and i2c on gsbi4
are meant for RPM usage. So turning them off in kernel is incorrect.

Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
---
 arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 9 ---------
 drivers/clk/qcom/gcc-ipq806x.c           | 6 +++---
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
index b08907a..36e2b04 100644
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
@@ -46,15 +46,6 @@
 			serial@16340000 {
 				status = "ok";
 			};
-
-			i2c4: i2c@16380000 {
-				status = "ok";
-
-				clock-frequency = <200000>;
-
-				pinctrl-0 = <&i2c4_pins>;
-				pinctrl-names = "default";
-			};
 		};
 
 		gsbi5: gsbi@1a200000 {
diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c
index 5639699..eb4065e 100644
--- a/drivers/clk/qcom/gcc-ipq806x.c
+++ b/drivers/clk/qcom/gcc-ipq806x.c
@@ -809,7 +809,7 @@ static struct clk_rcg gsbi6_qup_src = {
 			.parent_names = gcc_pxo_pll8,
 			.num_parents = 2,
 			.ops = &clk_rcg_ops,
-			.flags = CLK_SET_PARENT_GATE,
+			.flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,
 		},
 	},
 };
@@ -874,7 +874,7 @@ static struct clk_branch gsbi7_qup_clk = {
 			.parent_names = (const char *[]){ "gsbi7_qup_src" },
 			.num_parents = 1,
 			.ops = &clk_branch_ops,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
 		},
 	},
 };
@@ -922,7 +922,7 @@ static struct clk_branch gsbi4_h_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gsbi4_h_clk",
 			.ops = &clk_branch_ops,
-			.flags = CLK_IS_ROOT,
+			.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
 		},
 	},
 };
-- 
2.1.4

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

* [PATCH] ARM: qcom: Disable i2c device on gsbi4 for ipq806x
@ 2020-03-13 19:58 Ansuel Smith
  2020-03-13 20:36 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Ansuel Smith @ 2020-03-13 19:58 UTC (permalink / raw)
  To: agross
  Cc: Ansuel Smith, Mathieu Olivari, Bjorn Andersson, Rob Herring,
	Mark Rutland, Michael Turquette, Stephen Boyd, linux-arm-msm,
	devicetree, linux-kernel, linux-clk

Disable the i2c device on gsbi4 and mark gsbi4_h and gsbi4_qup clks as
unused. If they are enabled, clock framework will turn them off at end
of probe. On ipq806x by design gsbi4_qup, gsbi4_h clks and i2c on gsbi4
are meant for RPM usage. So turning them off in kernel is incorrect.

Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 9 ---------
 drivers/clk/qcom/gcc-ipq806x.c           | 5 +++--
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
index 554c65e7aa0e..580aec63030d 100644
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
@@ -21,14 +21,5 @@ mux {
 				};
 			};
 		};
-
-		gsbi@16300000 {
-			i2c@16380000 {
-				status = "ok";
-				clock-frequency = <200000>;
-				pinctrl-0 = <&i2c4_pins>;
-				pinctrl-names = "default";
-			};
-		};
 	};
 };
diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c
index b0eee0903807..75706807e6cf 100644
--- a/drivers/clk/qcom/gcc-ipq806x.c
+++ b/drivers/clk/qcom/gcc-ipq806x.c
@@ -782,7 +782,7 @@ static struct clk_rcg gsbi4_qup_src = {
 			.parent_names = gcc_pxo_pll8,
 			.num_parents = 2,
 			.ops = &clk_rcg_ops,
-			.flags = CLK_SET_PARENT_GATE,
+			.flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,
 		},
 	},
 };
@@ -798,7 +798,7 @@ static struct clk_branch gsbi4_qup_clk = {
 			.parent_names = (const char *[]){ "gsbi4_qup_src" },
 			.num_parents = 1,
 			.ops = &clk_branch_ops,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
 		},
 	},
 };
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gsbi4_h_clk",
 			.ops = &clk_branch_ops,
+			.flags = CLK_IGNORE_UNUSED,
 		},
 	},
 };
-- 
2.25.0


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

* Re: [PATCH] ARM: qcom: Disable i2c device on gsbi4 for ipq806x
  2020-03-13 19:58 Ansuel Smith
@ 2020-03-13 20:36 ` Stephen Boyd
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2020-03-13 20:36 UTC (permalink / raw)
  To: Ansuel Smith, agross
  Cc: Ansuel Smith, Mathieu Olivari, Bjorn Andersson, Rob Herring,
	Mark Rutland, Michael Turquette, linux-arm-msm, devicetree,
	linux-kernel, linux-clk

Quoting Ansuel Smith (2020-03-13 12:58:16)
> diff --git a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> index 554c65e7aa0e..580aec63030d 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> @@ -21,14 +21,5 @@ mux {
>                                 };
>                         };
>                 };
> -
> -               gsbi@16300000 {
> -                       i2c@16380000 {
> -                               status = "ok";
> -                               clock-frequency = <200000>;
> -                               pinctrl-0 = <&i2c4_pins>;
> -                               pinctrl-names = "default";
> -                       };
> -               };
>         };
>  };
> diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c
> index b0eee0903807..75706807e6cf 100644
> --- a/drivers/clk/qcom/gcc-ipq806x.c
> +++ b/drivers/clk/qcom/gcc-ipq806x.c
> @@ -782,7 +782,7 @@ static struct clk_rcg gsbi4_qup_src = {
>                         .parent_names = gcc_pxo_pll8,
>                         .num_parents = 2,
>                         .ops = &clk_rcg_ops,
> -                       .flags = CLK_SET_PARENT_GATE,
> +                       .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,

A better solution is to use the protected-clocks property so we don't
try to touch these clks at all on this device. So this whole patch can
be routed through arm-soc and remove the i2c node and add some dt
property to the gcc node.

>                 },
>         },
>  };

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

end of thread, other threads:[~2020-03-13 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 22:21 [PATCH] ARM: qcom: Disable i2c device on gsbi4 for ipq806x Mathieu Olivari
  -- strict thread matches above, loose matches on Subject: below --
2020-03-13 19:58 Ansuel Smith
2020-03-13 20:36 ` Stephen Boyd

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).