linux/drivers/hwmon/lenovo-ec-sensors.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * HWMON driver for Lenovo ThinkStation based workstations
 * via the embedded controller registers
 *
 * Copyright (C) 2024 David Ober (Lenovo) <[email protected]>
 *
 * EC provides:
 * - CPU temperature
 * - DIMM temperature
 * - Chassis zone temperatures
 * - CPU fan RPM
 * - DIMM fan RPM
 * - Chassis fans RPM
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/units.h>

#define MCHP_SING_IDX
#define MCHP_EMI0_APPLICATION_ID
#define MCHP_EMI0_EC_ADDRESS
#define MCHP_EMI0_EC_DATA_BYTE0
#define MCHP_EMI0_EC_DATA_BYTE1
#define MCHP_EMI0_EC_DATA_BYTE2
#define MCHP_EMI0_EC_DATA_BYTE3
#define IO_REGION_START
#define IO_REGION_LENGTH

static inline u8
get_ec_reg(unsigned char page, unsigned char index)
{}

enum systems {};

static int px_temp_map[] =;

static const char * const lenovo_px_ec_temp_label[] =;

static int gen_temp_map[] =;

static const char * const lenovo_gen_ec_temp_label[] =;

static int px_fan_map[] =;

static const char * const px_ec_fan_label[] =;

static int p7_fan_map[] =;

static const char * const p7_ec_fan_label[] =;

static int p5_fan_map[] =;

static const char * const p5_ec_fan_label[] =;

static int p8_fan_map[] =;

static const char * const p8_ec_fan_label[] =;

struct ec_sensors_data {};

static int
lenovo_ec_do_read_temp(struct ec_sensors_data *data, u32 attr, int channel, long *val)
{}

static int
lenovo_ec_do_read_fan(struct ec_sensors_data *data, u32 attr, int channel, long *val)
{}

static int
lenovo_ec_hwmon_read_string(struct device *dev, enum hwmon_sensor_types type,
			    u32 attr, int channel, const char **str)
{}

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

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

static const struct hwmon_channel_info *lenovo_ec_hwmon_info_px[] =;

static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p8[] =;

static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p7[] =;

static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p5[] =;

static const struct hwmon_ops lenovo_ec_hwmon_ops =;

static struct hwmon_chip_info lenovo_ec_chip_info =;

static const struct dmi_system_id thinkstation_dmi_table[] =;
MODULE_DEVICE_TABLE(dmi, thinkstation_dmi_table);

static int lenovo_ec_probe(struct platform_device *pdev)
{}

static struct platform_driver lenovo_ec_sensors_platform_driver =;

static struct platform_device *lenovo_ec_sensors_platform_device;

static int __init lenovo_ec_init(void)
{}
module_init();

static void __exit lenovo_ec_exit(void)
{}
module_exit(lenovo_ec_exit);

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