#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#define MAX127_CTRL_START …
#define MAX127_CTRL_SEL_SHIFT …
#define MAX127_CTRL_RNG …
#define MAX127_CTRL_BIP …
#define MAX127_CTRL_PD1 …
#define MAX127_CTRL_PD0 …
#define MAX127_NUM_CHANNELS …
#define MAX127_SET_CHANNEL(ch) …
#define MAX127_FULL_RANGE …
#define MAX127_HALF_RANGE …
#define MAX127_DATA_LEN …
#define MAX127_DATA_SHIFT …
#define MAX127_SIGN_BIT …
struct max127_data { … };
static int max127_select_channel(struct i2c_client *client, u8 ctrl_byte)
{ … }
static int max127_read_channel(struct i2c_client *client, long *val)
{ … }
static long max127_process_raw(u8 ctrl_byte, long raw)
{ … }
static int max127_read_input(struct max127_data *data, int channel, long *val)
{ … }
static int max127_read_min(struct max127_data *data, int channel, long *val)
{ … }
static int max127_read_max(struct max127_data *data, int channel, long *val)
{ … }
static int max127_write_min(struct max127_data *data, int channel, long val)
{ … }
static int max127_write_max(struct max127_data *data, int channel, long val)
{ … }
static umode_t max127_is_visible(const void *_data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int max127_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int max127_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static const struct hwmon_ops max127_hwmon_ops = …;
static const struct hwmon_channel_info * const max127_info[] = …;
static const struct hwmon_chip_info max127_chip_info = …;
static int max127_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id max127_id[] = …;
MODULE_DEVICE_TABLE(i2c, max127_id);
static struct i2c_driver max127_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;