#include <asm/unaligned.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_profile.h>
#include <linux/types.h>
#include <linux/surface_aggregator/device.h>
enum ssam_tmp_profile { … };
enum ssam_fan_profile { … };
struct ssam_tmp_profile_info { … } __packed;
struct ssam_platform_profile_device { … };
SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_tmp_profile_get, struct ssam_tmp_profile_info, {
.target_category = SSAM_SSH_TC_TMP,
.command_id = 0x02,
});
SSAM_DEFINE_SYNC_REQUEST_CL_W(__ssam_tmp_profile_set, __le32, {
.target_category = SSAM_SSH_TC_TMP,
.command_id = 0x03,
});
SSAM_DEFINE_SYNC_REQUEST_W(__ssam_fan_profile_set, u8, {
.target_category = SSAM_SSH_TC_FAN,
.target_id = SSAM_SSH_TID_SAM,
.command_id = 0x0e,
.instance_id = 0x01,
});
static int ssam_tmp_profile_get(struct ssam_device *sdev, enum ssam_tmp_profile *p)
{ … }
static int ssam_tmp_profile_set(struct ssam_device *sdev, enum ssam_tmp_profile p)
{ … }
static int ssam_fan_profile_set(struct ssam_device *sdev, enum ssam_fan_profile p)
{ … }
static int convert_ssam_tmp_to_profile(struct ssam_device *sdev, enum ssam_tmp_profile p)
{ … }
static int convert_profile_to_ssam_tmp(struct ssam_device *sdev, enum platform_profile_option p)
{ … }
static int convert_profile_to_ssam_fan(struct ssam_device *sdev, enum platform_profile_option p)
{ … }
static int ssam_platform_profile_get(struct platform_profile_handler *pprof,
enum platform_profile_option *profile)
{ … }
static int ssam_platform_profile_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile)
{ … }
static int surface_platform_profile_probe(struct ssam_device *sdev)
{ … }
static void surface_platform_profile_remove(struct ssam_device *sdev)
{ … }
static const struct ssam_device_id ssam_platform_profile_match[] = …;
MODULE_DEVICE_TABLE(ssam, ssam_platform_profile_match);
static struct ssam_device_driver surface_platform_profile = …;
module_ssam_device_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;