linux/drivers/hwmon/pmbus/ltc2978.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Hardware monitoring driver for LTC2978 and compatible chips.
 *
 * Copyright (c) 2011 Ericsson AB.
 * Copyright (c) 2013, 2014, 2015 Guenter Roeck
 * Copyright (c) 2015 Linear Technology
 * Copyright (c) 2018 Analog Devices Inc.
 */

#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/regulator/driver.h>
#include "pmbus.h"

enum chips {};

/* Common for all chips */
#define LTC2978_MFR_VOUT_PEAK
#define LTC2978_MFR_VIN_PEAK
#define LTC2978_MFR_TEMPERATURE_PEAK
#define LTC2978_MFR_SPECIAL_ID
#define LTC2978_MFR_COMMON

/* LTC2974, LTC2975, LCT2977, LTC2980, LTC2978, and LTM2987 */
#define LTC2978_MFR_VOUT_MIN
#define LTC2978_MFR_VIN_MIN
#define LTC2978_MFR_TEMPERATURE_MIN

/* LTC2974, LTC2975 */
#define LTC2974_MFR_IOUT_PEAK
#define LTC2974_MFR_IOUT_MIN

/* LTC3880, LTC3882, LTC3883, LTC3887, LTM4675, LTM4676, LTC7132 */
#define LTC3880_MFR_IOUT_PEAK
#define LTC3880_MFR_CLEAR_PEAKS
#define LTC3880_MFR_TEMPERATURE2_PEAK

/* LTC3883, LTC3884, LTC3886, LTC3889, LTC7132, LTC7880 */
#define LTC3883_MFR_IIN_PEAK

/* LTC2975 only */
#define LTC2975_MFR_IIN_PEAK
#define LTC2975_MFR_IIN_MIN
#define LTC2975_MFR_PIN_PEAK
#define LTC2975_MFR_PIN_MIN

#define LTC2978_ID_MASK

#define LTC2972_ID
#define LTC2974_ID
#define LTC2975_ID
#define LTC2977_ID
#define LTC2978_ID_REV1
#define LTC2978_ID_REV2
#define LTC2979_ID_A
#define LTC2979_ID_B
#define LTC2980_ID_A
#define LTC2980_ID_B
#define LTC3880_ID
#define LTC3882_ID
#define LTC3882_ID_D1
#define LTC3883_ID
#define LTC3884_ID
#define LTC3886_ID
#define LTC3887_ID
#define LTC3889_ID
#define LTC7132_ID
#define LTC7880_ID
#define LTM2987_ID_A
#define LTM2987_ID_B
#define LTM4664_ID
#define LTM4675_ID
#define LTM4676_ID_REV1
#define LTM4676_ID_REV2
#define LTM4676A_ID
#define LTM4677_ID_REV1
#define LTM4677_ID_REV2
#define LTM4678_ID_REV1
#define LTM4678_ID_REV2
#define LTM4680_ID
#define LTM4686_ID
#define LTM4700_ID

#define LTC2972_NUM_PAGES
#define LTC2974_NUM_PAGES
#define LTC2978_NUM_PAGES
#define LTC3880_NUM_PAGES
#define LTC3883_NUM_PAGES

#define LTC_POLL_TIMEOUT

#define LTC_NOT_BUSY
#define LTC_NOT_PENDING

/*
 * LTC2978 clears peak data whenever the CLEAR_FAULTS command is executed, which
 * happens pretty much each time chip data is updated. Raw peak data therefore
 * does not provide much value. To be able to provide useful peak data, keep an
 * internal cache of measured peak data, which is only cleared if an explicit
 * "clear peak" command is executed for the sensor in question.
 */

struct ltc2978_data {};
#define to_ltc2978_data(x)

#define FEAT_CLEAR_PEAKS
#define FEAT_NEEDS_POLLING

#define has_clear_peaks(d)
#define needs_polling(d)

static int ltc_wait_ready(struct i2c_client *client)
{}

static int ltc_read_word_data(struct i2c_client *client, int page, int phase,
			      int reg)
{}

static int ltc_read_byte_data(struct i2c_client *client, int page, int reg)
{}

static int ltc_write_byte_data(struct i2c_client *client, int page, int reg, u8 value)
{}

static int ltc_write_byte(struct i2c_client *client, int page, u8 byte)
{}

static inline int lin11_to_val(int data)
{}

static int ltc_get_max(struct ltc2978_data *data, struct i2c_client *client,
		       int page, int reg, u16 *pmax)
{}

static int ltc_get_min(struct ltc2978_data *data, struct i2c_client *client,
		       int page, int reg, u16 *pmin)
{}

static int ltc2978_read_word_data_common(struct i2c_client *client, int page,
					 int reg)
{}

static int ltc2978_read_word_data(struct i2c_client *client, int page,
				  int phase, int reg)
{}

static int ltc2974_read_word_data(struct i2c_client *client, int page,
				  int phase, int reg)
{}

static int ltc2975_read_word_data(struct i2c_client *client, int page,
				  int phase, int reg)
{}

static int ltc3880_read_word_data(struct i2c_client *client, int page,
				  int phase, int reg)
{}

static int ltc3883_read_word_data(struct i2c_client *client, int page,
				  int phase, int reg)
{}

static int ltc2978_clear_peaks(struct ltc2978_data *data,
			       struct i2c_client *client, int page)
{}

static int ltc2978_write_word_data(struct i2c_client *client, int page,
				    int reg, u16 word)
{}

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

#if IS_ENABLED(CONFIG_SENSORS_LTC2978_REGULATOR)
#define LTC2978_ADC_RES
#define LTC2978_N_ADC
#define LTC2978_MAX_UV
#define LTC2978_UV_STEP
#define LTC2978_N_VOLTAGES

static const struct regulator_desc ltc2978_reg_desc[] =;

static const struct regulator_desc ltc2978_reg_desc_default[] =;
#endif /* CONFIG_SENSORS_LTC2978_REGULATOR */

static int ltc2978_get_id(struct i2c_client *client)
{}

static int ltc2978_probe(struct i2c_client *client)
{}


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

static struct i2c_driver ltc2978_driver =;

module_i2c_driver();

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