#include <linux/bits.h>
#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/pmbus.h>
#include <linux/util_macros.h>
#include "pmbus.h"
enum chips { … };
enum { … };
struct max20730_data { … };
#define to_max20730_data(x) …
#define VOLT_FROM_REG(val) …
#define PMBUS_SMB_ALERT_MASK …
#define MAX20730_MFR_VOUT_MIN …
#define MAX20730_MFR_DEVSET1 …
#define MAX20730_MFR_DEVSET2 …
#define MAX20730_MFR_VOUT_MIN_MASK …
#define MAX20730_MFR_VOUT_MIN_BIT_POS …
#define MAX20730_MFR_DEVSET1_RGAIN_MASK …
#define MAX20730_MFR_DEVSET1_OTP_MASK …
#define MAX20730_MFR_DEVSET1_VBOOT_MASK …
#define MAX20730_MFR_DEVSET1_OCP_MASK …
#define MAX20730_MFR_DEVSET1_FSW_MASK …
#define MAX20730_MFR_DEVSET1_TSTAT_MASK …
#define MAX20730_MFR_DEVSET1_RGAIN_BIT_POS …
#define MAX20730_MFR_DEVSET1_OTP_BIT_POS …
#define MAX20730_MFR_DEVSET1_VBOOT_BIT_POS …
#define MAX20730_MFR_DEVSET1_OCP_BIT_POS …
#define MAX20730_MFR_DEVSET1_FSW_BIT_POS …
#define MAX20730_MFR_DEVSET1_TSTAT_BIT_POS …
#define MAX20730_MFR_DEVSET2_IMAX_MASK …
#define MAX20730_MFR_DEVSET2_VRATE …
#define MAX20730_MFR_DEVSET2_OCPM_MASK …
#define MAX20730_MFR_DEVSET2_SS_MASK …
#define MAX20730_MFR_DEVSET2_IMAX_BIT_POS …
#define MAX20730_MFR_DEVSET2_VRATE_BIT_POS …
#define MAX20730_MFR_DEVSET2_OCPM_BIT_POS …
#define MAX20730_MFR_DEVSET2_SS_BIT_POS …
#define DEBUG_FS_DATA_MAX …
struct max20730_debugfs_data { … };
#define to_psu(x, y) …
#ifdef CONFIG_DEBUG_FS
static ssize_t max20730_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations max20730_fops = …;
static int max20730_init_debugfs(struct i2c_client *client,
struct max20730_data *data)
{ … }
#else
static int max20730_init_debugfs(struct i2c_client *client,
struct max20730_data *data)
{
return 0;
}
#endif
static const struct i2c_device_id max20730_id[];
static u16 val_to_direct(int v, enum pmbus_sensor_classes class,
const struct pmbus_driver_info *info)
{ … }
static long direct_to_val(u16 w, enum pmbus_sensor_classes class,
const struct pmbus_driver_info *info)
{ … }
static u32 max_current[][5] = …;
static int max20730_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{ … }
static int max20730_write_word_data(struct i2c_client *client, int page,
int reg, u16 word)
{ … }
static const struct pmbus_driver_info max20730_info[] = …;
static int max20730_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id max20730_id[] = …;
MODULE_DEVICE_TABLE(i2c, max20730_id);
static const struct of_device_id max20730_of_match[] = …;
MODULE_DEVICE_TABLE(of, max20730_of_match);
static struct i2c_driver max20730_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);