linux/drivers/pmdomain/qcom/rpmhpd.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.*/

#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/pm_domain.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <soc/qcom/cmd-db.h>
#include <soc/qcom/rpmh.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/power/qcom,rpmhpd.h>

#define domain_to_rpmhpd(domain)

#define RPMH_ARC_MAX_LEVELS

/**
 * struct rpmhpd - top level RPMh power domain resource data structure
 * @dev:		rpmh power domain controller device
 * @pd:			generic_pm_domain corresponding to the power domain
 * @parent:		generic_pm_domain corresponding to the parent's power domain
 * @peer:		A peer power domain in case Active only Voting is
 *			supported
 * @active_only:	True if it represents an Active only peer
 * @corner:		current corner
 * @active_corner:	current active corner
 * @enable_corner:	lowest non-zero corner
 * @level:		An array of level (vlvl) to corner (hlvl) mappings
 *			derived from cmd-db
 * @level_count:	Number of levels supported by the power domain. max
 *			being 16 (0 - 15)
 * @enabled:		true if the power domain is enabled
 * @res_name:		Resource name used for cmd-db lookup
 * @addr:		Resource address as looped up using resource name from
 *			cmd-db
 * @state_synced:	Indicator that sync_state has been invoked for the rpmhpd resource
 * @skip_retention_level: Indicate that retention level should not be used for the power domain
 */
struct rpmhpd {};

struct rpmhpd_desc {};

static DEFINE_MUTEX(rpmhpd_lock);

/* RPMH powerdomains */

static struct rpmhpd cx_ao;
static struct rpmhpd mx;
static struct rpmhpd mx_ao;
static struct rpmhpd cx =;

static struct rpmhpd cx_ao =;

static struct rpmhpd cx_ao_w_mx_parent;
static struct rpmhpd cx_w_mx_parent =;

static struct rpmhpd cx_ao_w_mx_parent =;

static struct rpmhpd ebi =;

static struct rpmhpd gfx =;

static struct rpmhpd lcx =;

static struct rpmhpd lmx =;

static struct rpmhpd mmcx_ao;
static struct rpmhpd mmcx =;

static struct rpmhpd mmcx_ao =;

static struct rpmhpd mmcx_ao_w_cx_parent;
static struct rpmhpd mmcx_w_cx_parent =;

static struct rpmhpd mmcx_ao_w_cx_parent =;

static struct rpmhpd mss =;

static struct rpmhpd mx_ao;
static struct rpmhpd mx =;

static struct rpmhpd mx_ao =;

static struct rpmhpd mxc_ao;
static struct rpmhpd mxc =;

static struct rpmhpd mxc_ao =;

static struct rpmhpd nsp =;

static struct rpmhpd nsp0 =;

static struct rpmhpd nsp1 =;

static struct rpmhpd nsp2 =;

static struct rpmhpd qphy =;

static struct rpmhpd gmxc =;

/* SA8540P RPMH powerdomains */
static struct rpmhpd *sa8540p_rpmhpds[] =;

static const struct rpmhpd_desc sa8540p_desc =;

/* SA8775P RPMH power domains */
static struct rpmhpd *sa8775p_rpmhpds[] =;

static const struct rpmhpd_desc sa8775p_desc =;

/* SDM670 RPMH powerdomains */
static struct rpmhpd *sdm670_rpmhpds[] =;

static const struct rpmhpd_desc sdm670_desc =;

/* SDM845 RPMH powerdomains */
static struct rpmhpd *sdm845_rpmhpds[] =;

static const struct rpmhpd_desc sdm845_desc =;

/* SDX55 RPMH powerdomains */
static struct rpmhpd *sdx55_rpmhpds[] =;

static const struct rpmhpd_desc sdx55_desc =;

/* SDX65 RPMH powerdomains */
static struct rpmhpd *sdx65_rpmhpds[] =;

static const struct rpmhpd_desc sdx65_desc =;

/* SDX75 RPMH powerdomains */
static struct rpmhpd *sdx75_rpmhpds[] =;

static const struct rpmhpd_desc sdx75_desc =;

/* SM6350 RPMH powerdomains */
static struct rpmhpd *sm6350_rpmhpds[] =;

static const struct rpmhpd_desc sm6350_desc =;

/* SM7150 RPMH powerdomains */
static struct rpmhpd *sm7150_rpmhpds[] =;

static const struct rpmhpd_desc sm7150_desc =;

/* SM8150 RPMH powerdomains */
static struct rpmhpd *sm8150_rpmhpds[] =;

static const struct rpmhpd_desc sm8150_desc =;

static struct rpmhpd *sa8155p_rpmhpds[] =;

static const struct rpmhpd_desc sa8155p_desc =;

/* SM8250 RPMH powerdomains */
static struct rpmhpd *sm8250_rpmhpds[] =;

static const struct rpmhpd_desc sm8250_desc =;

/* SM8350 Power domains */
static struct rpmhpd *sm8350_rpmhpds[] =;

static const struct rpmhpd_desc sm8350_desc =;

/* SM8450 RPMH powerdomains */
static struct rpmhpd *sm8450_rpmhpds[] =;

static const struct rpmhpd_desc sm8450_desc =;

/* SM8550 RPMH powerdomains */
static struct rpmhpd *sm8550_rpmhpds[] =;

static const struct rpmhpd_desc sm8550_desc =;

/* SM8650 RPMH powerdomains */
static struct rpmhpd *sm8650_rpmhpds[] =;

static const struct rpmhpd_desc sm8650_desc =;

/* QDU1000/QRU1000 RPMH powerdomains */
static struct rpmhpd *qdu1000_rpmhpds[] =;

static const struct rpmhpd_desc qdu1000_desc =;

/* SC7180 RPMH powerdomains */
static struct rpmhpd *sc7180_rpmhpds[] =;

static const struct rpmhpd_desc sc7180_desc =;

/* SC7280 RPMH powerdomains */
static struct rpmhpd *sc7280_rpmhpds[] =;

static const struct rpmhpd_desc sc7280_desc =;

/* SC8180x RPMH powerdomains */
static struct rpmhpd *sc8180x_rpmhpds[] =;

static const struct rpmhpd_desc sc8180x_desc =;

/* SC8280xp RPMH powerdomains */
static struct rpmhpd *sc8280xp_rpmhpds[] =;

static const struct rpmhpd_desc sc8280xp_desc =;

/* X1E80100 RPMH powerdomains */
static struct rpmhpd *x1e80100_rpmhpds[] =;

static const struct rpmhpd_desc x1e80100_desc =;

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

static int rpmhpd_send_corner(struct rpmhpd *pd, int state,
			      unsigned int corner, bool sync)
{}

static void to_active_sleep(struct rpmhpd *pd, unsigned int corner,
			    unsigned int *active, unsigned int *sleep)
{}

/*
 * This function is used to aggregate the votes across the active only
 * resources and its peers. The aggregated votes are sent to RPMh as
 * ACTIVE_ONLY votes (which take effect immediately), as WAKE_ONLY votes
 * (applied by RPMh on system wakeup) and as SLEEP votes (applied by RPMh
 * on system sleep).
 * We send ACTIVE_ONLY votes for resources without any peers. For others,
 * which have an active only peer, all 3 votes are sent.
 */
static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner)
{}

static int rpmhpd_power_on(struct generic_pm_domain *domain)
{}

static int rpmhpd_power_off(struct generic_pm_domain *domain)
{}

static int rpmhpd_set_performance_state(struct generic_pm_domain *domain,
					unsigned int level)
{}

static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd)
{}

static int rpmhpd_probe(struct platform_device *pdev)
{}

static void rpmhpd_sync_state(struct device *dev)
{}

static struct platform_driver rpmhpd_driver =;

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

MODULE_DESCRIPTION();
MODULE_LICENSE();