linux/drivers/hwmon/pcf8591.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2001-2004 Aurelien Jarno <[email protected]>
 * Ported to Linux 2.6 by Aurelien Jarno <[email protected]> with
 * the help of Jean Delvare <[email protected]>
 */

#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>

/* Insmod parameters */

static int input_mode;
module_param(input_mode, int, 0);
MODULE_PARM_DESC();

/*
 * The PCF8591 control byte
 *      7    6    5    4    3    2    1    0
 *   |  0 |AOEF|   AIP   |  0 |AINC|  AICH   |
 */

/* Analog Output Enable Flag (analog output active if 1) */
#define PCF8591_CONTROL_AOEF

/*
 * Analog Input Programming
 * 0x00 = four single ended inputs
 * 0x10 = three differential inputs
 * 0x20 = single ended and differential mixed
 * 0x30 = two differential inputs
 */
#define PCF8591_CONTROL_AIP_MASK

/* Autoincrement Flag (switch on if 1) */
#define PCF8591_CONTROL_AINC

/*
 * Channel selection
 * 0x00 = channel 0
 * 0x01 = channel 1
 * 0x02 = channel 2
 * 0x03 = channel 3
 */
#define PCF8591_CONTROL_AICH_MASK

/* Initial values */
#define PCF8591_INIT_CONTROL
#define PCF8591_INIT_AOUT

/* Conversions */
#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);

/* following are the sysfs callback functions */
#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 =;

/*
 * Real code
 */

static int pcf8591_probe(struct i2c_client *client)
{}

static void pcf8591_remove(struct i2c_client *client)
{}

/* Called when we have found a new PCF8591. */
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);