#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/ads7828.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#define ADS7828_CMD_SD_SE …
#define ADS7828_CMD_PD1 …
#define ADS7828_CMD_PD3 …
#define ADS7828_INT_VREF_MV …
#define ADS7828_EXT_VREF_MV_MIN …
#define ADS7828_EXT_VREF_MV_MAX …
enum ads7828_chips { … };
struct ads7828_data { … };
static inline u8 ads7828_cmd_byte(u8 cmd, int ch)
{ … }
static ssize_t ads7828_in_show(struct device *dev,
struct device_attribute *da, char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(in0_input, ads7828_in, 0);
static SENSOR_DEVICE_ATTR_RO(in1_input, ads7828_in, 1);
static SENSOR_DEVICE_ATTR_RO(in2_input, ads7828_in, 2);
static SENSOR_DEVICE_ATTR_RO(in3_input, ads7828_in, 3);
static SENSOR_DEVICE_ATTR_RO(in4_input, ads7828_in, 4);
static SENSOR_DEVICE_ATTR_RO(in5_input, ads7828_in, 5);
static SENSOR_DEVICE_ATTR_RO(in6_input, ads7828_in, 6);
static SENSOR_DEVICE_ATTR_RO(in7_input, ads7828_in, 7);
static struct attribute *ads7828_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct regmap_config ads2828_regmap_config = …;
static const struct regmap_config ads2830_regmap_config = …;
static int ads7828_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ads7828_device_ids[] = …;
MODULE_DEVICE_TABLE(i2c, ads7828_device_ids);
static const struct of_device_id __maybe_unused ads7828_of_match[] = …;
MODULE_DEVICE_TABLE(of, ads7828_of_match);
static struct i2c_driver ads7828_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;