linux/drivers/clk/qcom/mmcc-sdm660.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2020, Martin Botka <[email protected]>
 * Copyright (c) 2020, Konrad Dybcio <[email protected]>
 */

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


#include <dt-bindings/clock/qcom,mmcc-sdm660.h>

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

enum {};

static const struct parent_map mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll8_gpll0_gpll0_div_map[] =;

/* Voteable PLL */
static struct clk_alpha_pll mmpll0 =;

static struct clk_alpha_pll mmpll6 =;

/* APSS controlled PLLs */
static const struct pll_vco vco[] =;

static const struct pll_vco mmpll3_vco[] =;

static const struct alpha_pll_config mmpll10_config =;

static struct clk_alpha_pll mmpll10 =;

static const struct alpha_pll_config mmpll3_config =;

static struct clk_alpha_pll mmpll3 =;

static const struct alpha_pll_config mmpll4_config =;

static struct clk_alpha_pll mmpll4 =;

static const struct alpha_pll_config mmpll5_config =;

static struct clk_alpha_pll mmpll5 =;

static const struct alpha_pll_config mmpll7_config =;

static struct clk_alpha_pll mmpll7 =;

static const struct alpha_pll_config mmpll8_config =;

static struct clk_alpha_pll mmpll8 =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll8_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_dsibyte_map[] =;

static const struct clk_parent_data mmcc_xo_dsibyte[] =;

static const struct parent_map mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_mmpll4_mmpll7_mmpll10_sleep_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll4_mmpll7_mmpll10_sleep_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_mmpll0_mmpll7_mmpll10_sleep_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll7_mmpll10_sleep_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_dplink_dpvco_map[] =;

static const struct clk_parent_data mmcc_xo_dplink_dpvco[] =;

static const struct parent_map mmcc_xo_mmpll0_mmpll5_mmpll7_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll5_mmpll7_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_dsi0pll_dsi1pll_map[] =;

static const struct clk_parent_data mmcc_xo_dsi0pll_dsi1pll[] =;

static const struct parent_map mmcc_mmpll0_mmpll4_mmpll7_mmpll10_mmpll6_gpll0_map[] =;

static const struct clk_parent_data mmcc_mmpll0_mmpll4_mmpll7_mmpll10_mmpll6_gpll0[] =;

static const struct parent_map mmcc_xo_mmpll0_gpll0_gpll0_div_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_gpll0_gpll0_div[] =;

static const struct parent_map mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_mmpll6_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll4_mmpll7_mmpll10_gpll0_mmpll6[] =;

static const struct parent_map mmcc_xo_mmpll0_mmpll8_mmpll3_mmpll6_gpll0_mmpll7_map[] =;

static const struct clk_parent_data mmcc_xo_mmpll0_mmpll8_mmpll3_mmpll6_gpll0_mmpll7[] =;

static const struct freq_tbl ftbl_ahb_clk_src[] =;

static struct clk_rcg2 ahb_clk_src =;

static struct clk_rcg2 byte0_clk_src =;

static struct clk_rcg2 byte1_clk_src =;

static const struct freq_tbl ftbl_camss_gp0_clk_src[] =;

static struct clk_rcg2 camss_gp0_clk_src =;

static struct clk_rcg2 camss_gp1_clk_src =;

static const struct freq_tbl ftbl_cci_clk_src[] =;

static struct clk_rcg2 cci_clk_src =;

static const struct freq_tbl ftbl_cpp_clk_src[] =;

static struct clk_rcg2 cpp_clk_src =;

static const struct freq_tbl ftbl_csi0_clk_src[] =;

static struct clk_rcg2 csi0_clk_src =;

static const struct freq_tbl ftbl_csi0phytimer_clk_src[] =;

static struct clk_rcg2 csi0phytimer_clk_src =;

static struct clk_rcg2 csi1_clk_src =;

static struct clk_rcg2 csi1phytimer_clk_src =;

static struct clk_rcg2 csi2_clk_src =;

static struct clk_rcg2 csi2phytimer_clk_src =;

static struct clk_rcg2 csi3_clk_src =;

static const struct freq_tbl ftbl_csiphy_clk_src[] =;

static struct clk_rcg2 csiphy_clk_src =;

static const struct freq_tbl ftbl_dp_aux_clk_src[] =;

static struct clk_rcg2 dp_aux_clk_src =;

static const struct freq_tbl ftbl_dp_crypto_clk_src[] =;

static struct clk_rcg2 dp_crypto_clk_src =;

static const struct freq_tbl ftbl_dp_gtc_clk_src[] =;

static struct clk_rcg2 dp_gtc_clk_src =;

static const struct freq_tbl ftbl_dp_link_clk_src[] =;

static struct clk_rcg2 dp_link_clk_src =;

static struct clk_rcg2 dp_pixel_clk_src =;

static struct clk_rcg2 esc0_clk_src =;

static struct clk_rcg2 esc1_clk_src =;

static const struct freq_tbl ftbl_jpeg0_clk_src[] =;

static struct clk_rcg2 jpeg0_clk_src =;

static const struct freq_tbl ftbl_mclk0_clk_src[] =;

static struct clk_rcg2 mclk0_clk_src =;

static struct clk_rcg2 mclk1_clk_src =;

static struct clk_rcg2 mclk2_clk_src =;

static struct clk_rcg2 mclk3_clk_src =;

static const struct freq_tbl ftbl_mdp_clk_src[] =;

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_rot_clk_src[] =;

static struct clk_rcg2 rot_clk_src =;

static const struct freq_tbl ftbl_vfe0_clk_src[] =;

static struct clk_rcg2 vfe0_clk_src =;

static struct clk_rcg2 vfe1_clk_src =;

static const struct freq_tbl ftbl_video_core_clk_src[] =;

static struct clk_rcg2 video_core_clk_src =;

static struct clk_rcg2 vsync_clk_src =;

static struct clk_branch bimc_smmu_ahb_clk =;

static struct clk_branch bimc_smmu_axi_clk =;

static struct clk_branch camss_ahb_clk =;

static struct clk_branch camss_cci_ahb_clk =;

static struct clk_branch camss_cci_clk =;

static struct clk_branch camss_cpp_ahb_clk =;

static struct clk_branch camss_cpp_axi_clk =;

static struct clk_branch camss_cpp_clk =;

static struct clk_branch camss_cpp_vbif_ahb_clk =;

static struct clk_branch camss_csi0_ahb_clk =;

static struct clk_branch camss_csi0_clk =;

static struct clk_branch camss_csi0phytimer_clk =;

static struct clk_branch camss_csi0pix_clk =;

static struct clk_branch camss_csi0rdi_clk =;

static struct clk_branch camss_csi1_ahb_clk =;

static struct clk_branch camss_csi1_clk =;

static struct clk_branch camss_csi1phytimer_clk =;

static struct clk_branch camss_csi1pix_clk =;

static struct clk_branch camss_csi1rdi_clk =;

static struct clk_branch camss_csi2_ahb_clk =;

static struct clk_branch camss_csi2_clk =;

static struct clk_branch camss_csi2phytimer_clk =;

static struct clk_branch camss_csi2pix_clk =;

static struct clk_branch camss_csi2rdi_clk =;

static struct clk_branch camss_csi3_ahb_clk =;

static struct clk_branch camss_csi3_clk =;

static struct clk_branch camss_csi3pix_clk =;

static struct clk_branch camss_csi3rdi_clk =;

static struct clk_branch camss_csi_vfe0_clk =;

static struct clk_branch camss_csi_vfe1_clk =;

static struct clk_branch camss_csiphy0_clk =;

static struct clk_branch camss_csiphy1_clk =;

static struct clk_branch camss_csiphy2_clk =;


static struct clk_branch camss_cphy_csid0_clk =;

static struct clk_branch camss_cphy_csid1_clk =;

static struct clk_branch camss_cphy_csid2_clk =;

static struct clk_branch camss_cphy_csid3_clk =;

static struct clk_branch camss_gp0_clk =;

static struct clk_branch camss_gp1_clk =;

static struct clk_branch camss_ispif_ahb_clk =;

static struct clk_branch camss_jpeg0_clk =;

static struct clk_branch camss_jpeg_ahb_clk =;

static struct clk_branch camss_jpeg_axi_clk =;

static struct clk_branch throttle_camss_axi_clk =;

static struct clk_branch camss_mclk0_clk =;

static struct clk_branch camss_mclk1_clk =;

static struct clk_branch camss_mclk2_clk =;

static struct clk_branch camss_mclk3_clk =;

static struct clk_branch camss_micro_ahb_clk =;

static struct clk_branch camss_top_ahb_clk =;

static struct clk_branch camss_vfe0_ahb_clk =;

static struct clk_branch camss_vfe0_clk =;

static struct clk_branch camss_vfe0_stream_clk =;

static struct clk_branch camss_vfe1_ahb_clk =;

static struct clk_branch camss_vfe1_clk =;

static struct clk_branch camss_vfe1_stream_clk =;

static struct clk_branch camss_vfe_vbif_ahb_clk =;

static struct clk_branch camss_vfe_vbif_axi_clk =;

static struct clk_branch csiphy_ahb2crif_clk =;

static struct clk_branch mdss_ahb_clk =;

static const struct freq_tbl ftbl_axi_clk_src[] =;

/* RO to linux */
static struct clk_rcg2 axi_clk_src =;

static struct clk_branch mdss_axi_clk =;

static struct clk_branch throttle_mdss_axi_clk =;

static struct clk_branch mdss_byte0_clk =;

static struct clk_regmap_div mdss_byte0_intf_div_clk =;

static struct clk_branch mdss_byte0_intf_clk =;

static struct clk_branch mdss_byte1_clk =;

static struct clk_regmap_div mdss_byte1_intf_div_clk =;

static struct clk_branch mdss_byte1_intf_clk =;

static struct clk_branch mdss_dp_aux_clk =;

static struct clk_branch mdss_dp_crypto_clk =;

static struct clk_branch mdss_dp_gtc_clk =;

static struct clk_branch mdss_dp_link_clk =;

/* Reset state of MDSS_DP_LINK_INTF_DIV is 0x3 (div-4) */
static struct clk_branch mdss_dp_link_intf_clk =;

static struct clk_branch mdss_dp_pixel_clk =;

static struct clk_branch mdss_esc0_clk =;

static struct clk_branch mdss_esc1_clk =;

static struct clk_branch mdss_hdmi_dp_ahb_clk =;

static struct clk_branch mdss_mdp_clk =;

static struct clk_branch mdss_pclk0_clk =;

static struct clk_branch mdss_pclk1_clk =;

static struct clk_branch mdss_rot_clk =;

static struct clk_branch mdss_vsync_clk =;

static struct clk_branch mnoc_ahb_clk =;

static struct clk_branch misc_ahb_clk =;

static struct clk_branch misc_cxo_clk =;

static struct clk_branch snoc_dvm_axi_clk =;

static struct clk_branch video_ahb_clk =;

static struct clk_branch video_axi_clk =;

static struct clk_branch throttle_video_axi_clk =;

static struct clk_branch video_core_clk =;

static struct clk_branch video_subcore0_clk =;

static struct gdsc venus_gdsc =;

static struct gdsc venus_core0_gdsc =;

static struct gdsc mdss_gdsc =;

static struct gdsc camss_top_gdsc =;

static struct gdsc camss_vfe0_gdsc =;

static struct gdsc camss_vfe1_gdsc =;

static struct gdsc camss_cpp_gdsc =;

/* This GDSC seems to hang the whole multimedia subsystem.
static struct gdsc bimc_smmu_gdsc = {
	.gdscr = 0xe020,
	.gds_hw_ctrl = 0xe024,
	.pd = {
		.name = "bimc_smmu",
	},
	.pwrsts = PWRSTS_OFF_ON,
	.parent = &bimc_smmu_gdsc.pd,
	.flags = HW_CTRL,
};
*/

static struct clk_regmap *mmcc_660_clocks[] =;

static struct gdsc *mmcc_sdm660_gdscs[] =;

static const struct qcom_reset_map mmcc_660_resets[] =;

static const struct regmap_config mmcc_660_regmap_config =;

static const struct qcom_cc_desc mmcc_660_desc =;

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

static void sdm630_clock_override(void)
{}

static int mmcc_660_probe(struct platform_device *pdev)
{}

static struct platform_driver mmcc_660_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();