#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/dmi.h>
#include <linux/io.h>
#define ABIT_UGURU_ALARM_BANK …
#define ABIT_UGURU_SENSOR_BANK1 …
#define ABIT_UGURU_FAN_PWM …
#define ABIT_UGURU_SENSOR_BANK2 …
#define ABIT_UGURU_MAX_BANK1_SENSORS …
#define ABIT_UGURU_MAX_BANK2_SENSORS …
#define ABIT_UGURU_MAX_PWMS …
#define ABIT_UGURU_TEMP_HIGH_ALARM_ENABLE …
#define ABIT_UGURU_VOLT_HIGH_ALARM_ENABLE …
#define ABIT_UGURU_VOLT_LOW_ALARM_ENABLE …
#define ABIT_UGURU_TEMP_HIGH_ALARM_FLAG …
#define ABIT_UGURU_VOLT_HIGH_ALARM_FLAG …
#define ABIT_UGURU_VOLT_LOW_ALARM_FLAG …
#define ABIT_UGURU_FAN_LOW_ALARM_ENABLE …
#define ABIT_UGURU_BEEP_ENABLE …
#define ABIT_UGURU_SHUTDOWN_ENABLE …
#define ABIT_UGURU_FAN_PWM_ENABLE …
#define ABIT_UGURU_FAN_MAX …
#define ABIT_UGURU_IN_SENSOR …
#define ABIT_UGURU_TEMP_SENSOR …
#define ABIT_UGURU_NC …
#define ABIT_UGURU_WAIT_TIMEOUT …
#define ABIT_UGURU_WAIT_TIMEOUT_SLEEP …
#define ABIT_UGURU_READY_TIMEOUT …
#define ABIT_UGURU_MAX_RETRIES …
#define ABIT_UGURU_RETRY_DELAY …
#define ABIT_UGURU_MAX_TIMEOUTS …
#define ABIT_UGURU_NAME …
#define ABIT_UGURU_DEBUG(level, format, arg...) …
#define ABITUGURU_IN_NAMES_LENGTH …
#define ABITUGURU_TEMP_NAMES_LENGTH …
#define ABITUGURU_FAN_NAMES_LENGTH …
#define ABITUGURU_PWM_NAMES_LENGTH …
#define ABITUGURU_SYSFS_NAMES_LENGTH …
#define ABIT_UGURU_BASE …
#define ABIT_UGURU_CMD …
#define ABIT_UGURU_DATA …
#define ABIT_UGURU_REGION_LENGTH …
#define ABIT_UGURU_STATUS_WRITE …
#define ABIT_UGURU_STATUS_READ …
#define ABIT_UGURU_STATUS_INPUT …
#define ABIT_UGURU_STATUS_READY …
static const int abituguru_bank1_max_value[2] = …;
static const u8 abituguru_bank2_min_threshold = …;
static const u8 abituguru_bank2_max_threshold = …;
static const int abituguru_pwm_settings_multiplier[5] = …;
static const u8 abituguru_pwm_min[5] = …;
static const u8 abituguru_pwm_max[5] = …;
static bool force;
module_param(force, bool, 0);
MODULE_PARM_DESC(…) …;
static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int fan_sensors;
module_param(fan_sensors, int, 0);
MODULE_PARM_DESC(…) …;
static int pwms;
module_param(pwms, int, 0);
MODULE_PARM_DESC(…) …;
static int verbose = …;
module_param(verbose, int, 0644);
MODULE_PARM_DESC(…) …;
struct abituguru_data { … };
static const char *never_happen = …;
static const char *report_this = …;
static int abituguru_wait(struct abituguru_data *data, u8 state)
{ … }
static int abituguru_ready(struct abituguru_data *data)
{ … }
static int abituguru_send_address(struct abituguru_data *data,
u8 bank_addr, u8 sensor_addr, int retries)
{ … }
static int abituguru_read(struct abituguru_data *data,
u8 bank_addr, u8 sensor_addr, u8 *buf, int count, int retries)
{ … }
static int abituguru_write(struct abituguru_data *data,
u8 bank_addr, u8 sensor_addr, u8 *buf, int count)
{ … }
static int
abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
u8 sensor_addr)
{ … }
static void
abituguru_detect_no_bank2_sensors(struct abituguru_data *data)
{ … }
static void
abituguru_detect_no_pwms(struct abituguru_data *data)
{ … }
static struct abituguru_data *abituguru_update_device(struct device *dev);
static ssize_t show_bank1_value(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank1_setting(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank2_value(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank2_setting(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_bank1_setting(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t store_bank2_setting(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_bank1_alarm(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank2_alarm(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank1_mask(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t show_bank2_mask(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_bank1_mask(struct device *dev,
struct device_attribute *devattr, const char *buf, size_t count)
{ … }
static ssize_t store_bank2_mask(struct device *dev,
struct device_attribute *devattr, const char *buf, size_t count)
{ … }
static ssize_t show_pwm_setting(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm_setting(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_pwm_sensor(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm_sensor(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_pwm_enable(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t store_pwm_enable(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{ … }
static ssize_t show_name(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static const
struct sensor_device_attribute_2 abituguru_sysfs_bank1_templ[2][9] = …;
static const struct sensor_device_attribute_2 abituguru_sysfs_fan_templ[6] = …;
static const struct sensor_device_attribute_2 abituguru_sysfs_pwm_templ[6] = …;
static struct sensor_device_attribute_2 abituguru_sysfs_attr[] = …;
static int abituguru_probe(struct platform_device *pdev)
{ … }
static void abituguru_remove(struct platform_device *pdev)
{ … }
static struct abituguru_data *abituguru_update_device(struct device *dev)
{ … }
static int abituguru_suspend(struct device *dev)
{ … }
static int abituguru_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume);
static struct platform_driver abituguru_driver = …;
static int __init abituguru_detect(void)
{ … }
static struct platform_device *abituguru_pdev;
static int __init abituguru_init(void)
{ … }
static void __exit abituguru_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(abituguru_exit);