#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/kstrtox.h>
static int input_mode;
module_param(input_mode, int, 0);
MODULE_PARM_DESC(…) …;
#define PCF8591_CONTROL_AOEF …
#define PCF8591_CONTROL_AIP_MASK …
#define PCF8591_CONTROL_AINC …
#define PCF8591_CONTROL_AICH_MASK …
#define PCF8591_INIT_CONTROL …
#define PCF8591_INIT_AOUT …
#define REG_TO_SIGNED(reg) …
struct pcf8591_data { … };
static void pcf8591_init_client(struct i2c_client *client);
static int pcf8591_read_channel(struct device *dev, int channel);
#define show_in_channel(channel) …
show_in_channel(0);
show_in_channel(1);
show_in_channel(2);
show_in_channel(3);
static ssize_t out0_output_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t out0_output_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(out0_output);
static ssize_t out0_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t out0_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(out0_enable);
static struct attribute *pcf8591_attributes[] = …;
static const struct attribute_group pcf8591_attr_group = …;
static struct attribute *pcf8591_attributes_opt[] = …;
static const struct attribute_group pcf8591_attr_group_opt = …;
static int pcf8591_probe(struct i2c_client *client)
{ … }
static void pcf8591_remove(struct i2c_client *client)
{ … }
static void pcf8591_init_client(struct i2c_client *client)
{ … }
static int pcf8591_read_channel(struct device *dev, int channel)
{ … }
static const struct i2c_device_id pcf8591_id[] = …;
MODULE_DEVICE_TABLE(i2c, pcf8591_id);
static struct i2c_driver pcf8591_driver = …;
static int __init pcf8591_init(void)
{ … }
static void __exit pcf8591_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(pcf8591_exit);