From c1487d2de2795b0564f8c420b74238b76d1c1b10 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Wed, 21 Apr 2021 12:46:43 +0100 Subject: [PATCH 057/169] drv:rtc: sun6i: Add Allwinner H616 support The H616 RTC changes its day storage to the newly introduced linear day scheme, so pair the new compatible string with this feature flag. The clock part is missing an external 32768 Hz oscillator input pin, for future expansion we must thus ignore any provided clock for now. Signed-off-by: Andre Przywara --- drivers/rtc/rtc-sun6i.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index be6057a2e..8b6c45e35 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -397,6 +397,23 @@ static void __init sun50i_h6_rtc_clk_init(struct device_node *node) CLK_OF_DECLARE_DRIVER(sun50i_h6_rtc_clk, "allwinner,sun50i-h6-rtc", sun50i_h6_rtc_clk_init); +static const struct sun6i_rtc_clk_data sun50i_h616_rtc_data = { + .rc_osc_rate = 16000000, + .fixed_prescaler = 32, + .has_prescaler = 1, + .has_out_clk = 1, + .export_iosc = 1, + .no_ext_losc = 1, +}; + +static void __init sun50i_h616_rtc_clk_init(struct device_node *node) +{ + sun6i_rtc_clk_init(node, &sun50i_h616_rtc_data); +} + +CLK_OF_DECLARE_DRIVER(sun50i_h616_rtc_clk, "allwinner,sun50i-h616-rtc", + sun50i_h616_rtc_clk_init); + /* * The R40 user manual is self-conflicting on whether the prescaler is * fixed or configurable. The clock diagram shows it as fixed, but there -- 2.35.3