#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pmbus.h>
#include <linux/hwmon-sysfs.h>
#include "pmbus.h"
#define IPSPS_REG_VENDOR_ID …
#define IPSPS_REG_MODEL …
#define IPSPS_REG_FW_VERSION …
#define IPSPS_REG_PN …
#define IPSPS_REG_SN …
#define IPSPS_REG_HW_VERSION …
#define IPSPS_REG_MODE …
#define MODE_ACTIVE …
#define MODE_STANDBY …
#define MODE_REDUNDANCY …
#define MODE_ACTIVE_STRING …
#define MODE_STANDBY_STRING …
#define MODE_REDUNDANCY_STRING …
enum ipsps_index { … };
static const u8 ipsps_regs[num_regs] = …;
static ssize_t ipsps_string_show(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t ipsps_fw_version_show(struct device *dev,
struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t ipsps_mode_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t ipsps_mode_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static SENSOR_DEVICE_ATTR_RO(vendor, ipsps_string, vendor);
static SENSOR_DEVICE_ATTR_RO(model, ipsps_string, model);
static SENSOR_DEVICE_ATTR_RO(part_number, ipsps_string, part_number);
static SENSOR_DEVICE_ATTR_RO(serial_number, ipsps_string, serial_number);
static SENSOR_DEVICE_ATTR_RO(hw_version, ipsps_string, hw_version);
static SENSOR_DEVICE_ATTR_RO(fw_version, ipsps_fw_version, fw_version);
static SENSOR_DEVICE_ATTR_RW(mode, ipsps_mode, mode);
static struct attribute *ipsps_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct pmbus_driver_info ipsps_info = …;
static struct pmbus_platform_data ipsps_pdata = …;
static int ipsps_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ipsps_id[] = …;
MODULE_DEVICE_TABLE(i2c, ipsps_id);
#ifdef CONFIG_OF
static const struct of_device_id ipsps_of_match[] = …;
MODULE_DEVICE_TABLE(of, ipsps_of_match);
#endif
static struct i2c_driver ipsps_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);