#include <linux/bits.h>
#include <linux/device.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
#define ADM1177_CMD_V_CONT …
#define ADM1177_CMD_I_CONT …
#define ADM1177_CMD_VRANGE …
#define ADM1177_REG_ALERT_TH …
#define ADM1177_BITS …
struct adm1177_state { … };
static int adm1177_read_raw(struct adm1177_state *st, u8 num, u8 *data)
{ … }
static int adm1177_write_cmd(struct adm1177_state *st, u8 cmd)
{ … }
static int adm1177_write_alert_thr(struct adm1177_state *st,
u32 alert_threshold_ua)
{ … }
static int adm1177_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int adm1177_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t adm1177_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_channel_info * const adm1177_info[] = …;
static const struct hwmon_ops adm1177_hwmon_ops = …;
static const struct hwmon_chip_info adm1177_chip_info = …;
static int adm1177_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id adm1177_id[] = …;
MODULE_DEVICE_TABLE(i2c, adm1177_id);
static const struct of_device_id adm1177_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, adm1177_dt_ids);
static struct i2c_driver adm1177_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;