#include <linux/module.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/of.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include "lm75.h"
#define DRV_VERSION …
enum chips { … };
#define AD7418_REG_TEMP_IN …
#define AD7418_REG_CONF …
#define AD7418_REG_TEMP_HYST …
#define AD7418_REG_TEMP_OS …
#define AD7418_REG_ADC …
#define AD7418_REG_CONF2 …
#define AD7418_REG_ADC_CH(x) …
#define AD7418_CH_TEMP …
static const u8 AD7418_REG_TEMP[] = …;
struct ad7418_data { … };
static int ad7418_update_device(struct device *dev)
{ … }
static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t adc_show(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t temp_store(struct device *dev,
struct device_attribute *devattr, const char *buf,
size_t count)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
static SENSOR_DEVICE_ATTR_RW(temp1_max_hyst, temp, 1);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, 2);
static SENSOR_DEVICE_ATTR_RO(in1_input, adc, 0);
static SENSOR_DEVICE_ATTR_RO(in2_input, adc, 1);
static SENSOR_DEVICE_ATTR_RO(in3_input, adc, 2);
static SENSOR_DEVICE_ATTR_RO(in4_input, adc, 3);
static struct attribute *ad7416_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct attribute *ad7417_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct attribute *ad7418_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void ad7418_init_client(struct i2c_client *client)
{ … }
static int ad7418_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ad7418_id[] = …;
MODULE_DEVICE_TABLE(i2c, ad7418_id);
static const struct of_device_id ad7418_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, ad7418_dt_ids);
static struct i2c_driver ad7418_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);