#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include "pmbus.h"
enum max31785_regs { … };
#define MAX31785 …
#define MAX31785A …
#define MAX31785B …
#define MFR_FAN_CONFIG_DUAL_TACH …
#define MAX31785_NR_PAGES …
#define MAX31785_NR_FAN_PAGES …
#define MAX31785_WAIT_DELAY_US …
struct max31785_data { … };
#define to_max31785_data(x) …
static inline void max31785_wait(const struct max31785_data *data)
{ … }
static int max31785_i2c_write_byte_data(struct i2c_client *client,
struct max31785_data *driver_data,
int command, u16 data)
{ … }
static int max31785_i2c_read_word_data(struct i2c_client *client,
struct max31785_data *driver_data,
int command)
{ … }
static int _max31785_read_byte_data(struct i2c_client *client,
struct max31785_data *driver_data,
int page, int command)
{ … }
static int _max31785_write_byte_data(struct i2c_client *client,
struct max31785_data *driver_data,
int page, int command, u16 data)
{ … }
static int _max31785_read_word_data(struct i2c_client *client,
struct max31785_data *driver_data,
int page, int phase, int command)
{ … }
static int _max31785_write_word_data(struct i2c_client *client,
struct max31785_data *driver_data,
int page, int command, u16 data)
{ … }
static int max31785_read_byte_data(struct i2c_client *client, int page, int reg)
{ … }
static int max31785_write_byte(struct i2c_client *client, int page, u8 value)
{ … }
static int max31785_read_long_data(struct i2c_client *client, int page,
int reg, u32 *data)
{ … }
static int max31785_get_pwm(struct i2c_client *client, int page)
{ … }
static int max31785_get_pwm_mode(struct i2c_client *client,
struct max31785_data *driver_data, int page)
{ … }
static int max31785_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{ … }
static inline u32 max31785_scale_pwm(u32 sensor_val)
{ … }
static int max31785_update_fan(struct i2c_client *client,
struct max31785_data *driver_data, int page,
u8 config, u8 mask, u16 command)
{ … }
static int max31785_pwm_enable(struct i2c_client *client,
struct max31785_data *driver_data, int page,
u16 word)
{ … }
static int max31785_write_word_data(struct i2c_client *client, int page,
int reg, u16 word)
{ … }
#define MAX31785_FAN_FUNCS …
#define MAX31785_TEMP_FUNCS …
#define MAX31785_VOUT_FUNCS …
static const struct pmbus_driver_info max31785_info = …;
static int max31785_configure_dual_tach(struct i2c_client *client,
struct pmbus_driver_info *info)
{ … }
static int max31785_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id max31785_id[] = …;
MODULE_DEVICE_TABLE(i2c, max31785_id);
static const struct of_device_id max31785_of_match[] = …;
MODULE_DEVICE_TABLE(of, max31785_of_match);
static struct i2c_driver max31785_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);