#include <linux/bits.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
static const unsigned short normal_i2c[] = …;
enum chips { … };
#define ADM9240_REG_MAN_ID …
#define ADM9240_REG_DIE_REV …
#define ADM9240_REG_CONFIG …
#define ADM9240_REG_IN(nr) …
#define ADM9240_REG_IN_MAX(nr) …
#define ADM9240_REG_IN_MIN(nr) …
#define ADM9240_REG_FAN(nr) …
#define ADM9240_REG_FAN_MIN(nr) …
#define ADM9240_REG_INT(nr) …
#define ADM9240_REG_INT_MASK(nr) …
#define ADM9240_REG_TEMP …
#define ADM9240_REG_TEMP_MAX(nr) …
#define ADM9240_REG_ANALOG_OUT …
#define ADM9240_REG_CHASSIS_CLEAR …
#define ADM9240_REG_VID_FAN_DIV …
#define ADM9240_REG_I2C_ADDR …
#define ADM9240_REG_VID4 …
#define ADM9240_REG_TEMP_CONF …
static inline int SCALE(long val, int mul, int div)
{ … }
static const u16 nom_mv[] = …;
static inline unsigned int IN_FROM_REG(u8 reg, int n)
{ … }
static inline u8 IN_TO_REG(unsigned long val, int n)
{ … }
static inline s8 TEMP_TO_REG(long val)
{ … }
static inline unsigned int FAN_FROM_REG(u8 reg, u8 div)
{ … }
static inline u8 AOUT_TO_REG(unsigned long val)
{ … }
static inline unsigned int AOUT_FROM_REG(u8 reg)
{ … }
struct adm9240_data { … };
static int adm9240_write_fan_div(struct adm9240_data *data, int channel, u8 fan_div)
{ … }
static int adm9240_fan_min_write(struct adm9240_data *data, int channel, long val)
{ … }
static ssize_t cpu0_vid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(cpu0_vid);
static ssize_t aout_output_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t aout_output_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(aout_output);
static struct attribute *adm9240_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int adm9240_detect(struct i2c_client *new_client,
struct i2c_board_info *info)
{ … }
static int adm9240_init_client(struct adm9240_data *data)
{ … }
static int adm9240_chip_read(struct device *dev, u32 attr, long *val)
{ … }
static int adm9240_intrusion_read(struct device *dev, u32 attr, long *val)
{ … }
static int adm9240_intrusion_write(struct device *dev, u32 attr, long val)
{ … }
static int adm9240_in_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int adm9240_in_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static int adm9240_fan_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int adm9240_fan_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static int adm9240_temp_read(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int adm9240_temp_write(struct device *dev, u32 attr, int channel, long val)
{ … }
static int adm9240_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int adm9240_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long val)
{ … }
static umode_t adm9240_is_visible(const void *_data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_ops adm9240_hwmon_ops = …;
static const struct hwmon_channel_info * const adm9240_info[] = …;
static const struct hwmon_chip_info adm9240_chip_info = …;
static bool adm9240_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config adm9240_regmap_config = …;
static int adm9240_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adm9240_id[] = …;
MODULE_DEVICE_TABLE(i2c, adm9240_id);
static struct i2c_driver adm9240_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;