#include <linux/device.h>
#include <linux/export.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/sysfs.h>
#include <linux/unaligned.h>
#include "common.h"
#define EXTN_FLAG_SENSOR_ID …
#define OCC_ERROR_COUNT_THRESHOLD …
#define OCC_STATE_SAFE …
#define OCC_SAFE_TIMEOUT …
#define OCC_UPDATE_FREQUENCY …
#define OCC_TEMP_SENSOR_FAULT …
#define OCC_FRU_TYPE_VRM …
struct temp_sensor_1 { … } __packed;
struct temp_sensor_2 { … } __packed;
struct temp_sensor_10 { … } __packed;
struct freq_sensor_1 { … } __packed;
struct freq_sensor_2 { … } __packed;
struct power_sensor_1 { … } __packed;
struct power_sensor_2 { … } __packed;
struct power_sensor_data { … } __packed;
struct power_sensor_data_and_time { … } __packed;
struct power_sensor_a0 { … } __packed;
struct caps_sensor_2 { … } __packed;
struct caps_sensor_3 { … } __packed;
struct extended_sensor { … } __packed;
static int occ_poll(struct occ *occ)
{ … }
static int occ_set_user_power_cap(struct occ *occ, u16 user_power_cap)
{ … }
int occ_update_response(struct occ *occ)
{ … }
static ssize_t occ_show_temp_1(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_temp_2(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_temp_10(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_freq_1(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_freq_2(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_power_1(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static u64 occ_get_powr_avg(u64 *accum, u32 *samples)
{ … }
static ssize_t occ_show_power_2(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_power_a0(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_caps_1_2(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_show_caps_3(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_store_caps_user(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t occ_show_extended(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
#define ATTR_OCC(_name, _mode, _show, _store) …
#define SENSOR_ATTR_OCC(_name, _mode, _show, _store, _nr, _index) …
#define OCC_INIT_ATTR(_name, _mode, _show, _store, _nr, _index) …
static int occ_setup_sensor_attrs(struct occ *occ)
{ … }
static void occ_parse_poll_response(struct occ *occ)
{ … }
int occ_active(struct occ *occ, bool active)
{ … }
int occ_setup(struct occ *occ)
{ … }
EXPORT_SYMBOL_GPL(…);
void occ_shutdown(struct occ *occ)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;