#define pr_fmt(fmt) …
#include <linux/debugfs.h>
#include <linux/kernel.h>
#include <linux/hwmon.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/dmi.h>
#include <linux/jiffies.h>
#include <linux/err.h>
#include <linux/acpi.h>
#define ATK_HID …
static bool new_if;
module_param(new_if, bool, 0);
MODULE_PARM_DESC(…) …;
static const struct dmi_system_id __initconst atk_force_new_if[] = …;
#define CACHE_TIME …
#define BOARD_ID …
#define METHOD_ENUMERATE …
#define METHOD_READ …
#define METHOD_WRITE …
#define METHOD_OLD_READ_TMP …
#define METHOD_OLD_READ_VLT …
#define METHOD_OLD_READ_FAN …
#define METHOD_OLD_ENUM_TMP …
#define METHOD_OLD_ENUM_VLT …
#define METHOD_OLD_ENUM_FAN …
#define ATK_MUX_HWMON …
#define ATK_MUX_MGMT …
#define ATK_CLASS_MASK …
#define ATK_CLASS_FREQ_CTL …
#define ATK_CLASS_FAN_CTL …
#define ATK_CLASS_HWMON …
#define ATK_CLASS_MGMT …
#define ATK_TYPE_MASK …
#define HWMON_TYPE_VOLT …
#define HWMON_TYPE_TEMP …
#define HWMON_TYPE_FAN …
#define ATK_ELEMENT_ID_MASK …
#define ATK_EC_ID …
enum atk_pack_member { … };
#define _HWMON_NEW_PACK_SIZE …
#define _HWMON_NEW_PACK_FLAGS …
#define _HWMON_NEW_PACK_NAME …
#define _HWMON_NEW_PACK_UNK1 …
#define _HWMON_NEW_PACK_UNK2 …
#define _HWMON_NEW_PACK_LIMIT1 …
#define _HWMON_NEW_PACK_LIMIT2 …
#define _HWMON_NEW_PACK_ENABLE …
#define _HWMON_OLD_PACK_SIZE …
#define _HWMON_OLD_PACK_FLAGS …
#define _HWMON_OLD_PACK_NAME …
#define _HWMON_OLD_PACK_LIMIT1 …
#define _HWMON_OLD_PACK_LIMIT2 …
#define _HWMON_OLD_PACK_ENABLE …
struct atk_data { … };
sysfs_show_func;
static const struct acpi_device_id atk_ids[] = …;
MODULE_DEVICE_TABLE(acpi, atk_ids);
#define ATTR_NAME_SIZE …
struct atk_sensor_data { … };
struct atk_acpi_ret_buffer { … };
struct atk_acpi_input_buf { … };
static int atk_add(struct acpi_device *device);
static void atk_remove(struct acpi_device *device);
static void atk_print_sensor(struct atk_data *data, union acpi_object *obj);
static int atk_read_value(struct atk_sensor_data *sensor, u64 *value);
static struct acpi_driver atk_driver = …;
#define input_to_atk_sensor(attr) …
#define label_to_atk_sensor(attr) …
#define limit1_to_atk_sensor(attr) …
#define limit2_to_atk_sensor(attr) …
static ssize_t atk_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t atk_label_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t atk_limit1_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t atk_limit2_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static void atk_init_attribute(struct device_attribute *attr, char *name,
sysfs_show_func show)
{ … }
static union acpi_object *atk_get_pack_member(struct atk_data *data,
union acpi_object *pack,
enum atk_pack_member m)
{ … }
static int validate_hwmon_pack(struct atk_data *data, union acpi_object *obj)
{ … }
#ifdef DEBUG
static char const *atk_sensor_type(union acpi_object *flags)
{ … }
#endif
static void atk_print_sensor(struct atk_data *data, union acpi_object *obj)
{ … }
static int atk_read_value_old(struct atk_sensor_data *sensor, u64 *value)
{ … }
static union acpi_object *atk_ggrp(struct atk_data *data, u16 mux)
{ … }
static union acpi_object *atk_gitm(struct atk_data *data, u64 id)
{ … }
static union acpi_object *atk_sitm(struct atk_data *data,
struct atk_acpi_input_buf *buf)
{ … }
static int atk_read_value_new(struct atk_sensor_data *sensor, u64 *value)
{ … }
static int atk_read_value(struct atk_sensor_data *sensor, u64 *value)
{ … }
#ifdef CONFIG_DEBUG_FS
static int atk_debugfs_gitm_get(void *p, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj)
{ … }
static void atk_pack_print(char *buf, size_t sz, union acpi_object *pack)
{ … }
static int atk_debugfs_ggrp_open(struct inode *inode, struct file *file)
{ … }
static ssize_t atk_debugfs_ggrp_read(struct file *file, char __user *buf,
size_t count, loff_t *pos)
{ … }
static int atk_debugfs_ggrp_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations atk_debugfs_ggrp_fops = …;
static void atk_debugfs_init(struct atk_data *data)
{ … }
static void atk_debugfs_cleanup(struct atk_data *data)
{ … }
#else
static void atk_debugfs_init(struct atk_data *data)
{
}
static void atk_debugfs_cleanup(struct atk_data *data)
{
}
#endif
static int atk_add_sensor(struct atk_data *data, union acpi_object *obj)
{ … }
static int atk_enumerate_old_hwmon(struct atk_data *data)
{ … }
static int atk_ec_present(struct atk_data *data)
{ … }
static int atk_ec_enabled(struct atk_data *data)
{ … }
static int atk_ec_ctl(struct atk_data *data, int enable)
{ … }
static int atk_enumerate_new_hwmon(struct atk_data *data)
{ … }
static int atk_init_attribute_groups(struct atk_data *data)
{ … }
static int atk_register_hwmon(struct atk_data *data)
{ … }
static int atk_probe_if(struct atk_data *data)
{ … }
static int atk_add(struct acpi_device *device)
{ … }
static void atk_remove(struct acpi_device *device)
{ … }
static int __init atk0110_init(void)
{ … }
static void __exit atk0110_exit(void)
{ … }
module_init(…) …;
module_exit(atk0110_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;