#include <linux/hwmon-sysfs.h>
#include <linux/hwmon.h>
#include <linux/types.h>
#include <drm/drm_managed.h>
#include "regs/xe_gt_regs.h"
#include "regs/xe_mchbar_regs.h"
#include "regs/xe_pcode_regs.h"
#include "xe_device.h"
#include "xe_gt.h"
#include "xe_hwmon.h"
#include "xe_mmio.h"
#include "xe_pcode.h"
#include "xe_pcode_api.h"
#include "xe_sriov.h"
#include "xe_pm.h"
enum xe_hwmon_reg { … };
enum xe_hwmon_reg_operation { … };
enum xe_hwmon_channel { … };
#define SF_POWER …
#define SF_CURR …
#define SF_VOLTAGE …
#define SF_ENERGY …
#define SF_TIME …
struct xe_hwmon_energy_info { … };
struct xe_hwmon { … };
static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg,
int channel)
{ … }
#define PL1_DISABLE …
static void xe_hwmon_power_max_read(struct xe_hwmon *hwmon, int channel, long *value)
{ … }
static int xe_hwmon_power_max_write(struct xe_hwmon *hwmon, int channel, long value)
{ … }
static void xe_hwmon_power_rated_max_read(struct xe_hwmon *hwmon, int channel, long *value)
{ … }
static void
xe_hwmon_energy_get(struct xe_hwmon *hwmon, int channel, long *energy)
{ … }
static ssize_t
xe_hwmon_power_max_interval_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
xe_hwmon_power_max_interval_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR(power1_max_interval, 0664,
xe_hwmon_power_max_interval_show,
xe_hwmon_power_max_interval_store, CHANNEL_CARD);
static SENSOR_DEVICE_ATTR(power2_max_interval, 0664,
xe_hwmon_power_max_interval_show,
xe_hwmon_power_max_interval_store, CHANNEL_PKG);
static struct attribute *hwmon_attributes[] = …;
static umode_t xe_hwmon_attributes_visible(struct kobject *kobj,
struct attribute *attr, int index)
{ … }
static const struct attribute_group hwmon_attrgroup = …;
static const struct attribute_group *hwmon_groups[] = …;
static const struct hwmon_channel_info * const hwmon_info[] = …;
static int xe_hwmon_pcode_read_i1(struct xe_gt *gt, u32 *uval)
{ … }
static int xe_hwmon_pcode_write_i1(struct xe_gt *gt, u32 uval)
{ … }
static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel,
long *value, u32 scale_factor)
{ … }
static int xe_hwmon_power_curr_crit_write(struct xe_hwmon *hwmon, int channel,
long value, u32 scale_factor)
{ … }
static void xe_hwmon_get_voltage(struct xe_hwmon *hwmon, int channel, long *value)
{ … }
static umode_t
xe_hwmon_power_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
{ … }
static int
xe_hwmon_power_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val)
{ … }
static int
xe_hwmon_power_write(struct xe_hwmon *hwmon, u32 attr, int channel, long val)
{ … }
static umode_t
xe_hwmon_curr_is_visible(const struct xe_hwmon *hwmon, u32 attr, int channel)
{ … }
static int
xe_hwmon_curr_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val)
{ … }
static int
xe_hwmon_curr_write(struct xe_hwmon *hwmon, u32 attr, int channel, long val)
{ … }
static umode_t
xe_hwmon_in_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
{ … }
static int
xe_hwmon_in_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val)
{ … }
static umode_t
xe_hwmon_energy_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
{ … }
static int
xe_hwmon_energy_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val)
{ … }
static umode_t
xe_hwmon_is_visible(const void *drvdata, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int
xe_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int
xe_hwmon_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long val)
{ … }
static int xe_hwmon_read_label(struct device *dev,
enum hwmon_sensor_types type,
u32 attr, int channel, const char **str)
{ … }
static const struct hwmon_ops hwmon_ops = …;
static const struct hwmon_chip_info hwmon_chip_info = …;
static void
xe_hwmon_get_preregistration_info(struct xe_device *xe)
{ … }
static void xe_hwmon_mutex_destroy(void *arg)
{ … }
void xe_hwmon_register(struct xe_device *xe)
{ … }