#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/mfd/intel_pmc_bxt.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/seq_file.h>
#include <linux/suspend.h>
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/intel_telemetry.h>
#define DRIVER_NAME …
#define DRIVER_VERSION …
#define TELEM_APL_PSS_PSTATES_ID …
#define TELEM_APL_PSS_IDLE_ID …
#define TELEM_APL_PCS_IDLE_BLOCKED_ID …
#define TELEM_APL_PCS_S0IX_BLOCKED_ID …
#define TELEM_APL_PSS_WAKEUP_ID …
#define TELEM_APL_PSS_LTR_BLOCKING_ID …
#define TELEM_APL_S0IX_TOTAL_OCC_ID …
#define TELEM_APL_S0IX_SHLW_OCC_ID …
#define TELEM_APL_S0IX_DEEP_OCC_ID …
#define TELEM_APL_S0IX_TOTAL_RES_ID …
#define TELEM_APL_S0IX_SHLW_RES_ID …
#define TELEM_APL_S0IX_DEEP_RES_ID …
#define TELEM_APL_D0IX_ID …
#define TELEM_APL_D3_ID …
#define TELEM_APL_PG_ID …
#define TELEM_INFO_SRAMEVTS_MASK …
#define TELEM_INFO_SRAMEVTS_SHIFT …
#define TELEM_SSRAM_READ_TIMEOUT …
#define TELEM_MASK_BIT …
#define TELEM_MASK_BYTE …
#define BYTES_PER_LONG …
#define TELEM_APL_MASK_PCS_STATE …
#define TELEM_PSS_IDLE_EVTS …
#define TELEM_PSS_IDLE_BLOCKED_EVTS …
#define TELEM_PSS_S0IX_BLOCKED_EVTS …
#define TELEM_PSS_S0IX_WAKEUP_EVTS …
#define TELEM_PSS_LTR_BLOCKING_EVTS …
#define TELEM_IOSS_DX_D0IX_EVTS …
#define TELEM_IOSS_PG_EVTS …
#define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) …
#define TELEM_CHECK_AND_PARSE_CTRS(EVTID, CTR) …
static u8 suspend_prep_ok;
static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp;
static u64 suspend_shlw_res_temp, suspend_deep_res_temp;
struct telemetry_susp_stats { … };
struct telem_pss_idle_stateinfo { … };
static struct telem_pss_idle_stateinfo telem_apl_pss_idle_data[] = …;
struct telem_pcs_blkd_info { … };
static struct telem_pcs_blkd_info telem_apl_pcs_idle_blkd_data[] = …;
static struct telem_pcs_blkd_info telem_apl_pcs_s0ix_blkd_data[] = …;
struct telem_pss_ltr_info { … };
static struct telem_pss_ltr_info telem_apl_pss_ltr_data[] = …;
struct telem_pss_wakeup_info { … };
static struct telem_pss_wakeup_info telem_apl_pss_wakeup[] = …;
struct telem_ioss_d0ix_stateinfo { … };
static struct telem_ioss_d0ix_stateinfo telem_apl_ioss_d0ix_data[] = …;
struct telem_ioss_pg_info { … };
static struct telem_ioss_pg_info telem_apl_ioss_pg_data[] = …;
struct telemetry_debugfs_conf { … };
static struct telemetry_debugfs_conf *debugfs_conf;
static struct telemetry_debugfs_conf telem_apl_debugfs_conf = …;
static const struct x86_cpu_id telemetry_debugfs_cpu_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, telemetry_debugfs_cpu_ids);
static int telemetry_debugfs_check_evts(void)
{ … }
static int telem_pss_states_show(struct seq_file *s, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int telem_ioss_states_show(struct seq_file *s, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int telem_soc_states_show(struct seq_file *s, void *unused)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int telem_s0ix_res_get(void *data, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int telem_pss_trc_verb_show(struct seq_file *s, void *unused)
{ … }
static ssize_t telem_pss_trc_verb_write(struct file *file,
const char __user *userbuf,
size_t count, loff_t *ppos)
{ … }
static int telem_pss_trc_verb_open(struct inode *inode, struct file *file)
{ … }
static const struct file_operations telem_pss_trc_verb_ops = …;
static int telem_ioss_trc_verb_show(struct seq_file *s, void *unused)
{ … }
static ssize_t telem_ioss_trc_verb_write(struct file *file,
const char __user *userbuf,
size_t count, loff_t *ppos)
{ … }
static int telem_ioss_trc_verb_open(struct inode *inode, struct file *file)
{ … }
static const struct file_operations telem_ioss_trc_verb_ops = …;
static int pm_suspend_prep_cb(void)
{ … }
static int pm_suspend_exit_cb(void)
{ … }
static int pm_notification(struct notifier_block *this,
unsigned long event, void *ptr)
{ … }
static struct notifier_block pm_notifier = …;
static int __init telemetry_debugfs_init(void)
{ … }
static void __exit telemetry_debugfs_exit(void)
{ … }
late_initcall(telemetry_debugfs_init);
module_exit(telemetry_debugfs_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;