linux/drivers/clk/qcom/gcc-msm8939.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2020 Linaro Limited
 */

#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/clk-provider.h>
#include <linux/regmap.h>
#include <linux/reset-controller.h>

#include <dt-bindings/clock/qcom,gcc-msm8939.h>
#include <dt-bindings/reset/qcom,gcc-msm8939.h>

#include "common.h"
#include "clk-regmap.h"
#include "clk-pll.h"
#include "clk-rcg.h"
#include "clk-branch.h"
#include "reset.h"
#include "gdsc.h"

enum {};

static struct clk_pll gpll0 =;

static struct clk_regmap gpll0_vote =;

static struct clk_pll gpll1 =;

static struct clk_regmap gpll1_vote =;

static struct clk_pll gpll2 =;

static struct clk_regmap gpll2_vote =;

static struct clk_pll bimc_pll =;

static struct clk_regmap bimc_pll_vote =;

static struct clk_pll gpll3 =;

static struct clk_regmap gpll3_vote =;

/* GPLL3 at 1100 MHz, main output enabled. */
static const struct pll_config gpll3_config =;

static struct clk_pll gpll4 =;

static struct clk_regmap gpll4_vote =;

/* GPLL4 at 1200 MHz, main output enabled. */
static struct pll_config gpll4_config =;

static struct clk_pll gpll5 =;

static struct clk_regmap gpll5_vote =;

static struct clk_pll gpll6 =;

static struct clk_regmap gpll6_vote =;

static const struct parent_map gcc_xo_gpll0_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_bimc_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_bimc_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll6a_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll6a_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll2a_gpll3_gpll6a_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll2a_gpll3_gpll6a_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll2_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll2_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll2_gpll4_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll2_gpll4_parent_data[] =;

static const struct parent_map gcc_xo_gpll0a_map[] =;

static const struct clk_parent_data gcc_xo_gpll0a_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll1a_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll1a_sleep_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll1a_gpll6_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll1a_gpll6_sleep_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll1a_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll1a_parent_data[] =;

static const struct parent_map gcc_xo_dsibyte_map[] =;

static const struct clk_parent_data gcc_xo_dsibyte_parent_data[] =;

static const struct parent_map gcc_xo_gpll0a_dsibyte_map[] =;

static const struct clk_parent_data gcc_xo_gpll0a_dsibyte_parent_data[] =;

static const struct parent_map gcc_xo_gpll1_dsiphy_gpll6_gpll3a_gpll0a_map[] =;

static const struct clk_parent_data gcc_xo_gpll1_dsiphy_gpll6_gpll3a_gpll0a_parent_data[] =;

static const struct parent_map gcc_xo_gpll0a_dsiphy_map[] =;

static const struct clk_parent_data gcc_xo_gpll0a_dsiphy_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll5a_gpll6_bimc_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll5a_gpll6_bimc_parent_data[] =;

static const struct parent_map gcc_xo_gpll0_gpll1_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll0_gpll1_sleep_parent_data[] =;

static const struct parent_map gcc_xo_gpll1_epi2s_emclk_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll1_epi2s_emclk_sleep_parent_data[] =;

static const struct parent_map gcc_xo_gpll1_esi2s_emclk_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll1_esi2s_emclk_sleep_parent_data[] =;

static const struct parent_map gcc_xo_sleep_map[] =;

static const struct clk_parent_data gcc_xo_sleep_parent_data[] =;

static const struct parent_map gcc_xo_gpll1_emclk_sleep_map[] =;

static const struct clk_parent_data gcc_xo_gpll1_emclk_sleep_parent_data[] =;

static const struct clk_parent_data gcc_xo_gpll6_gpll0_parent_data[] =;

static const struct clk_parent_data gcc_xo_gpll6_gpll0a_parent_data[] =;

static struct clk_rcg2 pcnoc_bfdcd_clk_src =;

static struct clk_rcg2 system_noc_bfdcd_clk_src =;

static struct clk_rcg2 bimc_ddr_clk_src =;

static struct clk_rcg2 system_mm_noc_bfdcd_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_ahb_clk[] =;

static struct clk_rcg2 camss_ahb_clk_src =;

static const struct freq_tbl ftbl_apss_ahb_clk[] =;

static struct clk_rcg2 apss_ahb_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_csi0_1_2_clk[] =;

static struct clk_rcg2 csi0_clk_src =;

static struct clk_rcg2 csi1_clk_src =;

static struct clk_rcg2 csi2_clk_src =;

static const struct freq_tbl ftbl_gcc_oxili_gfx3d_clk[] =;

static struct clk_rcg2 gfx3d_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_vfe0_clk[] =;

static struct clk_rcg2 vfe0_clk_src =;

static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_i2c_apps_clk[] =;

static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src =;

static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_spi_apps_clk[] =;

static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src =;

static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src =;

static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src =;

static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src =;

static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src =;

static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src =;

static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src =;

static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src =;

static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src =;

static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src =;

static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src =;

static const struct freq_tbl ftbl_gcc_blsp1_uart1_6_apps_clk[] =;

static struct clk_rcg2 blsp1_uart1_apps_clk_src =;

static struct clk_rcg2 blsp1_uart2_apps_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_cci_clk[] =;

static struct clk_rcg2 cci_clk_src =;

/*
 * This is a frequency table for "General Purpose" clocks.
 * These clocks can be muxed to the SoC pins and may be used by
 * external devices. They're often used as PWM source.
 *
 * See comment at ftbl_gcc_gp1_3_clk.
 */
static const struct freq_tbl ftbl_gcc_camss_gp0_1_clk[] =;

static struct clk_rcg2 camss_gp0_clk_src =;

static struct clk_rcg2 camss_gp1_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_jpeg0_clk[] =;

static struct clk_rcg2 jpeg0_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_mclk0_1_clk[] =;

static struct clk_rcg2 mclk0_clk_src =;

static struct clk_rcg2 mclk1_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_csi0_1phytimer_clk[] =;

static struct clk_rcg2 csi0phytimer_clk_src =;

static struct clk_rcg2 csi1phytimer_clk_src =;

static const struct freq_tbl ftbl_gcc_camss_cpp_clk[] =;

static struct clk_rcg2 cpp_clk_src =;

static const struct freq_tbl ftbl_gcc_crypto_clk[] =;

/* This is not in the documentation but is in the downstream driver */
static struct clk_rcg2 crypto_clk_src =;

/*
 * This is a frequency table for "General Purpose" clocks.
 * These clocks can be muxed to the SoC pins and may be used by
 * external devices. They're often used as PWM source.
 *
 * Please note that MND divider must be enabled for duty-cycle
 * control to be possible. (M != N) Also since D register is configured
 * with a value multiplied by 2, and duty cycle is calculated as
 *                             (2 * D) % 2^W
 *                DutyCycle = ----------------
 *                              2 * (N % 2^W)
 * (where W = .mnd_width)
 * N must be half or less than maximum value for the register.
 * Otherwise duty-cycle control would be limited.
 * (e.g. for 8-bit NMD N should be less than 128)
 */
static const struct freq_tbl ftbl_gcc_gp1_3_clk[] =;

static struct clk_rcg2 gp1_clk_src =;

static struct clk_rcg2 gp2_clk_src =;

static struct clk_rcg2 gp3_clk_src =;

static struct clk_rcg2 byte0_clk_src =;

static struct clk_rcg2 byte1_clk_src =;

static const struct freq_tbl ftbl_gcc_mdss_esc_clk[] =;

static struct clk_rcg2 esc0_clk_src =;

static struct clk_rcg2 esc1_clk_src =;

static const struct freq_tbl ftbl_gcc_mdss_mdp_clk[] =;

static struct clk_rcg2 mdp_clk_src =;

static struct clk_rcg2 pclk0_clk_src =;

static struct clk_rcg2 pclk1_clk_src =;

static const struct freq_tbl ftbl_gcc_mdss_vsync_clk[] =;

static struct clk_rcg2 vsync_clk_src =;

static const struct freq_tbl ftbl_gcc_pdm2_clk[] =;

/* This is not in the documentation but is in the downstream driver */
static struct clk_rcg2 pdm2_clk_src =;

static const struct freq_tbl ftbl_gcc_sdcc_apps_clk[] =;

static struct clk_rcg2 sdcc1_apps_clk_src =;

static struct clk_rcg2 sdcc2_apps_clk_src =;

static const struct freq_tbl ftbl_gcc_apss_tcu_clk[] =;

static struct clk_rcg2 apss_tcu_clk_src =;

static const struct freq_tbl ftbl_gcc_bimc_gpu_clk[] =;

static struct clk_rcg2 bimc_gpu_clk_src =;

static const struct freq_tbl ftbl_gcc_usb_hs_system_clk[] =;

static struct clk_rcg2 usb_hs_system_clk_src =;

static const struct freq_tbl ftbl_gcc_usb_fs_system_clk[] =;

static struct clk_rcg2 usb_fs_system_clk_src =;

static const struct freq_tbl ftbl_gcc_usb_fs_ic_clk[] =;

static struct clk_rcg2 usb_fs_ic_clk_src =;

static const struct freq_tbl ftbl_gcc_ultaudio_ahb_clk[] =;

static struct clk_rcg2 ultaudio_ahbfabric_clk_src =;

static struct clk_branch gcc_ultaudio_ahbfabric_ixfabric_clk =;

static struct clk_branch gcc_ultaudio_ahbfabric_ixfabric_lpm_clk =;

static const struct freq_tbl ftbl_gcc_ultaudio_lpaif_i2s_clk[] =;

static struct clk_rcg2 ultaudio_lpaif_pri_i2s_clk_src =;

static struct clk_branch gcc_ultaudio_lpaif_pri_i2s_clk =;

static struct clk_rcg2 ultaudio_lpaif_sec_i2s_clk_src =;

static struct clk_branch gcc_ultaudio_lpaif_sec_i2s_clk =;

static struct clk_rcg2 ultaudio_lpaif_aux_i2s_clk_src =;

static struct clk_branch gcc_ultaudio_lpaif_aux_i2s_clk =;

static const struct freq_tbl ftbl_gcc_ultaudio_xo_clk[] =;

static struct clk_rcg2 ultaudio_xo_clk_src =;

static struct clk_branch gcc_ultaudio_avsync_xo_clk =;

static struct clk_branch gcc_ultaudio_stc_xo_clk =;

static const struct freq_tbl ftbl_codec_clk[] =;

static struct clk_rcg2 codec_digcodec_clk_src =;

static struct clk_branch gcc_codec_digcodec_clk =;

static struct clk_branch gcc_ultaudio_pcnoc_mport_clk =;

static struct clk_branch gcc_ultaudio_pcnoc_sway_clk =;

static const struct freq_tbl ftbl_gcc_venus0_vcodec0_clk[] =;

static struct clk_rcg2 vcodec0_clk_src =;

static struct clk_branch gcc_blsp1_ahb_clk =;

static struct clk_branch gcc_blsp1_sleep_clk =;

static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup1_spi_apps_clk =;

static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup2_spi_apps_clk =;

static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup3_spi_apps_clk =;

static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup4_spi_apps_clk =;

static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup5_spi_apps_clk =;

static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk =;

static struct clk_branch gcc_blsp1_qup6_spi_apps_clk =;

static struct clk_branch gcc_blsp1_uart1_apps_clk =;

static struct clk_branch gcc_blsp1_uart2_apps_clk =;

static struct clk_branch gcc_boot_rom_ahb_clk =;

static struct clk_branch gcc_camss_cci_ahb_clk =;

static struct clk_branch gcc_camss_cci_clk =;

static struct clk_branch gcc_camss_csi0_ahb_clk =;

static struct clk_branch gcc_camss_csi0_clk =;

static struct clk_branch gcc_camss_csi0phy_clk =;

static struct clk_branch gcc_camss_csi0pix_clk =;

static struct clk_branch gcc_camss_csi0rdi_clk =;

static struct clk_branch gcc_camss_csi1_ahb_clk =;

static struct clk_branch gcc_camss_csi1_clk =;

static struct clk_branch gcc_camss_csi1phy_clk =;

static struct clk_branch gcc_camss_csi1pix_clk =;

static struct clk_branch gcc_camss_csi1rdi_clk =;

static struct clk_branch gcc_camss_csi2_ahb_clk =;

static struct clk_branch gcc_camss_csi2_clk =;

static struct clk_branch gcc_camss_csi2phy_clk =;

static struct clk_branch gcc_camss_csi2pix_clk =;

static struct clk_branch gcc_camss_csi2rdi_clk =;

static struct clk_branch gcc_camss_csi_vfe0_clk =;

static struct clk_branch gcc_camss_gp0_clk =;

static struct clk_branch gcc_camss_gp1_clk =;

static struct clk_branch gcc_camss_ispif_ahb_clk =;

static struct clk_branch gcc_camss_jpeg0_clk =;

static struct clk_branch gcc_camss_jpeg_ahb_clk =;

static struct clk_branch gcc_camss_jpeg_axi_clk =;

static struct clk_branch gcc_camss_mclk0_clk =;

static struct clk_branch gcc_camss_mclk1_clk =;

static struct clk_branch gcc_camss_micro_ahb_clk =;

static struct clk_branch gcc_camss_csi0phytimer_clk =;

static struct clk_branch gcc_camss_csi1phytimer_clk =;

static struct clk_branch gcc_camss_ahb_clk =;

static struct clk_branch gcc_camss_top_ahb_clk =;

static struct clk_branch gcc_camss_cpp_ahb_clk =;

static struct clk_branch gcc_camss_cpp_clk =;

static struct clk_branch gcc_camss_vfe0_clk =;

static struct clk_branch gcc_camss_vfe_ahb_clk =;

static struct clk_branch gcc_camss_vfe_axi_clk =;

static struct clk_branch gcc_crypto_ahb_clk =;

static struct clk_branch gcc_crypto_axi_clk =;

static struct clk_branch gcc_crypto_clk =;

static struct clk_branch gcc_oxili_gmem_clk =;

static struct clk_branch gcc_gp1_clk =;

static struct clk_branch gcc_gp2_clk =;

static struct clk_branch gcc_gp3_clk =;

static struct clk_branch gcc_mdss_ahb_clk =;

static struct clk_branch gcc_mdss_axi_clk =;

static struct clk_branch gcc_mdss_byte0_clk =;

static struct clk_branch gcc_mdss_byte1_clk =;

static struct clk_branch gcc_mdss_esc0_clk =;

static struct clk_branch gcc_mdss_esc1_clk =;

static struct clk_branch gcc_mdss_mdp_clk =;

static struct clk_branch gcc_mdss_pclk0_clk =;

static struct clk_branch gcc_mdss_pclk1_clk =;

static struct clk_branch gcc_mdss_vsync_clk =;

static struct clk_branch gcc_mss_cfg_ahb_clk =;

static struct clk_branch gcc_mss_q6_bimc_axi_clk =;

static struct clk_branch gcc_oxili_ahb_clk =;

static struct clk_branch gcc_oxili_gfx3d_clk =;

static struct clk_branch gcc_pdm2_clk =;

static struct clk_branch gcc_pdm_ahb_clk =;

static struct clk_branch gcc_prng_ahb_clk =;

static struct clk_branch gcc_sdcc1_ahb_clk =;

static struct clk_branch gcc_sdcc1_apps_clk =;

static struct clk_branch gcc_sdcc2_ahb_clk =;

static struct clk_branch gcc_sdcc2_apps_clk =;

static struct clk_branch gcc_apss_tcu_clk =;

static struct clk_branch gcc_gfx_tcu_clk =;

static struct clk_branch gcc_gfx_tbu_clk =;

static struct clk_branch gcc_mdp_tbu_clk =;

static struct clk_branch gcc_venus_tbu_clk =;

static struct clk_branch gcc_vfe_tbu_clk =;

static struct clk_branch gcc_jpeg_tbu_clk =;

static struct clk_branch gcc_smmu_cfg_clk =;

static struct clk_branch gcc_gtcu_ahb_clk =;

static struct clk_branch gcc_cpp_tbu_clk =;

static struct clk_branch gcc_mdp_rt_tbu_clk =;

static struct clk_branch gcc_bimc_gfx_clk =;

static struct clk_branch gcc_bimc_gpu_clk =;

static struct clk_branch gcc_usb2a_phy_sleep_clk =;

static struct clk_branch gcc_usb_fs_ahb_clk =;

static struct clk_branch gcc_usb_fs_ic_clk =;

static struct clk_branch gcc_usb_fs_system_clk =;

static struct clk_branch gcc_usb_hs_ahb_clk =;

static struct clk_branch gcc_usb_hs_system_clk =;

static struct clk_branch gcc_venus0_ahb_clk =;

static struct clk_branch gcc_venus0_axi_clk =;

static struct clk_branch gcc_venus0_vcodec0_clk =;

static struct clk_branch gcc_venus0_core0_vcodec0_clk =;

static struct clk_branch gcc_venus0_core1_vcodec0_clk =;

static struct clk_branch gcc_oxili_timer_clk =;

static struct gdsc venus_gdsc =;

static struct gdsc mdss_gdsc =;

static struct gdsc jpeg_gdsc =;

static struct gdsc vfe_gdsc =;

static struct gdsc oxili_gdsc =;

static struct gdsc venus_core0_gdsc =;

static struct gdsc venus_core1_gdsc =;

static struct clk_regmap *gcc_msm8939_clocks[] =;

static struct gdsc *gcc_msm8939_gdscs[] =;

static const struct qcom_reset_map gcc_msm8939_resets[] =;

static const struct regmap_config gcc_msm8939_regmap_config =;

static const struct qcom_cc_desc gcc_msm8939_desc =;

static const struct of_device_id gcc_msm8939_match_table[] =;
MODULE_DEVICE_TABLE(of, gcc_msm8939_match_table);

static int gcc_msm8939_probe(struct platform_device *pdev)
{}

static struct platform_driver gcc_msm8939_driver =;

static int __init gcc_msm8939_init(void)
{}
core_initcall(gcc_msm8939_init);

static void __exit gcc_msm8939_exit(void)
{}
module_exit(gcc_msm8939_exit);

MODULE_DESCRIPTION();
MODULE_LICENSE();