Skip to contentSkip to conversation

clk: sunxi-ng: r40: Allow setting parent rate for external clock outputs

PATCH Applied Chen-Yu Tsai 2 participants 2 messages Dec 18, 2019

Subsystems (2)
lore
Share & tools
lore

Chen-Yu Tsai

author maintainer
#0 lore raw

PATCH 1/1 clk: sunxi-ng: r40: Allow setting parent rate for external clock outputs

From: Chen-Yu Tsai <[email protected]>

One of the uses of the external clock outputs is to provide a stable 32768 Hz clock signal to WiFi and Bluetooth chips. On the R40, the RTC has an internal RC oscillator that is muxed with the external crystal.

Allow setting the parent rate for the external clock outputs so that requests for 32768 Hz get passed to the RTC's clock driver to mux in the external crystal if it isn't already muxed correctly.

Fixes cd030a78f7aa ("clk: sunxi-ng: support R40 SoC")
Fixes 01a7ea763fc4 ("clk: sunxi-ng: r40: Force LOSC parent to RTC LOSC output")
---
 drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/sunxi-ng/ccu-sun8i-r40.c +4 -2
index 897490800102..23bfe1d12f21 100644
@@ -761,7 +761,8 @@ static struct ccu_mp outa_clk = {
 		.reg		= 0x1f0,
 		.features	= CCU_FEATURE_FIXED_PREDIV,
 		.hw.init	= CLK_HW_INIT_PARENTS("outa", out_parents,
-						      &ccu_mp_ops, 0),
+						      &ccu_mp_ops,
+						      CLK_SET_RATE_PARENT),
 	}
 };
 
@@ -779,7 +780,8 @@ static struct ccu_mp outb_clk = {
 		.reg		= 0x1f4,
 		.features	= CCU_FEATURE_FIXED_PREDIV,
 		.hw.init	= CLK_HW_INIT_PARENTS("outb", out_parents,
-						      &ccu_mp_ops, 0),
+						      &ccu_mp_ops,
+						      CLK_SET_RATE_PARENT),
 	}
 };
 
Signature · 1 line
2.24.0
#1 lore raw
Quoted 6 lines · Chen-Yu Tsai

From: Chen-Yu Tsai <[email protected]>

One of the uses of the external clock outputs is to provide a stable 32768 Hz clock signal to WiFi and Bluetooth chips. On the R40, the RTC has an internal RC oscillator that is muxed with the external crystal.

Quoted 8 lines

Allow setting the parent rate for the external clock outputs so that requests for 32768 Hz get passed to the RTC's clock driver to mux in the external crystal if it isn't already muxed correctly.

Fixes cd030a78f7aa ("clk: sunxi-ng: support R40 SoC")
Fixes 01a7ea763fc4 ("clk: sunxi-ng: r40: Force LOSC parent to RTC LOSC output")

Applied, thanks!
Maxime