#ifdef CONFIG_ACPI
#include <linux/acpi.h>
#endif
#include <linux/power_supply.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include "nouveau_drv.h"
#include "nouveau_hwmon.h"
#include <nvkm/subdev/iccsense.h>
#include <nvkm/subdev/volt.h>
#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
static ssize_t
nouveau_hwmon_show_temp1_auto_point1_pwm(struct device *d,
struct device_attribute *a, char *buf)
{ … }
static SENSOR_DEVICE_ATTR(temp1_auto_point1_pwm, 0444,
nouveau_hwmon_show_temp1_auto_point1_pwm, NULL, 0);
static ssize_t
nouveau_hwmon_temp1_auto_point1_temp(struct device *d,
struct device_attribute *a, char *buf)
{ … }
static ssize_t
nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d,
struct device_attribute *a,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR(temp1_auto_point1_temp, 0644,
nouveau_hwmon_temp1_auto_point1_temp,
nouveau_hwmon_set_temp1_auto_point1_temp, 0);
static ssize_t
nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d,
struct device_attribute *a, char *buf)
{ … }
static ssize_t
nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d,
struct device_attribute *a,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR(temp1_auto_point1_temp_hyst, 0644,
nouveau_hwmon_temp1_auto_point1_temp_hyst,
nouveau_hwmon_set_temp1_auto_point1_temp_hyst, 0);
static ssize_t
nouveau_hwmon_get_pwm1_max(struct device *d,
struct device_attribute *a, char *buf)
{ … }
static ssize_t
nouveau_hwmon_get_pwm1_min(struct device *d,
struct device_attribute *a, char *buf)
{ … }
static ssize_t
nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR(pwm1_min, 0644,
nouveau_hwmon_get_pwm1_min,
nouveau_hwmon_set_pwm1_min, 0);
static ssize_t
nouveau_hwmon_set_pwm1_max(struct device *d, struct device_attribute *a,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR(pwm1_max, 0644,
nouveau_hwmon_get_pwm1_max,
nouveau_hwmon_set_pwm1_max, 0);
static struct attribute *pwm_fan_sensor_attrs[] = …;
static const struct attribute_group pwm_fan_sensor_group = …;
static struct attribute *temp1_auto_point_sensor_attrs[] = …;
static const struct attribute_group temp1_auto_point_sensor_group = …;
#define N_ATTR_GROUPS …
static const struct hwmon_channel_info * const nouveau_info[] = …;
static umode_t
nouveau_chip_is_visible(const void *data, u32 attr, int channel)
{ … }
static umode_t
nouveau_power_is_visible(const void *data, u32 attr, int channel)
{ … }
static umode_t
nouveau_temp_is_visible(const void *data, u32 attr, int channel)
{ … }
static umode_t
nouveau_pwm_is_visible(const void *data, u32 attr, int channel)
{ … }
static umode_t
nouveau_input_is_visible(const void *data, u32 attr, int channel)
{ … }
static umode_t
nouveau_fan_is_visible(const void *data, u32 attr, int channel)
{ … }
static int
nouveau_chip_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_fan_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_in_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_pwm_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_power_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int
nouveau_temp_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static int
nouveau_pwm_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static umode_t
nouveau_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr,
int channel)
{ … }
static const char input_label[] = …;
static int
nouveau_read_string(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, const char **buf)
{ … }
static int
nouveau_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int
nouveau_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long val)
{ … }
static const struct hwmon_ops nouveau_hwmon_ops = …;
static const struct hwmon_chip_info nouveau_chip_info = …;
#endif
int
nouveau_hwmon_init(struct drm_device *dev)
{ … }
void
nouveau_hwmon_fini(struct drm_device *dev)
{ … }