#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-apq8084.h>
#include <dt-bindings/reset/qcom,gcc-apq8084.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 gpll4 = …;
static struct clk_regmap gpll4_vote = …;
static const struct parent_map gcc_xo_gpll0_map[] = …;
static const struct clk_parent_data gcc_xo_gpll0[] = …;
static const struct parent_map gcc_xo_gpll0_gpll4_map[] = …;
static const struct clk_parent_data gcc_xo_gpll0_gpll4[] = …;
static const struct parent_map gcc_xo_sata_asic0_map[] = …;
static const struct clk_parent_data gcc_xo_sata_asic0[] = …;
static const struct parent_map gcc_xo_sata_rx_map[] = …;
static const struct clk_parent_data gcc_xo_sata_rx[] = …;
static const struct parent_map gcc_xo_pcie_map[] = …;
static const struct clk_parent_data gcc_xo_pcie[] = …;
static const struct parent_map gcc_xo_pcie_sleep_map[] = …;
static const struct clk_parent_data gcc_xo_pcie_sleep[] = …;
static struct clk_rcg2 config_noc_clk_src = …;
static struct clk_rcg2 periph_noc_clk_src = …;
static struct clk_rcg2 system_noc_clk_src = …;
static const struct freq_tbl ftbl_gcc_ufs_axi_clk[] = …;
static struct clk_rcg2 ufs_axi_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb30_master_clk[] = …;
static struct clk_rcg2 usb30_master_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb30_sec_master_clk[] = …;
static struct clk_rcg2 usb30_sec_master_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb30_sec_mock_utmi_clk[] = …;
static struct clk_rcg2 usb30_sec_mock_utmi_clk_src = …;
static struct clk_branch gcc_usb30_sec_mock_utmi_clk = …;
static struct clk_branch gcc_usb30_sec_sleep_clk = …;
static const struct freq_tbl ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk[] = …;
static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = …;
static const struct freq_tbl ftbl_gcc_blsp1_2_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_2_uart1_6_apps_clk[] = …;
static struct clk_rcg2 blsp1_uart1_apps_clk_src = …;
static struct clk_rcg2 blsp1_uart2_apps_clk_src = …;
static struct clk_rcg2 blsp1_uart3_apps_clk_src = …;
static struct clk_rcg2 blsp1_uart4_apps_clk_src = …;
static struct clk_rcg2 blsp1_uart5_apps_clk_src = …;
static struct clk_rcg2 blsp1_uart6_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = …;
static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart1_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart2_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart3_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart4_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart5_apps_clk_src = …;
static struct clk_rcg2 blsp2_uart6_apps_clk_src = …;
static const struct freq_tbl ftbl_gcc_ce1_clk[] = …;
static struct clk_rcg2 ce1_clk_src = …;
static const struct freq_tbl ftbl_gcc_ce2_clk[] = …;
static struct clk_rcg2 ce2_clk_src = …;
static const struct freq_tbl ftbl_gcc_ce3_clk[] = …;
static struct clk_rcg2 ce3_clk_src = …;
static const struct freq_tbl ftbl_gcc_gp_clk[] = …;
static struct clk_rcg2 gp1_clk_src = …;
static struct clk_rcg2 gp2_clk_src = …;
static struct clk_rcg2 gp3_clk_src = …;
static const struct freq_tbl ftbl_gcc_pcie_0_1_aux_clk[] = …;
static struct clk_rcg2 pcie_0_aux_clk_src = …;
static struct clk_rcg2 pcie_1_aux_clk_src = …;
static const struct freq_tbl ftbl_gcc_pcie_0_1_pipe_clk[] = …;
static struct clk_rcg2 pcie_0_pipe_clk_src = …;
static struct clk_rcg2 pcie_1_pipe_clk_src = …;
static const struct freq_tbl ftbl_gcc_pdm2_clk[] = …;
static struct clk_rcg2 pdm2_clk_src = …;
static const struct freq_tbl ftbl_gcc_sata_asic0_clk[] = …;
static struct clk_rcg2 sata_asic0_clk_src = …;
static const struct freq_tbl ftbl_gcc_sata_pmalive_clk[] = …;
static struct clk_rcg2 sata_pmalive_clk_src = …;
static const struct freq_tbl ftbl_gcc_sata_rx_clk[] = …;
static struct clk_rcg2 sata_rx_clk_src = …;
static const struct freq_tbl ftbl_gcc_sata_rx_oob_clk[] = …;
static struct clk_rcg2 sata_rx_oob_clk_src = …;
static const struct freq_tbl ftbl_gcc_sdcc1_4_apps_clk[] = …;
static struct clk_rcg2 sdcc1_apps_clk_src = …;
static struct clk_rcg2 sdcc2_apps_clk_src = …;
static struct clk_rcg2 sdcc3_apps_clk_src = …;
static struct clk_rcg2 sdcc4_apps_clk_src = …;
static const struct freq_tbl ftbl_gcc_tsif_ref_clk[] = …;
static struct clk_rcg2 tsif_ref_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb30_mock_utmi_clk[] = …;
static struct clk_rcg2 usb30_mock_utmi_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_hsic_clk[] = …;
static const struct parent_map usb_hsic_clk_src_map[] = …;
static struct clk_rcg2 usb_hsic_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb_hsic_ahb_clk_src[] = …;
static struct clk_rcg2 usb_hsic_ahb_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb_hsic_io_cal_clk[] = …;
static struct clk_rcg2 usb_hsic_io_cal_clk_src = …;
static const struct freq_tbl ftbl_gcc_usb_hsic_mock_utmi_clk[] = …;
static struct clk_rcg2 usb_hsic_mock_utmi_clk_src = …;
static struct clk_branch gcc_usb_hsic_mock_utmi_clk = …;
static const struct freq_tbl ftbl_gcc_usb_hsic_system_clk[] = …;
static struct clk_rcg2 usb_hsic_system_clk_src = …;
static struct clk_regmap gcc_mmss_gpll0_clk_src = …;
static struct clk_branch gcc_bam_dma_ahb_clk = …;
static struct clk_branch gcc_blsp1_ahb_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_blsp1_uart3_apps_clk = …;
static struct clk_branch gcc_blsp1_uart4_apps_clk = …;
static struct clk_branch gcc_blsp1_uart5_apps_clk = …;
static struct clk_branch gcc_blsp1_uart6_apps_clk = …;
static struct clk_branch gcc_blsp2_ahb_clk = …;
static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = …;
static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = …;
static struct clk_branch gcc_blsp2_uart1_apps_clk = …;
static struct clk_branch gcc_blsp2_uart2_apps_clk = …;
static struct clk_branch gcc_blsp2_uart3_apps_clk = …;
static struct clk_branch gcc_blsp2_uart4_apps_clk = …;
static struct clk_branch gcc_blsp2_uart5_apps_clk = …;
static struct clk_branch gcc_blsp2_uart6_apps_clk = …;
static struct clk_branch gcc_boot_rom_ahb_clk = …;
static struct clk_branch gcc_ce1_ahb_clk = …;
static struct clk_branch gcc_ce1_axi_clk = …;
static struct clk_branch gcc_ce1_clk = …;
static struct clk_branch gcc_ce2_ahb_clk = …;
static struct clk_branch gcc_ce2_axi_clk = …;
static struct clk_branch gcc_ce2_clk = …;
static struct clk_branch gcc_ce3_ahb_clk = …;
static struct clk_branch gcc_ce3_axi_clk = …;
static struct clk_branch gcc_ce3_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_ocmem_noc_cfg_ahb_clk = …;
static struct clk_branch gcc_pcie_0_aux_clk = …;
static struct clk_branch gcc_pcie_0_cfg_ahb_clk = …;
static struct clk_branch gcc_pcie_0_mstr_axi_clk = …;
static struct clk_branch gcc_pcie_0_pipe_clk = …;
static struct clk_branch gcc_pcie_0_slv_axi_clk = …;
static struct clk_branch gcc_pcie_1_aux_clk = …;
static struct clk_branch gcc_pcie_1_cfg_ahb_clk = …;
static struct clk_branch gcc_pcie_1_mstr_axi_clk = …;
static struct clk_branch gcc_pcie_1_pipe_clk = …;
static struct clk_branch gcc_pcie_1_slv_axi_clk = …;
static struct clk_branch gcc_pdm2_clk = …;
static struct clk_branch gcc_pdm_ahb_clk = …;
static struct clk_branch gcc_periph_noc_usb_hsic_ahb_clk = …;
static struct clk_branch gcc_prng_ahb_clk = …;
static struct clk_branch gcc_sata_asic0_clk = …;
static struct clk_branch gcc_sata_axi_clk = …;
static struct clk_branch gcc_sata_cfg_ahb_clk = …;
static struct clk_branch gcc_sata_pmalive_clk = …;
static struct clk_branch gcc_sata_rx_clk = …;
static struct clk_branch gcc_sata_rx_oob_clk = …;
static struct clk_branch gcc_sdcc1_ahb_clk = …;
static struct clk_branch gcc_sdcc1_apps_clk = …;
static struct clk_branch gcc_sdcc1_cdccal_ff_clk = …;
static struct clk_branch gcc_sdcc1_cdccal_sleep_clk = …;
static struct clk_branch gcc_sdcc2_ahb_clk = …;
static struct clk_branch gcc_sdcc2_apps_clk = …;
static struct clk_branch gcc_sdcc3_ahb_clk = …;
static struct clk_branch gcc_sdcc3_apps_clk = …;
static struct clk_branch gcc_sdcc4_ahb_clk = …;
static struct clk_branch gcc_sdcc4_apps_clk = …;
static struct clk_branch gcc_sys_noc_ufs_axi_clk = …;
static struct clk_branch gcc_sys_noc_usb3_axi_clk = …;
static struct clk_branch gcc_sys_noc_usb3_sec_axi_clk = …;
static struct clk_branch gcc_tsif_ahb_clk = …;
static struct clk_branch gcc_tsif_inactivity_timers_clk = …;
static struct clk_branch gcc_tsif_ref_clk = …;
static struct clk_branch gcc_ufs_ahb_clk = …;
static struct clk_branch gcc_ufs_axi_clk = …;
static struct clk_branch gcc_ufs_rx_cfg_clk = …;
static struct clk_branch gcc_ufs_rx_symbol_0_clk = …;
static struct clk_branch gcc_ufs_rx_symbol_1_clk = …;
static struct clk_branch gcc_ufs_tx_cfg_clk = …;
static struct clk_branch gcc_ufs_tx_symbol_0_clk = …;
static struct clk_branch gcc_ufs_tx_symbol_1_clk = …;
static struct clk_branch gcc_usb2a_phy_sleep_clk = …;
static struct clk_branch gcc_usb2b_phy_sleep_clk = …;
static struct clk_branch gcc_usb30_master_clk = …;
static struct clk_branch gcc_usb30_sec_master_clk = …;
static struct clk_branch gcc_usb30_mock_utmi_clk = …;
static struct clk_branch gcc_usb30_sleep_clk = …;
static struct clk_branch gcc_usb_hs_ahb_clk = …;
static struct clk_branch gcc_usb_hs_inactivity_timers_clk = …;
static struct clk_branch gcc_usb_hs_system_clk = …;
static struct clk_branch gcc_usb_hsic_ahb_clk = …;
static struct clk_branch gcc_usb_hsic_clk = …;
static struct clk_branch gcc_usb_hsic_io_cal_clk = …;
static struct clk_branch gcc_usb_hsic_io_cal_sleep_clk = …;
static struct clk_branch gcc_usb_hsic_system_clk = …;
static struct gdsc usb_hs_hsic_gdsc = …;
static struct gdsc pcie0_gdsc = …;
static struct gdsc pcie1_gdsc = …;
static struct gdsc usb30_gdsc = …;
static struct clk_regmap *gcc_apq8084_clocks[] = …;
static struct gdsc *gcc_apq8084_gdscs[] = …;
static const struct qcom_reset_map gcc_apq8084_resets[] = …;
static const struct regmap_config gcc_apq8084_regmap_config = …;
static const struct qcom_cc_desc gcc_apq8084_desc = …;
static const struct of_device_id gcc_apq8084_match_table[] = …;
MODULE_DEVICE_TABLE(of, gcc_apq8084_match_table);
static int gcc_apq8084_probe(struct platform_device *pdev)
{ … }
static struct platform_driver gcc_apq8084_driver = …;
static int __init gcc_apq8084_init(void)
{ … }
core_initcall(gcc_apq8084_init);
static void __exit gcc_apq8084_exit(void)
{ … }
module_exit(gcc_apq8084_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;