linux/drivers/hwmon/ltc4245.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for Linear Technology LTC4245 I2C Multiple Supply Hot Swap Controller
 *
 * Copyright (C) 2008 Ira W. Snyder <[email protected]>
 *
 * This driver is based on the ds1621 and ina209 drivers.
 *
 * Datasheet:
 * http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517
 */

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

/* Here are names of the chip's registers (a.k.a. commands) */
enum ltc4245_cmd {};

struct ltc4245_data {};

/*
 * Update the readings from the GPIO pins. If the driver has been configured to
 * sample all GPIO's as analog voltages, a round-robin sampling method is used.
 * Otherwise, only the configured GPIO pin is sampled.
 *
 * LOCKING: must hold data->update_lock
 */
static void ltc4245_update_gpios(struct device *dev)
{}

static struct ltc4245_data *ltc4245_update_device(struct device *dev)
{}

/* Return the voltage from the given register in millivolts */
static int ltc4245_get_voltage(struct device *dev, u8 reg)
{}

/* Return the current in the given sense register in milliAmperes */
static unsigned int ltc4245_get_current(struct device *dev, u8 reg)
{}

/* Map from voltage channel index to voltage register */

static const s8 ltc4245_in_regs[] =;

/* Map from current channel index to current register */

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);

/* This is the driver that will be inserted */
static struct i2c_driver ltc4245_driver =;

module_i2c_driver();

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