#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h>
#include <linux/platform_data/ltc4245.h>
enum ltc4245_cmd { … };
struct ltc4245_data { … };
static void ltc4245_update_gpios(struct device *dev)
{ … }
static struct ltc4245_data *ltc4245_update_device(struct device *dev)
{ … }
static int ltc4245_get_voltage(struct device *dev, u8 reg)
{ … }
static unsigned int ltc4245_get_current(struct device *dev, u8 reg)
{ … }
static const s8 ltc4245_in_regs[] = …;
static const s8 ltc4245_curr_regs[] = …;
static int ltc4245_read_curr(struct device *dev, u32 attr, int channel,
long *val)
{ … }
static int ltc4245_read_in(struct device *dev, u32 attr, int channel, long *val)
{ … }
static int ltc4245_read_power(struct device *dev, u32 attr, int channel,
long *val)
{ … }
static int ltc4245_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static umode_t ltc4245_is_visible(const void *_data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_channel_info * const ltc4245_info[] = …;
static const struct hwmon_ops ltc4245_hwmon_ops = …;
static const struct hwmon_chip_info ltc4245_chip_info = …;
static bool ltc4245_use_extra_gpios(struct i2c_client *client)
{ … }
static int ltc4245_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ltc4245_id[] = …;
MODULE_DEVICE_TABLE(i2c, ltc4245_id);
static struct i2c_driver ltc4245_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;