Lines Matching +full:ext +full:- +full:32 +full:k
1 // SPDX-License-Identifier: GPL-2.0-only
7 #include <linux/clk-provider.h>
14 #include <linux/clk/sunxi-ng.h>
22 #include "ccu-sun6i-rtc.h"
35 #define IOSC_32K_PRE_DIV 32
84 u32 reg = readl(cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_recalc_rate()
88 * (fixed-point divider * 32768) into bit zero. in ccu_iosc_recalc_rate()
91 return reg >> (IOSC_CLK_CALI_DIV_ONES - LOSC_RATE_SHIFT); in ccu_iosc_recalc_rate()
125 val = readl(cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_prepare()
127 cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_prepare()
140 val = readl(cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_unprepare()
142 cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_unprepare()
152 val = readl(cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_recalc_rate()
154 /* Assume the calibrated 32k clock is accurate. */ in ccu_iosc_32k_recalc_rate()
159 val = readl(cm->base + IOSC_32K_CLK_DIV_REG) & IOSC_32K_CLK_DIV; in ccu_iosc_32k_recalc_rate()
171 val = readl(cm->base + IOSC_CLK_CALI_REG); in ccu_iosc_32k_recalc_accuracy()
173 /* Assume the calibrated 32k clock is accurate. */ in ccu_iosc_32k_recalc_accuracy()
189 .hw.init = CLK_HW_INIT_HW("iosc-32k", &iosc_clk.hw,
196 static SUNXI_CCU_GATE_HWS(ext_osc32k_gate_clk, "ext-osc32k-gate",
231 .hw.init = CLK_HW_INIT_PARENTS_DATA("osc24M-32k", osc24M,
242 .name = "rtc-32k",
259 .name = "osc32k-fanout",
305 { .fw_name = "pll-32k" },
330 .compatible = "allwinner,sun50i-h616-rtc",
334 .compatible = "allwinner,sun50i-r329-rtc",
352 data = match->data; in sun6i_rtc_ccu_probe()
353 have_iosc_calibration = data->have_iosc_calibration; in sun6i_rtc_ccu_probe()
355 if (data->have_ext_osc32k) { in sun6i_rtc_ccu_probe()
358 /* ext-osc32k was the only input clock in the old binding. */ in sun6i_rtc_ccu_probe()
359 fw_name = of_property_present(dev->of_node, "clock-names") in sun6i_rtc_ccu_probe()
360 ? "ext-osc32k" : NULL; in sun6i_rtc_ccu_probe()
367 /* Link ext-osc32k-gate to its parent. */ in sun6i_rtc_ccu_probe()
370 /* ext-osc32k-gate is an orphan, so do not register it. */ in sun6i_rtc_ccu_probe()
375 if (data->rtc_32k_single_parent) in sun6i_rtc_ccu_probe()
378 osc32k_fanout_init_data.parent_data = data->osc32k_fanout_parents; in sun6i_rtc_ccu_probe()
379 osc32k_fanout_init_data.num_parents = data->osc32k_fanout_nparents; in sun6i_rtc_ccu_probe()