linux/drivers/hwmon/i5k_amb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * A hwmon driver for the Intel 5000 series chipset FB-DIMM AMB
 * temperature sensors
 * Copyright (C) 2007 IBM
 *
 * Author: Darrick J. Wong <[email protected]>
 */

#include <linux/module.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/log2.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#define DRVNAME

#define I5K_REG_AMB_BASE_ADDR
#define I5K_REG_AMB_LEN_ADDR
#define I5K_REG_CHAN0_PRESENCE_ADDR
#define I5K_REG_CHAN1_PRESENCE_ADDR

#define AMB_REG_TEMP_MIN_ADDR
#define AMB_REG_TEMP_MID_ADDR
#define AMB_REG_TEMP_MAX_ADDR
#define AMB_REG_TEMP_STATUS_ADDR
#define AMB_REG_TEMP_ADDR

#define AMB_CONFIG_SIZE
#define AMB_FUNC_3_OFFSET

static unsigned long amb_reg_temp_status(unsigned int amb)
{}

static unsigned long amb_reg_temp_min(unsigned int amb)
{}

static unsigned long amb_reg_temp_mid(unsigned int amb)
{}

static unsigned long amb_reg_temp_max(unsigned int amb)
{}

static unsigned long amb_reg_temp(unsigned int amb)
{}

#define MAX_MEM_CHANNELS
#define MAX_AMBS_PER_CHANNEL
#define MAX_AMBS
#define CHANNEL_SHIFT
#define DIMM_MASK
/*
 * Ugly hack: For some reason the highest bit is set if there
 * are _any_ DIMMs in the channel.  Attempting to read from
 * this "high-order" AMB results in a memory bus error, so
 * for now we'll just ignore that top bit, even though that
 * might prevent us from seeing the 16th DIMM in the channel.
 */
#define REAL_MAX_AMBS_PER_CHANNEL
#define KNOBS_PER_AMB

static unsigned long amb_num_from_reg(unsigned int byte_num, unsigned int bit)
{}

#define AMB_SYSFS_NAME_LEN
struct i5k_device_attribute {};

struct i5k_amb_data {};

static DEVICE_STRING_ATTR_RO(name, 0444, DRVNAME);

static struct platform_device *amb_pdev;

static u8 amb_read_byte(struct i5k_amb_data *data, unsigned long offset)
{}

static void amb_write_byte(struct i5k_amb_data *data, unsigned long offset,
			   u8 val)
{}

static ssize_t show_amb_alarm(struct device *dev,
			     struct device_attribute *devattr,
			     char *buf)
{}

static ssize_t store_amb_min(struct device *dev,
			     struct device_attribute *devattr,
			     const char *buf,
			     size_t count)
{}

static ssize_t store_amb_mid(struct device *dev,
			     struct device_attribute *devattr,
			     const char *buf,
			     size_t count)
{}

static ssize_t store_amb_max(struct device *dev,
			     struct device_attribute *devattr,
			     const char *buf,
			     size_t count)
{}

static ssize_t show_amb_min(struct device *dev,
			     struct device_attribute *devattr,
			     char *buf)
{}

static ssize_t show_amb_mid(struct device *dev,
			     struct device_attribute *devattr,
			     char *buf)
{}

static ssize_t show_amb_max(struct device *dev,
			     struct device_attribute *devattr,
			     char *buf)
{}

static ssize_t show_amb_temp(struct device *dev,
			     struct device_attribute *devattr,
			     char *buf)
{}

static ssize_t show_label(struct device *dev,
			  struct device_attribute *devattr,
			  char *buf)
{}

static int i5k_amb_hwmon_init(struct platform_device *pdev)
{}

static int i5k_amb_add(void)
{}

static int i5k_find_amb_registers(struct i5k_amb_data *data,
					    unsigned long devid)
{}

static int i5k_channel_probe(u16 *amb_present, unsigned long dev_id)
{}

static struct {} chipset_ids[]  =;

#ifdef MODULE
static const struct pci_device_id i5k_amb_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR) },
	{ 0, }
};
MODULE_DEVICE_TABLE(pci, i5k_amb_ids);
#endif

static int i5k_amb_probe(struct platform_device *pdev)
{}

static void i5k_amb_remove(struct platform_device *pdev)
{}

static struct platform_driver i5k_amb_driver =;

static int __init i5k_amb_init(void)
{}

static void __exit i5k_amb_exit(void)
{}

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

module_init();
module_exit(i5k_amb_exit);