linux/drivers/powercap/intel_rapl_msr.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Intel Running Average Power Limit (RAPL) Driver via MSR interface
 * Copyright (c) 2019, Intel Corporation.
 */
#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/log2.h>
#include <linux/bitmap.h>
#include <linux/delay.h>
#include <linux/sysfs.h>
#include <linux/cpu.h>
#include <linux/powercap.h>
#include <linux/suspend.h>
#include <linux/intel_rapl.h>
#include <linux/processor.h>
#include <linux/platform_device.h>

#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>

/* Local defines */
#define MSR_PLATFORM_POWER_LIMIT
#define MSR_VR_CURRENT_CONFIG

/* private data for RAPL MSR Interface */
static struct rapl_if_priv *rapl_msr_priv;

static struct rapl_if_priv rapl_msr_priv_intel =;

static struct rapl_if_priv rapl_msr_priv_amd =;

/* Handles CPU hotplug on multi-socket systems.
 * If a CPU goes online as the first CPU of the physical package
 * we add the RAPL package to the system. Similarly, when the last
 * CPU of the package is removed, we remove the RAPL package and its
 * associated domains. Cooling devices are handled accordingly at
 * per-domain level.
 */
static int rapl_cpu_online(unsigned int cpu)
{}

static int rapl_cpu_down_prep(unsigned int cpu)
{}

static int rapl_msr_read_raw(int cpu, struct reg_action *ra)
{}

static void rapl_msr_update_func(void *info)
{}

static int rapl_msr_write_raw(int cpu, struct reg_action *ra)
{}

/* List of verified CPUs. */
static const struct x86_cpu_id pl4_support_ids[] =;

static int rapl_msr_probe(struct platform_device *pdev)
{}

static void rapl_msr_remove(struct platform_device *pdev)
{}

static const struct platform_device_id rapl_msr_ids[] =;
MODULE_DEVICE_TABLE(platform, rapl_msr_ids);

static struct platform_driver intel_rapl_msr_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();