linux/drivers/hwmon/pmbus/mp2975.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers
 *
 * Copyright (C) 2020 Nvidia Technologies Ltd.
 */

#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>

#include "pmbus.h"

/* Vendor specific registers. */
#define MP2975_MFR_APS_HYS_R2
#define MP2975_MFR_SLOPE_TRIM3
#define MP2975_MFR_VR_MULTI_CONFIG_R1
#define MP2975_MFR_VR_MULTI_CONFIG_R2
#define MP2975_MFR_APS_DECAY_ADV
#define MP2975_MFR_DC_LOOP_CTRL
#define MP2975_MFR_OCP_UCP_PHASE_SET
#define MP2975_MFR_VR_CONFIG1
#define MP2975_MFR_READ_CS1_2
#define MP2975_MFR_READ_CS3_4
#define MP2975_MFR_READ_CS5_6
#define MP2975_MFR_READ_CS7_8
#define MP2975_MFR_READ_CS9_10
#define MP2975_MFR_READ_CS11_12
#define MP2975_MFR_READ_IOUT_PK
#define MP2975_MFR_READ_POUT_PK
#define MP2975_MFR_READ_VREF_R1
#define MP2975_MFR_READ_VREF_R2
#define MP2975_MFR_OVP_TH_SET
#define MP2975_MFR_UVP_SET

#define MP2973_MFR_RESO_SET

#define MP2975_VOUT_FORMAT
#define MP2975_VID_STEP_SEL_R1
#define MP2975_IMVP9_EN_R1
#define MP2975_VID_STEP_SEL_R2
#define MP2975_IMVP9_EN_R2
#define MP2975_PRT_THRES_DIV_OV_EN
#define MP2975_DRMOS_KCS
#define MP2975_PROT_DEV_OV_OFF
#define MP2975_PROT_DEV_OV_ON
#define MP2975_SENSE_AMPL
#define MP2975_SENSE_AMPL_UNIT
#define MP2975_SENSE_AMPL_HALF
#define MP2975_VIN_UV_LIMIT_UNIT

#define MP2973_VOUT_FORMAT_R1
#define MP2973_VOUT_FORMAT_R2
#define MP2973_VOUT_FORMAT_DIRECT_R1
#define MP2973_VOUT_FORMAT_LINEAR_R1
#define MP2973_VOUT_FORMAT_DIRECT_R2
#define MP2973_VOUT_FORMAT_LINEAR_R2

#define MP2973_MFR_VR_MULTI_CONFIG_R1
#define MP2973_MFR_VR_MULTI_CONFIG_R2
#define MP2973_VID_STEP_SEL_R1
#define MP2973_IMVP9_EN_R1
#define MP2973_VID_STEP_SEL_R2
#define MP2973_IMVP9_EN_R2

#define MP2973_MFR_OCP_TOTAL_SET
#define MP2973_OCP_TOTAL_CUR_MASK
#define MP2973_MFR_OCP_LEVEL_RES

#define MP2973_MFR_READ_IOUT_PK
#define MP2973_MFR_READ_POUT_PK

#define MP2975_MAX_PHASE_RAIL1
#define MP2975_MAX_PHASE_RAIL2

#define MP2973_MAX_PHASE_RAIL1
#define MP2973_MAX_PHASE_RAIL2

#define MP2971_MAX_PHASE_RAIL1
#define MP2971_MAX_PHASE_RAIL2

#define MP2975_PAGE_NUM

#define MP2975_RAIL2_FUNC

enum chips {};

static const int mp2975_max_phases[][MP2975_PAGE_NUM] =;

struct mp2975_driver_info {};

struct mp2975_data {};

static const struct regulator_desc __maybe_unused mp2975_reg_desc[] =;

#define to_mp2975_data(x)

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

static int
mp2975_read_word_helper(struct i2c_client *client, int page, int phase, u8 reg,
			u16 mask)
{}

static int
mp2975_vid2direct(int vrf, int val)
{}

#define MAX_LIN_MANTISSA
#define MIN_LIN_MANTISSA

/* Converts a milli-unit DIRECT value to LINEAR11 format */
static u16 mp2975_data2reg_linear11(s64 val)
{}

static int
mp2975_read_phase(struct i2c_client *client, struct mp2975_data *data,
		  int page, int phase, u8 reg)
{}

static int
mp2975_read_phases(struct i2c_client *client, struct mp2975_data *data,
		   int page, int phase)
{}

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

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

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

static int mp2975_identify_multiphase_rail2(struct i2c_client *client,
					    struct mp2975_data *data)
{}

static void mp2975_set_phase_rail1(struct pmbus_driver_info *info)
{}

static void
mp2975_set_phase_rail2(struct pmbus_driver_info *info, int num_phases)
{}

static int
mp2975_identify_multiphase(struct i2c_client *client, struct mp2975_data *data,
			   struct pmbus_driver_info *info)
{}

static int
mp2975_identify_vid(struct i2c_client *client, struct mp2975_data *data,
		    struct pmbus_driver_info *info, u32 reg, int page,
		    u32 imvp_bit, u32 vr_bit)
{}

static int
mp2975_identify_rails_vid(struct i2c_client *client, struct mp2975_data *data,
			  struct pmbus_driver_info *info)
{}

static int
mp2973_identify_rails_vid(struct i2c_client *client, struct mp2975_data *data,
			  struct pmbus_driver_info *info)
{}

static int
mp2975_current_sense_gain_get(struct i2c_client *client,
			      struct mp2975_data *data)
{}

static int
mp2975_vref_get(struct i2c_client *client, struct mp2975_data *data,
		struct pmbus_driver_info *info)
{}

static int
mp2975_vref_offset_get(struct i2c_client *client, struct mp2975_data *data,
		       int page)
{}

static int
mp2975_vout_max_get(struct i2c_client *client, struct mp2975_data *data,
		    struct pmbus_driver_info *info, int page)
{}

static int
mp2975_set_vout_format(struct i2c_client *client,
		       struct mp2975_data *data, int page)
{}

static int
mp2975_vout_ov_scale_get(struct i2c_client *client, struct mp2975_data *data,
			 struct pmbus_driver_info *info)
{}

static int
mp2975_vout_per_rail_config_get(struct i2c_client *client,
				struct mp2975_data *data,
				struct pmbus_driver_info *info)
{}

static const struct pmbus_driver_info mp2975_info =;

static const struct pmbus_driver_info mp2973_info =;

static const struct mp2975_driver_info mp2975_ddinfo[] =;

static int mp2975_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver mp2975_driver =;

module_i2c_driver();

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