]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: sun6i: disable automatic clock input switching
authorMichael Walle <mwalle@kernel.org>
Tue, 30 Jul 2024 19:49:05 +0000 (21:49 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 11 Sep 2024 22:33:33 +0000 (00:33 +0200)
The V3(s) will detect a valid external low frequency clock and if it is
not present will automatically switch to the internal one. This might
hide bugs and (hardware) configuration errors. It's even worse because
the internal RTC runs significantly slower (32.000Hz vs 32.768Hz).
Fortunately for us, the V3(s) has an (undocumented) bypass of this
switching and the driver already supports it by setting the
.has_auto_swt flag.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20240730194905.2587202-1-mwalle@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-sun6i.c

index 8e0c669061036c1beb6bd677f1dacb26cba8273c..e681c1745866e7f8790b9af97550897079846578 100644 (file)
@@ -402,6 +402,7 @@ CLK_OF_DECLARE_DRIVER(sun8i_r40_rtc_clk, "allwinner,sun8i-r40-rtc",
 static const struct sun6i_rtc_clk_data sun8i_v3_rtc_data = {
        .rc_osc_rate = 32000,
        .has_out_clk = 1,
+       .has_auto_swt = 1,
 };
 
 static void __init sun8i_v3_rtc_clk_init(struct device_node *node)