linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/2] clk: pxa: export 32kHz PLL
@ 2018-06-27 19:41 Robert Jarzmik
  2018-06-27 19:41 ` [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller Robert Jarzmik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert Jarzmik @ 2018-06-27 19:41 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Rob Herring,
	Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk

This clock is especially used by the RTC driver, so export it so that
devicetree users can use it.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c
---
 drivers/clk/pxa/clk-pxa25x.c          | 6 ++++--
 drivers/clk/pxa/clk-pxa27x.c          | 7 ++++---
 drivers/clk/pxa/clk-pxa3xx.c          | 7 ++++---
 include/dt-bindings/clock/pxa-clock.h | 3 ++-
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/pxa/clk-pxa25x.c b/drivers/clk/pxa/clk-pxa25x.c
index 6416c1f8e632..e88f8e01fe3a 100644
--- a/drivers/clk/pxa/clk-pxa25x.c
+++ b/drivers/clk/pxa/clk-pxa25x.c
@@ -292,8 +292,10 @@ static void __init pxa25x_register_plls(void)
 {
 	clk_register_fixed_rate(NULL, "osc_3_6864mhz", NULL,
 				CLK_GET_RATE_NOCACHE, 3686400);
-	clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
-				CLK_GET_RATE_NOCACHE, 32768);
+	clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL,
+			    clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
+						    CLK_GET_RATE_NOCACHE,
+						    32768));
 	clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0);
 	clk_register_fixed_factor(NULL, "ppll_95_85mhz", "osc_3_6864mhz",
 				  0, 26, 1);
diff --git a/drivers/clk/pxa/clk-pxa27x.c b/drivers/clk/pxa/clk-pxa27x.c
index 25a30194d27a..d40b63e7bbce 100644
--- a/drivers/clk/pxa/clk-pxa27x.c
+++ b/drivers/clk/pxa/clk-pxa27x.c
@@ -314,9 +314,10 @@ static void __init pxa27x_register_plls(void)
 	clk_register_fixed_rate(NULL, "osc_13mhz", NULL,
 				CLK_GET_RATE_NOCACHE,
 				13 * MHz);
-	clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
-				CLK_GET_RATE_NOCACHE,
-				32768 * KHz);
+	clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL,
+			    clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
+						    CLK_GET_RATE_NOCACHE,
+						    32768 * KHz));
 	clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0);
 	clk_register_fixed_factor(NULL, "ppll_312mhz", "osc_13mhz", 0, 24, 1);
 }
diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c
index 2d126df2bccd..7aa120c3bd08 100644
--- a/drivers/clk/pxa/clk-pxa3xx.c
+++ b/drivers/clk/pxa/clk-pxa3xx.c
@@ -286,9 +286,10 @@ static void __init pxa3xx_register_plls(void)
 	clk_register_fixed_rate(NULL, "osc_13mhz", NULL,
 				CLK_GET_RATE_NOCACHE,
 				13 * MHz);
-	clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
-				CLK_GET_RATE_NOCACHE,
-				32768);
+	clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL,
+			    clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
+						    CLK_GET_RATE_NOCACHE,
+						    32768));
 	clk_register_fixed_rate(NULL, "ring_osc_120mhz", NULL,
 				CLK_GET_RATE_NOCACHE,
 				120 * MHz);
diff --git a/include/dt-bindings/clock/pxa-clock.h b/include/dt-bindings/clock/pxa-clock.h
index e65803b1dc7e..0b0fd2b01538 100644
--- a/include/dt-bindings/clock/pxa-clock.h
+++ b/include/dt-bindings/clock/pxa-clock.h
@@ -72,6 +72,7 @@
 #define CLK_USIM 58
 #define CLK_USIM1 59
 #define CLK_USMI0 60
-#define CLK_MAX 61
+#define CLK_OSC32k768 61
+#define CLK_MAX 62
 
 #endif
-- 
2.11.0


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

* [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller
  2018-06-27 19:41 [PATCH v4 1/2] clk: pxa: export 32kHz PLL Robert Jarzmik
@ 2018-06-27 19:41 ` Robert Jarzmik
  2018-06-27 21:40   ` Rob Herring
       [not found] ` <87d0w2gsa5.fsf@belgarion.home>
  2018-07-06 20:53 ` Stephen Boyd
  2 siblings, 1 reply; 6+ messages in thread
From: Robert Jarzmik @ 2018-06-27 19:41 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Rob Herring,
	Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk

The RTC controller is fed by an external fixed 32kHz clock. Yet the
driver wants to acquire this clock, even though it doesn't make any use
of it, ie. doesn't get the rate to make calculation.

Therefore, use the exported 32.768kHz clock in the PXA clock tree to
make the driver happy and working.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
Since v1: change the dummy clock by the actual 32.768kHz
Since v3: remove spurious bracket
---
 arch/arm/boot/dts/pxa25x.dtsi | 4 ++++
 arch/arm/boot/dts/pxa27x.dtsi | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi
index 95d59be97213..8494b5787170 100644
--- a/arch/arm/boot/dts/pxa25x.dtsi
+++ b/arch/arm/boot/dts/pxa25x.dtsi
@@ -80,6 +80,10 @@
 			#pwm-cells = <1>;
 			clocks = <&clks CLK_PWM1>;
 		};
+
+		rtc@40900000 {
+			clocks = <&clks CLK_OSC32k768>;
+		};
 	};
 
 	timer@40a00000 {
diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index 747f750f675d..2ab6986433c8 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -113,6 +113,10 @@
 
 			status = "disabled";
 		};
+
+		rtc@40900000 {
+			clocks = <&clks CLK_OSC32k768>;
+		};
 	};
 
 	clocks {
-- 
2.11.0


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

* Re: [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller
  2018-06-27 19:41 ` [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller Robert Jarzmik
@ 2018-06-27 21:40   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2018-06-27 21:40 UTC (permalink / raw)
  To: robert.jarzmik
  Cc: daniel, haojian.zhuang, Rob Herring, Mark Rutland,
	Mike Turquette, Stephen Boyd, linux-arm-kernel, devicetree,
	Linux Kernel Mailing List, linux-clk

On Wed, Jun 27, 2018 at 1:41 PM Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>
> The RTC controller is fed by an external fixed 32kHz clock. Yet the
> driver wants to acquire this clock, even though it doesn't make any use
> of it, ie. doesn't get the rate to make calculation.
>
> Therefore, use the exported 32.768kHz clock in the PXA clock tree to
> make the driver happy and working.
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
> Since v1: change the dummy clock by the actual 32.768kHz
> Since v3: remove spurious bracket
> ---
>  arch/arm/boot/dts/pxa25x.dtsi | 4 ++++
>  arch/arm/boot/dts/pxa27x.dtsi | 4 ++++
>  2 files changed, 8 insertions(+)

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v4 1/2] clk: pxa: export 32kHz PLL
       [not found] ` <87d0w2gsa5.fsf@belgarion.home>
@ 2018-07-06 20:52   ` Stephen Boyd
  2018-07-07 19:30     ` Robert Jarzmik
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2018-07-06 20:52 UTC (permalink / raw)
  To: Michael Turquette, Robert Jarzmik
  Cc: Mark Rutland, devicetree, linux-kernel, Haojian Zhuang,
	Rob Herring, linux-clk, linux-arm-kernel

Quoting Robert Jarzmik (2018-07-04 22:34:10)
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
> 
> > This clock is especially used by the RTC driver, so export it so that
> > devicetree users can use it.
> >
> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> > ---
> > Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c
> 
> Hi Michael and Stephen,
> 
> Could you have a look please ?
> 

I'll apply patch 1, and leave patch 2 to someone else?


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

* Re: [PATCH v4 1/2] clk: pxa: export 32kHz PLL
  2018-06-27 19:41 [PATCH v4 1/2] clk: pxa: export 32kHz PLL Robert Jarzmik
  2018-06-27 19:41 ` [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller Robert Jarzmik
       [not found] ` <87d0w2gsa5.fsf@belgarion.home>
@ 2018-07-06 20:53 ` Stephen Boyd
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2018-07-06 20:53 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Mark Rutland, Michael Turquette,
	Rob Herring, Robert Jarzmik
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk

Quoting Robert Jarzmik (2018-06-27 12:41:23)
> This clock is especially used by the RTC driver, so export it so that
> devicetree users can use it.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---

Applied to clk-next


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

* Re: [PATCH v4 1/2] clk: pxa: export 32kHz PLL
  2018-07-06 20:52   ` [PATCH v4 1/2] clk: pxa: export 32kHz PLL Stephen Boyd
@ 2018-07-07 19:30     ` Robert Jarzmik
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Jarzmik @ 2018-07-07 19:30 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, Mark Rutland, devicetree, linux-kernel,
	Haojian Zhuang, Rob Herring, linux-clk, linux-arm-kernel

Stephen Boyd <sboyd@kernel.org> writes:

> Quoting Robert Jarzmik (2018-07-04 22:34:10)
>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>> 
>> > This clock is especially used by the RTC driver, so export it so that
>> > devicetree users can use it.
>> >
>> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>> > ---
>> > Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c
>> 
>> Hi Michael and Stephen,
>> 
>> Could you have a look please ?
>> 
>
> I'll apply patch 1, and leave patch 2 to someone else?
As there is a dependency of patch 2 on patch 1, and with the Reviewed-by
provided by Rob, I'd appreciate you take it as well. If not, I'll queue it up
for the next cycle in my pxa tree.

Cheers.

-- 
Robert

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

end of thread, other threads:[~2018-07-07 19:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 19:41 [PATCH v4 1/2] clk: pxa: export 32kHz PLL Robert Jarzmik
2018-06-27 19:41 ` [PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller Robert Jarzmik
2018-06-27 21:40   ` Rob Herring
     [not found] ` <87d0w2gsa5.fsf@belgarion.home>
2018-07-06 20:52   ` [PATCH v4 1/2] clk: pxa: export 32kHz PLL Stephen Boyd
2018-07-07 19:30     ` Robert Jarzmik
2018-07-06 20:53 ` 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).