#define pr_fmt(fmt) …
#include <linux/sysfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/jiffies.h>
#include "thermal_core.h"
static ssize_t
type_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
temp_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
mode_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
mode_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
trip_point_type_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
trip_point_temp_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
trip_point_temp_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
trip_point_hyst_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
policy_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
policy_show(struct device *dev, struct device_attribute *devattr, char *buf)
{ … }
static ssize_t
available_policies_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
#if (IS_ENABLED(CONFIG_THERMAL_EMULATION))
static ssize_t
emul_temp_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(emul_temp);
#endif
static ssize_t
sustainable_power_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t
sustainable_power_store(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
#define create_s32_tzp_attr …
create_s32_tzp_attr;
create_s32_tzp_attr;
create_s32_tzp_attr;
create_s32_tzp_attr;
create_s32_tzp_attr;
create_s32_tzp_attr;
create_s32_tzp_attr;
#undef create_s32_tzp_attr
static DEVICE_ATTR_RO(type);
static DEVICE_ATTR_RO(temp);
static DEVICE_ATTR_RW(policy);
static DEVICE_ATTR_RO(available_policies);
static DEVICE_ATTR_RW(sustainable_power);
static DEVICE_ATTR_RW(mode);
static struct attribute *thermal_zone_dev_attrs[] = …;
static const struct attribute_group thermal_zone_attribute_group = …;
static struct attribute *thermal_zone_mode_attrs[] = …;
static const struct attribute_group thermal_zone_mode_attribute_group = …;
static const struct attribute_group *thermal_zone_attribute_groups[] = …;
static int create_trip_attrs(struct thermal_zone_device *tz)
{ … }
static void destroy_trip_attrs(struct thermal_zone_device *tz)
{ … }
int thermal_zone_create_device_groups(struct thermal_zone_device *tz)
{ … }
void thermal_zone_destroy_device_groups(struct thermal_zone_device *tz)
{ … }
static ssize_t
cdev_type_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t max_state_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t cur_state_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
cur_state_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static struct device_attribute
dev_attr_cdev_type = …;
static DEVICE_ATTR_RO(max_state);
static DEVICE_ATTR_RW(cur_state);
static struct attribute *cooling_device_attrs[] = …;
static const struct attribute_group cooling_device_attr_group = …;
static const struct attribute_group *cooling_device_attr_groups[] = …;
#ifdef CONFIG_THERMAL_STATISTICS
struct cooling_dev_stats { … };
static void update_time_in_state(struct cooling_dev_stats *stats)
{ … }
void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev,
unsigned long new_state)
{ … }
static ssize_t total_trans_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t
time_in_state_ms_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
reset_store(struct device *dev, struct device_attribute *attr, const char *buf,
size_t count)
{ … }
static ssize_t trans_table_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(total_trans);
static DEVICE_ATTR_RO(time_in_state_ms);
static DEVICE_ATTR_WO(reset);
static DEVICE_ATTR_RO(trans_table);
static struct attribute *cooling_device_stats_attrs[] = …;
static const struct attribute_group cooling_device_stats_attr_group = …;
static void cooling_device_stats_setup(struct thermal_cooling_device *cdev)
{ … }
static void cooling_device_stats_destroy(struct thermal_cooling_device *cdev)
{ … }
#else
static inline void
cooling_device_stats_setup(struct thermal_cooling_device *cdev) {}
static inline void
cooling_device_stats_destroy(struct thermal_cooling_device *cdev) {}
#endif
void thermal_cooling_device_setup_sysfs(struct thermal_cooling_device *cdev)
{ … }
void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev)
{ … }
void thermal_cooling_device_stats_reinit(struct thermal_cooling_device *cdev)
{ … }
ssize_t
trip_point_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
ssize_t
weight_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
ssize_t weight_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }