/* SPDX-License-Identifier: GPL-2.0-only */


#ifndef __QCOM_SYSMON_SUBSYSTEM_STATS_H__
#define __QCOM_SYSMON_SUBSYSTEM_STATS_H__

#define SYSMON_POWER_STATS_MAX_CLK_LEVELS 16



#define DSP_PMU_COUNTER_NA 0x1


struct sysmon_smem_power_stats {
	u32 clk_arr[SYSMON_POWER_STATS_MAX_CLK_LEVELS];
	

	u32 active_time[SYSMON_POWER_STATS_MAX_CLK_LEVELS];
	

	u32 pc_time;
	

	u32 lpi_time;
	
};

struct sysmon_smem_q6_event_stats {
	u32 QDSP6_clk;
	

	u32 Ab_vote_lsb;
	

	u32 Ab_vote_msb;
	

	u32 Ib_vote_lsb;
	

	u32 Ib_vote_msb;
	

	u32 Sleep_latency;
	
};

struct sleep_stats {
	u32 stat_type;
	

	u32 count;
	

	u64 last_entered_at;
	

	u64 last_exited_at;
	

	u64 accumulated;
	
};

struct sleep_stats_island {
	u32 stat_type;
	

	u32 count;
	

	u64 last_entered_at;
	

	u64 last_exited_at;
	

	u64 accumulated;
	
};

enum dsp_id_t {
	ADSP = 2,
	SLPI,
	CDSP = 5
};

int sysmon_stats_query_power_residency(enum dsp_id_t dsp_id,
		struct sysmon_smem_power_stats *sysmon_power_stats);

int sysmon_stats_query_q6_votes(enum dsp_id_t dsp_id,
		struct sysmon_smem_q6_event_stats *sysmon_q6_event_stats);

int sysmon_stats_query_q6_load(enum dsp_id_t dsp_id,
							u32 *q6load_avg);

int sysmon_stats_query_sleep(enum dsp_id_t dsp_id,
					struct sleep_stats *sleep_stats_lpm,
					struct sleep_stats_island *sleep_stats_lpi);

int sysmon_stats_query_hvx_utlization(u32 *hvx_util);


int sysmon_stats_query_hmx_utlization(u32 *hmx_util);
#endif
