linux/drivers/hwmon/ltc2992.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
 * LTC2992 - Dual Wide Range Power Monitor
 *
 * Copyright 2020 Analog Devices Inc.
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>

#define LTC2992_CTRLB
#define LTC2992_FAULT1
#define LTC2992_POWER1
#define LTC2992_POWER1_MAX
#define LTC2992_POWER1_MIN
#define LTC2992_POWER1_MAX_THRESH
#define LTC2992_POWER1_MIN_THRESH
#define LTC2992_DSENSE1
#define LTC2992_DSENSE1_MAX
#define LTC2992_DSENSE1_MIN
#define LTC2992_DSENSE1_MAX_THRESH
#define LTC2992_DSENSE1_MIN_THRESH
#define LTC2992_SENSE1
#define LTC2992_SENSE1_MAX
#define LTC2992_SENSE1_MIN
#define LTC2992_SENSE1_MAX_THRESH
#define LTC2992_SENSE1_MIN_THRESH
#define LTC2992_G1
#define LTC2992_G1_MAX
#define LTC2992_G1_MIN
#define LTC2992_G1_MAX_THRESH
#define LTC2992_G1_MIN_THRESH
#define LTC2992_FAULT2
#define LTC2992_G2
#define LTC2992_G2_MAX
#define LTC2992_G2_MIN
#define LTC2992_G2_MAX_THRESH
#define LTC2992_G2_MIN_THRESH
#define LTC2992_G3
#define LTC2992_G3_MAX
#define LTC2992_G3_MIN
#define LTC2992_G3_MAX_THRESH
#define LTC2992_G3_MIN_THRESH
#define LTC2992_G4
#define LTC2992_G4_MAX
#define LTC2992_G4_MIN
#define LTC2992_G4_MAX_THRESH
#define LTC2992_G4_MIN_THRESH
#define LTC2992_FAULT3
#define LTC2992_GPIO_STATUS
#define LTC2992_GPIO_IO_CTRL
#define LTC2992_GPIO_CTRL

#define LTC2992_POWER(x)
#define LTC2992_POWER_MAX(x)
#define LTC2992_POWER_MIN(x)
#define LTC2992_POWER_MAX_THRESH(x)
#define LTC2992_POWER_MIN_THRESH(x)
#define LTC2992_DSENSE(x)
#define LTC2992_DSENSE_MAX(x)
#define LTC2992_DSENSE_MIN(x)
#define LTC2992_DSENSE_MAX_THRESH(x)
#define LTC2992_DSENSE_MIN_THRESH(x)
#define LTC2992_SENSE(x)
#define LTC2992_SENSE_MAX(x)
#define LTC2992_SENSE_MIN(x)
#define LTC2992_SENSE_MAX_THRESH(x)
#define LTC2992_SENSE_MIN_THRESH(x)
#define LTC2992_POWER_FAULT(x)
#define LTC2992_SENSE_FAULT(x)
#define LTC2992_DSENSE_FAULT(x)

/* CTRLB register bitfields */
#define LTC2992_RESET_HISTORY

/* FAULT1 FAULT2 registers common bitfields */
#define LTC2992_POWER_FAULT_MSK(x)
#define LTC2992_DSENSE_FAULT_MSK(x)
#define LTC2992_SENSE_FAULT_MSK(x)

/* FAULT1 bitfields */
#define LTC2992_GPIO1_FAULT_MSK(x)

/* FAULT2 bitfields */
#define LTC2992_GPIO2_FAULT_MSK(x)

/* FAULT3 bitfields */
#define LTC2992_GPIO3_FAULT_MSK(x)
#define LTC2992_GPIO4_FAULT_MSK(x)

#define LTC2992_IADC_NANOV_LSB
#define LTC2992_VADC_UV_LSB
#define LTC2992_VADC_GPIO_UV_LSB

#define LTC2992_GPIO_NR
#define LTC2992_GPIO1_BIT
#define LTC2992_GPIO2_BIT
#define LTC2992_GPIO3_BIT
#define LTC2992_GPIO4_BIT
#define LTC2992_GPIO_BIT(x)

struct ltc2992_state {};

struct ltc2992_gpio_regs {};

static const struct ltc2992_gpio_regs ltc2992_gpio_addr_map[] =;

static const char *ltc2992_gpio_names[LTC2992_GPIO_NR] =;

static int ltc2992_read_reg(struct ltc2992_state *st, u8 addr, const u8 reg_len)
{}

static int ltc2992_write_reg(struct ltc2992_state *st, u8 addr, const u8 reg_len, u32 val)
{}

static int ltc2992_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

static int ltc2992_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
				     unsigned long *bits)
{}

static void ltc2992_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{}

static void ltc2992_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
				      unsigned long *bits)
{}

static int ltc2992_config_gpio(struct ltc2992_state *st)
{}

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

static int ltc2992_get_voltage(struct ltc2992_state *st, u32 reg, u32 scale, long *val)
{}

static int ltc2992_set_voltage(struct ltc2992_state *st, u32 reg, u32 scale, long val)
{}

static int ltc2992_read_gpio_alarm(struct ltc2992_state *st, int nr_gpio, u32 attr, long *val)
{}

static int ltc2992_read_gpios_in(struct device *dev, u32 attr, int nr_gpio, long *val)
{}

static int ltc2992_read_in_alarm(struct ltc2992_state *st, int channel, long *val, u32 attr)
{}

static int ltc2992_read_in(struct device *dev, u32 attr, int channel, long *val)
{}

static int ltc2992_get_current(struct ltc2992_state *st, u32 reg, u32 channel, long *val)
{}

static int ltc2992_set_current(struct ltc2992_state *st, u32 reg, u32 channel, long val)
{}

static int ltc2992_read_curr_alarm(struct ltc2992_state *st, int channel, long *val, u32 attr)
{}

static int ltc2992_read_curr(struct device *dev, u32 attr, int channel, long *val)
{}

static int ltc2992_get_power(struct ltc2992_state *st, u32 reg, u32 channel, long *val)
{}

static int ltc2992_set_power(struct ltc2992_state *st, u32 reg, u32 channel, long val)
{}

static int ltc2992_read_power_alarm(struct ltc2992_state *st, int channel, long *val, u32 attr)
{}

static int ltc2992_read_power(struct device *dev, u32 attr, int channel, long *val)
{}

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

static int ltc2992_write_curr(struct device *dev, u32 attr, int channel, long val)
{}

static int ltc2992_write_gpios_in(struct device *dev, u32 attr, int nr_gpio, long val)
{}

static int ltc2992_write_in(struct device *dev, u32 attr, int channel, long val)
{}

static int ltc2992_write_power(struct device *dev, u32 attr, int channel, long val)
{}

static int ltc2992_write_chip(struct device *dev, u32 attr, int channel, long val)
{}

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

static const struct hwmon_ops ltc2992_hwmon_ops =;

static const struct hwmon_channel_info * const ltc2992_info[] =;

static const struct hwmon_chip_info ltc2992_chip_info =;

static const struct regmap_config ltc2992_regmap_config =;

static int ltc2992_parse_dt(struct ltc2992_state *st)
{}

static int ltc2992_i2c_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver ltc2992_i2c_driver =;

module_i2c_driver();

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