#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/bitops.h>
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/topology.h>
#include <asm/processor.h>
#include <asm/msr.h>
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
#define REG_NORTHBRIDGE_CAP …
#define REG_PROCESSOR_TDP …
#define REG_TDP_RUNNING_AVERAGE …
#define REG_TDP_LIMIT3 …
#define FAM15H_MIN_NUM_ATTRS …
#define FAM15H_NUM_GROUPS …
#define MAX_CUS …
#define MAX_INTERVAL …
#define PCI_DEVICE_ID_AMD_15H_M70H_NB_F4 …
struct fam15h_power_data { … };
static bool is_carrizo_or_later(void)
{ … }
static ssize_t power1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(power1_input);
static ssize_t power1_crit_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(power1_crit);
static void do_read_registers_on_cu(void *_data)
{ … }
static int read_registers(struct fam15h_power_data *data)
{ … }
static ssize_t power1_average_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(power1_average);
static ssize_t power1_average_interval_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t power1_average_interval_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(power1_average_interval);
static int fam15h_power_init_attrs(struct pci_dev *pdev,
struct fam15h_power_data *data)
{ … }
static bool should_load_on_this_node(struct pci_dev *f4)
{ … }
static const struct pci_device_id affected_device[] = …;
static void tweak_runavg_range(struct pci_dev *pdev)
{ … }
#ifdef CONFIG_PM
static int fam15h_power_resume(struct pci_dev *pdev)
{ … }
#else
#define fam15h_power_resume …
#endif
static int fam15h_power_init_data(struct pci_dev *f4,
struct fam15h_power_data *data)
{ … }
static int fam15h_power_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static const struct pci_device_id fam15h_power_id_table[] = …;
MODULE_DEVICE_TABLE(pci, fam15h_power_id_table);
static struct pci_driver fam15h_power_driver = …;
module_pci_driver(…) …;