linux/drivers/hwmon/pt5161l.c

// SPDX-License-Identifier: GPL-2.0-or-later

#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/hwmon.h>
#include <linux/module.h>
#include <linux/mutex.h>

/* Aries current average temp ADC code CSR */
#define ARIES_CURRENT_AVG_TEMP_ADC_CSR

/* Device Load check register */
#define ARIES_CODE_LOAD_REG
/* Value indicating FW was loaded properly, [3:1] = 3'b111 */
#define ARIES_LOAD_CODE

/* Main Micro Heartbeat register */
#define ARIES_MM_HEARTBEAT_ADDR

/* Reg offset to specify Address for MM assisted accesses */
#define ARIES_MM_ASSIST_REG_ADDR_OFFSET
/* Reg offset to specify Command for MM assisted accesses */
#define ARIES_MM_ASSIST_CMD_OFFSET
/* Reg offset to MM SPARE 0 used specify Address[7:0] */
#define ARIES_MM_ASSIST_SPARE_0_OFFSET
/* Reg offset to MM SPARE 3 used specify Data Byte 0 */
#define ARIES_MM_ASSIST_SPARE_3_OFFSET
/* Wide register reads */
#define ARIES_MM_RD_WIDE_REG_2B
#define ARIES_MM_RD_WIDE_REG_3B
#define ARIES_MM_RD_WIDE_REG_4B
#define ARIES_MM_RD_WIDE_REG_5B

/* Time delay between checking MM status of EEPROM write (microseconds) */
#define ARIES_MM_STATUS_TIME

/* AL Main SRAM DMEM offset (A0) */
#define AL_MAIN_SRAM_DMEM_OFFSET
/* SRAM read command */
#define AL_TG_RD_LOC_IND_SRAM

/* Offset for main micro FW info */
#define ARIES_MAIN_MICRO_FW_INFO
/* FW Info (Major) offset location in struct */
#define ARIES_MM_FW_VERSION_MAJOR
/* FW Info (Minor) offset location in struct */
#define ARIES_MM_FW_VERSION_MINOR
/* FW Info (Build no.) offset location in struct */
#define ARIES_MM_FW_VERSION_BUILD

#define ARIES_TEMP_CAL_CODE_DEFAULT

/* Struct defining FW version loaded on an Aries device */
struct pt5161l_fw_ver {};

/* Each client has this additional data */
struct pt5161l_data {};

static struct dentry *pt5161l_debugfs_dir;

/*
 * Write multiple data bytes to Aries over I2C
 */
static int pt5161l_write_block_data(struct pt5161l_data *data, u32 address,
				    u8 len, u8 *val)
{}

/*
 * Read multiple data bytes from Aries over I2C
 */
static int pt5161l_read_block_data(struct pt5161l_data *data, u32 address,
				   u8 len, u8 *val)
{}

static int pt5161l_read_wide_reg(struct pt5161l_data *data, u32 address,
				 u8 width, u8 *val)
{}

/*
 * Read multiple (up to eight) data bytes from micro SRAM over I2C
 */
static int
pt5161l_read_block_data_main_micro_indirect(struct pt5161l_data *data,
					    u32 address, u8 len, u8 *val)
{}

/*
 * Check firmware load status
 */
static int pt5161l_fw_load_check(struct pt5161l_data *data)
{}

/*
 * Check main micro heartbeat
 */
static int pt5161l_heartbeat_check(struct pt5161l_data *data)
{}

/*
 * Check the status of firmware
 */
static int pt5161l_fwsts_check(struct pt5161l_data *data)
{}

static int pt5161l_fw_is_at_least(struct pt5161l_data *data, u8 major, u8 minor,
				  u16 build)
{}

static int pt5161l_init_dev(struct pt5161l_data *data)
{}

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

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

static const struct hwmon_channel_info *pt5161l_info[] =;

static const struct hwmon_ops pt5161l_hwmon_ops =;

static const struct hwmon_chip_info pt5161l_chip_info =;

static ssize_t pt5161l_debugfs_read_fw_ver(struct file *file, char __user *buf,
					   size_t count, loff_t *ppos)
{}

static const struct file_operations pt5161l_debugfs_ops_fw_ver =;

static ssize_t pt5161l_debugfs_read_fw_load_sts(struct file *file,
						char __user *buf, size_t count,
						loff_t *ppos)
{}

static const struct file_operations pt5161l_debugfs_ops_fw_load_sts =;

static ssize_t pt5161l_debugfs_read_hb_sts(struct file *file, char __user *buf,
					   size_t count, loff_t *ppos)
{}

static const struct file_operations pt5161l_debugfs_ops_hb_sts =;

static int pt5161l_init_debugfs(struct pt5161l_data *data)
{}

static int pt5161l_probe(struct i2c_client *client)
{}

static void pt5161l_remove(struct i2c_client *client)
{}

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

static const struct acpi_device_id __maybe_unused pt5161l_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, pt5161l_acpi_match);

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

static struct i2c_driver pt5161l_driver =;

static int __init pt5161l_init(void)
{}

static void __exit pt5161l_exit(void)
{}

module_init();
module_exit(pt5161l_exit);

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