linux/drivers/hwmon/ads7828.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ads7828.c - driver for TI ADS7828 8-channel A/D converter and compatibles
 * (C) 2007 EADS Astrium
 *
 * This driver is based on the lm75 and other lm_sensors/hwmon drivers
 *
 * Written by Steve Hardy <[email protected]>
 *
 * ADS7830 support, by Guillaume Roguez <[email protected]>
 *
 * For further information, see the Documentation/hwmon/ads7828.rst file.
 */

#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/ads7828.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/regulator/consumer.h>

/* The ADS7828 registers */
#define ADS7828_CMD_SD_SE
#define ADS7828_CMD_PD1
#define ADS7828_CMD_PD3
#define ADS7828_INT_VREF_MV
#define ADS7828_EXT_VREF_MV_MIN
#define ADS7828_EXT_VREF_MV_MAX

/* List of supported devices */
enum ads7828_chips {};

/* Client specific data */
struct ads7828_data {};

/* Command byte C2,C1,C0 - see datasheet */
static inline u8 ads7828_cmd_byte(u8 cmd, int ch)
{}

/* sysfs callback function */
static ssize_t ads7828_in_show(struct device *dev,
			       struct device_attribute *da, char *buf)
{}

static SENSOR_DEVICE_ATTR_RO(in0_input, ads7828_in, 0);
static SENSOR_DEVICE_ATTR_RO(in1_input, ads7828_in, 1);
static SENSOR_DEVICE_ATTR_RO(in2_input, ads7828_in, 2);
static SENSOR_DEVICE_ATTR_RO(in3_input, ads7828_in, 3);
static SENSOR_DEVICE_ATTR_RO(in4_input, ads7828_in, 4);
static SENSOR_DEVICE_ATTR_RO(in5_input, ads7828_in, 5);
static SENSOR_DEVICE_ATTR_RO(in6_input, ads7828_in, 6);
static SENSOR_DEVICE_ATTR_RO(in7_input, ads7828_in, 7);

static struct attribute *ads7828_attrs[] =;

ATTRIBUTE_GROUPS();

static const struct regmap_config ads2828_regmap_config =;

static const struct regmap_config ads2830_regmap_config =;

static int ads7828_probe(struct i2c_client *client)
{}

static const struct i2c_device_id ads7828_device_ids[] =;
MODULE_DEVICE_TABLE(i2c, ads7828_device_ids);

static const struct of_device_id __maybe_unused ads7828_of_match[] =;
MODULE_DEVICE_TABLE(of, ads7828_of_match);

static struct i2c_driver ads7828_driver =;

module_i2c_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();