linux/drivers/hwmon/sbrmi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * sbrmi.c - hwmon driver for a SB-RMI mailbox
 *           compliant AMD SoC device.
 *
 * Copyright (C) 2020-2021 Advanced Micro Devices, Inc.
 */

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

/* Do not allow setting negative power limit */
#define SBRMI_PWR_MIN
/* Mask for Status Register bit[1] */
#define SW_ALERT_MASK

/* Software Interrupt for triggering */
#define START_CMD
#define TRIGGER_MAILBOX

/*
 * SB-RMI supports soft mailbox service request to MP1 (power management
 * firmware) through SBRMI inbound/outbound message registers.
 * SB-RMI message IDs
 */
enum sbrmi_msg_id {};

/* SB-RMI registers */
enum sbrmi_reg {};

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

struct sbrmi_mailbox_msg {};

static int sbrmi_enable_alert(struct i2c_client *client)
{}

static int rmi_mailbox_xfer(struct sbrmi_data *data,
			    struct sbrmi_mailbox_msg *msg)
{}

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

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

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

static const struct hwmon_channel_info * const sbrmi_info[] =;

static const struct hwmon_ops sbrmi_hwmon_ops =;

static const struct hwmon_chip_info sbrmi_chip_info =;

static int sbrmi_get_max_pwr_limit(struct sbrmi_data *data)
{}

static int sbrmi_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver sbrmi_driver =;

module_i2c_driver();

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