#include <linux/bitops.h>
#include <linux/hwmon.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/surface_aggregator/controller.h>
#include <linux/surface_aggregator/device.h>
#define SSAM_TMP_SENSOR_MAX_COUNT …
#define SSAM_TMP_SENSOR_NAME_LENGTH …
struct ssam_tmp_get_name_rsp { … } __packed;
static_assert(…);
SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_tmp_get_available_sensors, __le16, {
.target_category = SSAM_SSH_TC_TMP,
.command_id = 0x04,
});
SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_temperature, __le16, {
.target_category = SSAM_SSH_TC_TMP,
.command_id = 0x01,
});
SSAM_DEFINE_SYNC_REQUEST_MD_R(__ssam_tmp_get_name, struct ssam_tmp_get_name_rsp, {
.target_category = SSAM_SSH_TC_TMP,
.command_id = 0x0e,
});
static int ssam_tmp_get_available_sensors(struct ssam_device *sdev, s16 *sensors)
{ … }
static int ssam_tmp_get_temperature(struct ssam_device *sdev, u8 iid, long *temperature)
{ … }
static int ssam_tmp_get_name(struct ssam_device *sdev, u8 iid, char *buf, size_t buf_len)
{ … }
struct ssam_temp { … };
static umode_t ssam_temp_hwmon_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int ssam_temp_hwmon_read(struct device *dev,
enum hwmon_sensor_types type,
u32 attr, int channel, long *value)
{ … }
static int ssam_temp_hwmon_read_string(struct device *dev,
enum hwmon_sensor_types type,
u32 attr, int channel, const char **str)
{ … }
static const struct hwmon_channel_info * const ssam_temp_hwmon_info[] = …;
static const struct hwmon_ops ssam_temp_hwmon_ops = …;
static const struct hwmon_chip_info ssam_temp_hwmon_chip_info = …;
static int ssam_temp_probe(struct ssam_device *sdev)
{ … }
static const struct ssam_device_id ssam_temp_match[] = …;
MODULE_DEVICE_TABLE(ssam, ssam_temp_match);
static struct ssam_device_driver ssam_temp = …;
module_ssam_device_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;