// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2017 Chen-Yu Tsai <[email protected]> */ #include <linux/clk-provider.h> #include <linux/io.h> #include <linux/spinlock.h> #include "ccu_sdm.h" bool ccu_sdm_helper_is_enabled(struct ccu_common *common, struct ccu_sdm_internal *sdm) { … } EXPORT_SYMBOL_NS_GPL(…); void ccu_sdm_helper_enable(struct ccu_common *common, struct ccu_sdm_internal *sdm, unsigned long rate) { … } EXPORT_SYMBOL_NS_GPL(…); void ccu_sdm_helper_disable(struct ccu_common *common, struct ccu_sdm_internal *sdm) { … } EXPORT_SYMBOL_NS_GPL(…); /* * Sigma delta modulation provides a way to do fractional-N frequency * synthesis, in essence allowing the PLL to output any frequency * within its operational range. On earlier SoCs such as the A10/A20, * some PLLs support this. On later SoCs, all PLLs support this. * * The datasheets do not explain what the "wave top" and "wave bottom" * parameters mean or do, nor how to calculate the effective output * frequency. The only examples (and real world usage) are for the audio * PLL to generate 24.576 and 22.5792 MHz clock rates used by the audio * peripherals. The author lacks the underlying domain knowledge to * pursue this. * * The goal and function of the following code is to support the two * clock rates used by the audio subsystem, allowing for proper audio * playback and capture without any pitch or speed changes. */ bool ccu_sdm_helper_has_rate(struct ccu_common *common, struct ccu_sdm_internal *sdm, unsigned long rate) { … } EXPORT_SYMBOL_NS_GPL(…); unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common, struct ccu_sdm_internal *sdm, u32 m, u32 n) { … } EXPORT_SYMBOL_NS_GPL(…); int ccu_sdm_helper_get_factors(struct ccu_common *common, struct ccu_sdm_internal *sdm, unsigned long rate, unsigned long *m, unsigned long *n) { … } EXPORT_SYMBOL_NS_GPL(…);