#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/bitops.h>
#include <linux/bitfield.h>
#include <linux/log2.h>
#include "pmbus.h"
enum chips { … };
#define ADM1275_MFR_STATUS_IOUT_WARN2 …
#define ADM1293_MFR_STATUS_VAUX_UV_WARN …
#define ADM1293_MFR_STATUS_VAUX_OV_WARN …
#define ADM1275_PEAK_IOUT …
#define ADM1275_PEAK_VIN …
#define ADM1275_PEAK_VOUT …
#define ADM1275_PMON_CONTROL …
#define ADM1275_PMON_CONFIG …
#define ADM1275_CONVERT_EN …
#define ADM1275_VIN_VOUT_SELECT …
#define ADM1275_VRANGE …
#define ADM1075_IRANGE_50 …
#define ADM1075_IRANGE_25 …
#define ADM1075_IRANGE_MASK …
#define ADM1272_IRANGE …
#define ADM1278_TSFILT …
#define ADM1278_TEMP1_EN …
#define ADM1278_VIN_EN …
#define ADM1278_VOUT_EN …
#define ADM1278_PMON_DEFCONFIG …
#define ADM1293_IRANGE_25 …
#define ADM1293_IRANGE_50 …
#define ADM1293_IRANGE_100 …
#define ADM1293_IRANGE_200 …
#define ADM1293_IRANGE_MASK …
#define ADM1293_VIN_SEL_012 …
#define ADM1293_VIN_SEL_074 …
#define ADM1293_VIN_SEL_210 …
#define ADM1293_VIN_SEL_MASK …
#define ADM1293_VAUX_EN …
#define ADM1278_PEAK_TEMP …
#define ADM1275_IOUT_WARN2_LIMIT …
#define ADM1275_DEVICE_CONFIG …
#define ADM1275_IOUT_WARN2_SELECT …
#define ADM1276_PEAK_PIN …
#define ADM1075_READ_VAUX …
#define ADM1075_VAUX_OV_WARN_LIMIT …
#define ADM1075_VAUX_UV_WARN_LIMIT …
#define ADM1293_IOUT_MIN …
#define ADM1293_PIN_MIN …
#define ADM1075_VAUX_STATUS …
#define ADM1075_VAUX_OV_WARN …
#define ADM1075_VAUX_UV_WARN …
#define ADM1275_VI_AVG_SHIFT …
#define ADM1275_VI_AVG_MASK …
#define ADM1275_SAMPLES_AVG_MAX …
#define ADM1278_PWR_AVG_SHIFT …
#define ADM1278_PWR_AVG_MASK …
#define ADM1278_VI_AVG_SHIFT …
#define ADM1278_VI_AVG_MASK …
struct adm1275_data { … };
#define to_adm1275_data(x) …
struct coefficients { … };
static const struct coefficients adm1075_coefficients[] = …;
static const struct coefficients adm1272_coefficients[] = …;
static const struct coefficients adm1275_coefficients[] = …;
static const struct coefficients adm1276_coefficients[] = …;
static const struct coefficients adm1278_coefficients[] = …;
static const struct coefficients adm1293_coefficients[] = …;
static int adm1275_read_samples(const struct adm1275_data *data,
struct i2c_client *client, bool is_power)
{ … }
static int adm1275_write_pmon_config(const struct adm1275_data *data,
struct i2c_client *client, u16 word)
{ … }
static int adm1275_write_samples(const struct adm1275_data *data,
struct i2c_client *client,
bool is_power, u16 word)
{ … }
static int adm1275_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{ … }
static int adm1275_write_word_data(struct i2c_client *client, int page, int reg,
u16 word)
{ … }
static int adm1275_read_byte_data(struct i2c_client *client, int page, int reg)
{ … }
static const struct i2c_device_id adm1275_id[] = …;
MODULE_DEVICE_TABLE(i2c, adm1275_id);
static int adm1275_enable_vout_temp(struct adm1275_data *data,
struct i2c_client *client, int config)
{ … }
static int adm1275_probe(struct i2c_client *client)
{ … }
static struct i2c_driver adm1275_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);