#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h>
#define LTC4151_SENSE_H …
#define LTC4151_SENSE_L …
#define LTC4151_VIN_H …
#define LTC4151_VIN_L …
#define LTC4151_ADIN_H …
#define LTC4151_ADIN_L …
struct ltc4151_data { … };
static struct ltc4151_data *ltc4151_update_device(struct device *dev)
{ … }
static int ltc4151_get_value(struct ltc4151_data *data, u8 reg)
{ … }
static ssize_t ltc4151_value_show(struct device *dev,
struct device_attribute *da, char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(in1_input, ltc4151_value, LTC4151_VIN_H);
static SENSOR_DEVICE_ATTR_RO(in2_input, ltc4151_value, LTC4151_ADIN_H);
static SENSOR_DEVICE_ATTR_RO(curr1_input, ltc4151_value, LTC4151_SENSE_H);
static struct attribute *ltc4151_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int ltc4151_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ltc4151_id[] = …;
MODULE_DEVICE_TABLE(i2c, ltc4151_id);
static const struct of_device_id __maybe_unused ltc4151_match[] = …;
MODULE_DEVICE_TABLE(of, ltc4151_match);
static struct i2c_driver ltc4151_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;