#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/dmi.h>
#include <linux/fs.h>
#include <linux/watchdog.h>
#include <linux/miscdevice.h>
#include <linux/uaccess.h>
#include <linux/kref.h>
static const unsigned short normal_i2c[] = …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
enum chips { … };
#define FSCHMD_REG_IDENT_0 …
#define FSCHMD_REG_IDENT_1 …
#define FSCHMD_REG_IDENT_2 …
#define FSCHMD_REG_REVISION …
#define FSCHMD_REG_EVENT_STATE …
#define FSCHMD_REG_CONTROL …
#define FSCHMD_CONTROL_ALERT_LED …
static const u8 FSCHMD_REG_WDOG_CONTROL[7] = …;
static const u8 FSCHMD_REG_WDOG_STATE[7] = …;
static const u8 FSCHMD_REG_WDOG_PRESET[7] = …;
#define FSCHMD_WDOG_CONTROL_TRIGGER …
#define FSCHMD_WDOG_CONTROL_STARTED …
#define FSCHMD_WDOG_CONTROL_STOP …
#define FSCHMD_WDOG_CONTROL_RESOLUTION …
#define FSCHMD_WDOG_STATE_CARDRESET …
static const u8 FSCHMD_REG_VOLT[7][6] = …;
static const int FSCHMD_NO_VOLT_SENSORS[7] = …;
static const u8 FSCHMD_REG_FAN_MIN[7][7] = …;
static const u8 FSCHMD_REG_FAN_ACT[7][7] = …;
static const u8 FSCHMD_REG_FAN_STATE[7][7] = …;
static const u8 FSCHMD_REG_FAN_RIPPLE[7][7] = …;
static const int FSCHMD_NO_FAN_SENSORS[7] = …;
#define FSCHMD_FAN_ALARM …
#define FSCHMD_FAN_NOT_PRESENT …
#define FSCHMD_FAN_DISABLED …
static const u8 FSCHMD_REG_TEMP_ACT[7][11] = …;
static const u8 FSCHMD_REG_TEMP_STATE[7][11] = …;
static const u8 FSCHMD_REG_TEMP_LIMIT[7][11] = …;
static const int FSCHMD_NO_TEMP_SENSORS[7] = …;
#define FSCHMD_TEMP_WORKING …
#define FSCHMD_TEMP_ALERT …
#define FSCHMD_TEMP_DISABLED …
#define FSCHMD_TEMP_ALARM_MASK …
static int fschmd_probe(struct i2c_client *client);
static int fschmd_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void fschmd_remove(struct i2c_client *client);
static struct fschmd_data *fschmd_update_device(struct device *dev);
static const struct i2c_device_id fschmd_id[] = …;
MODULE_DEVICE_TABLE(i2c, fschmd_id);
static struct i2c_driver fschmd_driver = …;
struct fschmd_data { … };
static int dmi_mult[6] = …;
static int dmi_offset[6] = …;
static int dmi_vref = …;
static LIST_HEAD(watchdog_data_list);
static DEFINE_MUTEX(watchdog_data_mutex);
static void fschmd_release_resources(struct kref *ref)
{ … }
static ssize_t in_value_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
#define TEMP_FROM_REG(val) …
static ssize_t temp_value_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t temp_fault_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t temp_alarm_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
#define RPM_FROM_REG(val) …
static ssize_t fan_value_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_div_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_div_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t fan_alarm_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t fan_fault_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t pwm_auto_point1_pwm_show(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t pwm_auto_point1_pwm_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t alert_led_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t alert_led_store(struct device *dev,
struct device_attribute *devattr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(alert_led);
static struct sensor_device_attribute fschmd_attr[] = …;
static struct sensor_device_attribute fschmd_temp_attr[] = …;
static struct sensor_device_attribute fschmd_fan_attr[] = …;
static int watchdog_set_timeout(struct fschmd_data *data, int timeout)
{ … }
static int watchdog_get_timeout(struct fschmd_data *data)
{ … }
static int watchdog_trigger(struct fschmd_data *data)
{ … }
static int watchdog_stop(struct fschmd_data *data)
{ … }
static int watchdog_open(struct inode *inode, struct file *filp)
{ … }
static int watchdog_release(struct inode *inode, struct file *filp)
{ … }
static ssize_t watchdog_write(struct file *filp, const char __user *buf,
size_t count, loff_t *offset)
{ … }
static long watchdog_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{ … }
static const struct file_operations watchdog_fops = …;
static void fschmd_dmi_decode(const struct dmi_header *header, void *dummy)
{ … }
static int fschmd_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int fschmd_probe(struct i2c_client *client)
{ … }
static void fschmd_remove(struct i2c_client *client)
{ … }
static struct fschmd_data *fschmd_update_device(struct device *dev)
{ … }
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;