linux/drivers/hwmon/mcp3021.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * mcp3021.c - driver for Microchip MCP3021 and MCP3221
 *
 * Copyright (C) 2008-2009, 2012 Freescale Semiconductor, Inc.
 * Author: Mingkai Hu <[email protected]>
 * Reworked by Sven Schuchmann <[email protected]>
 * DT support added by Clemens Gruber <[email protected]>
 *
 * This driver exports the value of analog input voltage to sysfs, the
 * voltage unit is mV. Through the sysfs interface, lm-sensors tool
 * can also display the input voltage.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/hwmon.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/device.h>
#include <linux/of.h>

/* Vdd / reference voltage in millivolt */
#define MCP3021_VDD_REF_MAX
#define MCP3021_VDD_REF_MIN
#define MCP3021_VDD_REF_DEFAULT

/* output format */
#define MCP3021_SAR_SHIFT
#define MCP3021_SAR_MASK
#define MCP3021_OUTPUT_RES

#define MCP3221_SAR_SHIFT
#define MCP3221_SAR_MASK
#define MCP3221_OUTPUT_RES

enum chips {};

/*
 * Client data (each client gets its own)
 */
struct mcp3021_data {};

static inline u16 volts_from_reg(struct mcp3021_data *data, u16 val)
{}

static int mcp3021_read(struct device *dev, enum hwmon_sensor_types type,
			u32 attr, int channel, long *val)
{}

static umode_t mcp3021_is_visible(const void *_data,
				  enum hwmon_sensor_types type,
				  u32 attr, int channel)
{}

static const struct hwmon_channel_info * const mcp3021_info[] =;

static const struct hwmon_ops mcp3021_hwmon_ops =;

static const struct hwmon_chip_info mcp3021_chip_info =;

static int mcp3021_probe(struct i2c_client *client)
{}

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

#ifdef CONFIG_OF
static const struct of_device_id of_mcp3021_match[] =;
MODULE_DEVICE_TABLE(of, of_mcp3021_match);
#endif

static struct i2c_driver mcp3021_driver =;

module_i2c_driver();

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