#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/hwmon-sysfs.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/sysfs.h>
#include "common.h"
#define OCC_STAT_MASTER …
#define OCC_EXT_STAT_DVFS_OT …
#define OCC_EXT_STAT_DVFS_POWER …
#define OCC_EXT_STAT_MEM_THROTTLE …
#define OCC_EXT_STAT_QUICK_DROP …
#define OCC_EXT_STAT_DVFS_VDD …
#define OCC_EXT_STAT_GPU_THROTTLE …
static ssize_t occ_active_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t occ_sysfs_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t occ_error_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static SENSOR_DEVICE_ATTR(occ_master, 0444, occ_sysfs_show, NULL, 0);
static SENSOR_DEVICE_ATTR(occ_active, 0644, occ_sysfs_show, occ_active_store,
1);
static SENSOR_DEVICE_ATTR(occ_dvfs_overtemp, 0444, occ_sysfs_show, NULL, 2);
static SENSOR_DEVICE_ATTR(occ_dvfs_power, 0444, occ_sysfs_show, NULL, 3);
static SENSOR_DEVICE_ATTR(occ_mem_throttle, 0444, occ_sysfs_show, NULL, 4);
static SENSOR_DEVICE_ATTR(occ_quick_pwr_drop, 0444, occ_sysfs_show, NULL, 5);
static SENSOR_DEVICE_ATTR(occ_state, 0444, occ_sysfs_show, NULL, 6);
static SENSOR_DEVICE_ATTR(occs_present, 0444, occ_sysfs_show, NULL, 7);
static SENSOR_DEVICE_ATTR(occ_ips_status, 0444, occ_sysfs_show, NULL, 8);
static SENSOR_DEVICE_ATTR(occ_mode, 0444, occ_sysfs_show, NULL, 9);
static SENSOR_DEVICE_ATTR(occ_dvfs_vdd, 0444, occ_sysfs_show, NULL, 10);
static SENSOR_DEVICE_ATTR(occ_gpu_throttle, 0444, occ_sysfs_show, NULL, 11);
static DEVICE_ATTR_RO(occ_error);
static struct attribute *occ_attributes[] = …;
static const struct attribute_group occ_sysfs = …;
void occ_sysfs_poll_done(struct occ *occ)
{ … }
int occ_setup_sysfs(struct occ *occ)
{ … }
void occ_shutdown_sysfs(struct occ *occ)
{ … }