#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include "lm75.h"
static const unsigned short normal_i2c[] = …;
static unsigned short force_subclients[4];
module_param_array(…);
MODULE_PARM_DESC(…) …;
#define ASB100_REG_IN(nr) …
#define ASB100_REG_IN_MAX(nr) …
#define ASB100_REG_IN_MIN(nr) …
#define ASB100_REG_FAN(nr) …
#define ASB100_REG_FAN_MIN(nr) …
static const u16 asb100_reg_temp[] = …;
static const u16 asb100_reg_temp_max[] = …;
static const u16 asb100_reg_temp_hyst[] = …;
#define ASB100_REG_TEMP(nr) …
#define ASB100_REG_TEMP_MAX(nr) …
#define ASB100_REG_TEMP_HYST(nr) …
#define ASB100_REG_TEMP2_CONFIG …
#define ASB100_REG_TEMP3_CONFIG …
#define ASB100_REG_CONFIG …
#define ASB100_REG_ALARM1 …
#define ASB100_REG_ALARM2 …
#define ASB100_REG_SMIM1 …
#define ASB100_REG_SMIM2 …
#define ASB100_REG_VID_FANDIV …
#define ASB100_REG_I2C_ADDR …
#define ASB100_REG_CHIPID …
#define ASB100_REG_I2C_SUBADDR …
#define ASB100_REG_PIN …
#define ASB100_REG_IRQ …
#define ASB100_REG_BANK …
#define ASB100_REG_CHIPMAN …
#define ASB100_REG_WCHIPID …
#define ASB100_REG_PWM1 …
#define ASB100_IN_MIN …
#define ASB100_IN_MAX …
static u8 IN_TO_REG(unsigned val)
{ … }
static unsigned IN_FROM_REG(u8 reg)
{ … }
static u8 FAN_TO_REG(long rpm, int div)
{ … }
static int FAN_FROM_REG(u8 val, int div)
{ … }
#define ASB100_TEMP_MIN …
#define ASB100_TEMP_MAX …
static u8 TEMP_TO_REG(long temp)
{ … }
static int TEMP_FROM_REG(u8 reg)
{ … }
static u8 ASB100_PWM_TO_REG(int pwm)
{ … }
static int ASB100_PWM_FROM_REG(u8 reg)
{ … }
#define DIV_FROM_REG(val) …
static u8 DIV_TO_REG(long val)
{ … }
struct asb100_data { … };
static int asb100_read_value(struct i2c_client *client, u16 reg);
static void asb100_write_value(struct i2c_client *client, u16 reg, u16 val);
static int asb100_probe(struct i2c_client *client);
static int asb100_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void asb100_remove(struct i2c_client *client);
static struct asb100_data *asb100_update_device(struct device *dev);
static void asb100_init_client(struct i2c_client *client);
static const struct i2c_device_id asb100_id[] = …;
MODULE_DEVICE_TABLE(i2c, asb100_id);
static struct i2c_driver asb100_driver = …;
#define show_in_reg(reg) …
show_in_reg(…) …
show_in_reg(…) …
show_in_reg(…) …
#define set_in_reg(REG, reg) …
set_in_reg(…)
set_in_reg(…)
#define sysfs_in(offset) …
sysfs_in(…) …;
sysfs_in(…) …;
sysfs_in(…) …;
sysfs_in(…) …;
sysfs_in(…) …;
sysfs_in(…) …;
sysfs_in(…) …;
static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
#define sysfs_fan(offset) …
sysfs_fan(…);
sysfs_fan(…);
sysfs_fan(…);
static int sprintf_temp_from_reg(u16 reg, char *buf, int nr)
{ … }
#define show_temp_reg(reg) …
show_temp_reg(temp);
show_temp_reg(temp_max);
show_temp_reg(temp_hyst);
#define set_temp_reg(REG, reg) …
set_temp_reg(MAX, temp_max);
set_temp_reg(HYST, temp_hyst);
#define sysfs_temp(num) …
sysfs_temp(…);
sysfs_temp(…);
sysfs_temp(…);
sysfs_temp(…);
static ssize_t cpu0_vid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(cpu0_vid);
static ssize_t vrm_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t vrm_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(vrm);
static ssize_t alarms_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(alarms);
static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 8);
static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6);
static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7);
static SENSOR_DEVICE_ATTR(fan3_alarm, S_IRUGO, show_alarm, NULL, 11);
static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 4);
static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 5);
static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 13);
static ssize_t pwm1_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t pwm1_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t pwm1_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t pwm1_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(pwm1);
static DEVICE_ATTR_RW(pwm1_enable);
static struct attribute *asb100_attributes[] = …;
static const struct attribute_group asb100_group = …;
static int asb100_detect_subclients(struct i2c_client *client)
{ … }
static int asb100_detect(struct i2c_client *client,
struct i2c_board_info *info)
{ … }
static int asb100_probe(struct i2c_client *client)
{ … }
static void asb100_remove(struct i2c_client *client)
{ … }
static int asb100_read_value(struct i2c_client *client, u16 reg)
{ … }
static void asb100_write_value(struct i2c_client *client, u16 reg, u16 value)
{ … }
static void asb100_init_client(struct i2c_client *client)
{ … }
static struct asb100_data *asb100_update_device(struct device *dev)
{ … }
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;