linux/drivers/pmdomain/mediatek/mtk-scpsys.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015 Pengutronix, Sascha Hauer <[email protected]>
 */
#include <linux/clk.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/regulator/consumer.h>
#include <linux/soc/mediatek/infracfg.h>

#include <dt-bindings/power/mt2701-power.h>
#include <dt-bindings/power/mt2712-power.h>
#include <dt-bindings/power/mt6797-power.h>
#include <dt-bindings/power/mt7622-power.h>
#include <dt-bindings/power/mt7623a-power.h>
#include <dt-bindings/power/mt8173-power.h>

#define MTK_POLL_DELAY_US
#define MTK_POLL_TIMEOUT

#define MTK_SCPD_ACTIVE_WAKEUP
#define MTK_SCPD_FWAIT_SRAM
#define MTK_SCPD_CAPS(_scpd, _x)

#define SPM_VDE_PWR_CON
#define SPM_MFG_PWR_CON
#define SPM_VEN_PWR_CON
#define SPM_ISP_PWR_CON
#define SPM_DIS_PWR_CON
#define SPM_CONN_PWR_CON
#define SPM_VEN2_PWR_CON
#define SPM_AUDIO_PWR_CON
#define SPM_BDP_PWR_CON
#define SPM_ETH_PWR_CON
#define SPM_HIF_PWR_CON
#define SPM_IFR_MSC_PWR_CON
#define SPM_MFG_2D_PWR_CON
#define SPM_MFG_ASYNC_PWR_CON
#define SPM_USB_PWR_CON
#define SPM_USB2_PWR_CON
#define SPM_ETHSYS_PWR_CON
#define SPM_HIF0_PWR_CON
#define SPM_HIF1_PWR_CON
#define SPM_WB_PWR_CON

#define SPM_PWR_STATUS
#define SPM_PWR_STATUS_2ND

#define PWR_RST_B_BIT
#define PWR_ISO_BIT
#define PWR_ON_BIT
#define PWR_ON_2ND_BIT
#define PWR_CLK_DIS_BIT

#define PWR_STATUS_CONN
#define PWR_STATUS_DISP
#define PWR_STATUS_MFG
#define PWR_STATUS_ISP
#define PWR_STATUS_VDEC
#define PWR_STATUS_BDP
#define PWR_STATUS_ETH
#define PWR_STATUS_HIF
#define PWR_STATUS_IFR_MSC
#define PWR_STATUS_USB2
#define PWR_STATUS_VENC_LT
#define PWR_STATUS_VENC
#define PWR_STATUS_MFG_2D
#define PWR_STATUS_MFG_ASYNC
#define PWR_STATUS_AUDIO
#define PWR_STATUS_USB
#define PWR_STATUS_ETHSYS
#define PWR_STATUS_HIF0
#define PWR_STATUS_HIF1
#define PWR_STATUS_WB

enum clk_id {};

static const char * const clk_names[] =;

#define MAX_CLKS

/**
 * struct scp_domain_data - scp domain data for power on/off flow
 * @name: The domain name.
 * @sta_mask: The mask for power on/off status bit.
 * @ctl_offs: The offset for main power control register.
 * @sram_pdn_bits: The mask for sram power control bits.
 * @sram_pdn_ack_bits: The mask for sram power control acked bits.
 * @bus_prot_mask: The mask for single step bus protection.
 * @clk_id: The basic clocks required by this power domain.
 * @caps: The flag for active wake-up action.
 */
struct scp_domain_data {};

struct scp;

struct scp_domain {};

struct scp_ctrl_reg {};

struct scp {};

struct scp_subdomain {};

struct scp_soc_data {};

static int scpsys_domain_is_on(struct scp_domain *scpd)
{}

static int scpsys_regulator_enable(struct scp_domain *scpd)
{}

static int scpsys_regulator_disable(struct scp_domain *scpd)
{}

static void scpsys_clk_disable(struct clk *clk[], int max_num)
{}

static int scpsys_clk_enable(struct clk *clk[], int max_num)
{}

static int scpsys_sram_enable(struct scp_domain *scpd, void __iomem *ctl_addr)
{}

static int scpsys_sram_disable(struct scp_domain *scpd, void __iomem *ctl_addr)
{}

static int scpsys_bus_protect_enable(struct scp_domain *scpd)
{}

static int scpsys_bus_protect_disable(struct scp_domain *scpd)
{}

static int scpsys_power_on(struct generic_pm_domain *genpd)
{}

static int scpsys_power_off(struct generic_pm_domain *genpd)
{}

static void init_clks(struct platform_device *pdev, struct clk **clk)
{}

static struct scp *init_scp(struct platform_device *pdev,
			const struct scp_domain_data *scp_domain_data, int num,
			const struct scp_ctrl_reg *scp_ctrl_reg,
			bool bus_prot_reg_update)
{}

static void mtk_register_power_domains(struct platform_device *pdev,
				struct scp *scp, int num)
{}

/*
 * MT2701 power domain support
 */

static const struct scp_domain_data scp_domain_data_mt2701[] =;

/*
 * MT2712 power domain support
 */
static const struct scp_domain_data scp_domain_data_mt2712[] =;

static const struct scp_subdomain scp_subdomain_mt2712[] =;

/*
 * MT6797 power domain support
 */

static const struct scp_domain_data scp_domain_data_mt6797[] =;

#define SPM_PWR_STATUS_MT6797
#define SPM_PWR_STATUS_2ND_MT6797

static const struct scp_subdomain scp_subdomain_mt6797[] =;

/*
 * MT7622 power domain support
 */

static const struct scp_domain_data scp_domain_data_mt7622[] =;

/*
 * MT7623A power domain support
 */

static const struct scp_domain_data scp_domain_data_mt7623a[] =;

/*
 * MT8173 power domain support
 */

static const struct scp_domain_data scp_domain_data_mt8173[] =;

static const struct scp_subdomain scp_subdomain_mt8173[] =;

static const struct scp_soc_data mt2701_data =;

static const struct scp_soc_data mt2712_data =;

static const struct scp_soc_data mt6797_data =;

static const struct scp_soc_data mt7622_data =;

static const struct scp_soc_data mt7623a_data =;

static const struct scp_soc_data mt8173_data =;

/*
 * scpsys driver init
 */

static const struct of_device_id of_scpsys_match_tbl[] =;

static int scpsys_probe(struct platform_device *pdev)
{}

static struct platform_driver scpsys_drv =;
builtin_platform_driver();