linux/drivers/hwmon/surface_fan.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Surface Fan driver for Surface System Aggregator Module. It provides access
 * to the fan's rpm through the hwmon system.
 *
 * Copyright (C) 2023 Ivor Wanders <[email protected]>
 */

#include <linux/hwmon.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/surface_aggregator/device.h>
#include <linux/types.h>

// SSAM
SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_fan_rpm_get, __le16, {
	.target_category = SSAM_SSH_TC_FAN,
	.command_id      = 0x01,
});

// hwmon
static umode_t surface_fan_hwmon_is_visible(const void *drvdata,
					    enum hwmon_sensor_types type, u32 attr,
					    int channel)
{}

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

static const struct hwmon_channel_info *const surface_fan_info[] =;

static const struct hwmon_ops surface_fan_hwmon_ops =;

static const struct hwmon_chip_info surface_fan_chip_info =;

static int surface_fan_probe(struct ssam_device *sdev)
{}

static const struct ssam_device_id ssam_fan_match[] =;
MODULE_DEVICE_TABLE(ssam, ssam_fan_match);

static struct ssam_device_driver surface_fan =;
module_ssam_device_driver();

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