#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.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/delay.h>
#define ADC_STEP_MV …
#define ADC_MAX_LOW_MEASUREMENT_MV …
enum powr1xxx_chips { … };
enum powr1220_regs { … };
enum powr1220_adc_values { … };
struct powr1220_data { … };
static const char * const input_names[] = …;
static int powr1220_read_adc(struct device *dev, int ch_num)
{ … }
static umode_t
powr1220_is_visible(const void *data, enum hwmon_sensor_types type, u32
attr, int channel)
{ … }
static int
powr1220_read_string(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, const char **str)
{ … }
static int
powr1220_read(struct device *dev, enum hwmon_sensor_types type, u32
attr, int channel, long *val)
{ … }
static const struct hwmon_channel_info * const powr1220_info[] = …;
static const struct hwmon_ops powr1220_hwmon_ops = …;
static const struct hwmon_chip_info powr1220_chip_info = …;
static int powr1220_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id powr1220_ids[] = …;
MODULE_DEVICE_TABLE(i2c, powr1220_ids);
static struct i2c_driver powr1220_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;