#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/units.h>
#include <linux/fpga-dfl.h>
#include "dfl.h"
#include "dfl-fme.h"
static ssize_t ports_num_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(ports_num);
static ssize_t bitstream_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(bitstream_id);
static ssize_t bitstream_metadata_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(bitstream_metadata);
static ssize_t cache_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(cache_size);
static ssize_t fabric_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(fabric_version);
static ssize_t socket_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(socket_id);
static struct attribute *fme_hdr_attrs[] = …;
static const struct attribute_group fme_hdr_group = …;
static long fme_hdr_ioctl_release_port(struct dfl_feature_platform_data *pdata,
unsigned long arg)
{ … }
static long fme_hdr_ioctl_assign_port(struct dfl_feature_platform_data *pdata,
unsigned long arg)
{ … }
static long fme_hdr_ioctl(struct platform_device *pdev,
struct dfl_feature *feature,
unsigned int cmd, unsigned long arg)
{ … }
static const struct dfl_feature_id fme_hdr_id_table[] = …;
static const struct dfl_feature_ops fme_hdr_ops = …;
#define FME_THERM_THRESHOLD …
#define TEMP_THRESHOLD1 …
#define TEMP_THRESHOLD1_EN …
#define TEMP_THRESHOLD2 …
#define TEMP_THRESHOLD2_EN …
#define TRIP_THRESHOLD …
#define TEMP_THRESHOLD1_STATUS …
#define TEMP_THRESHOLD2_STATUS …
#define TEMP_THRESHOLD1_POLICY …
#define FME_THERM_RDSENSOR_FMT1 …
#define FPGA_TEMPERATURE …
#define FME_THERM_CAP …
#define THERM_NO_THROTTLE …
#define MD_PRE_DEG
static bool fme_thermal_throttle_support(void __iomem *base)
{ … }
static umode_t thermal_hwmon_attrs_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int thermal_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static const struct hwmon_ops thermal_hwmon_ops = …;
static const struct hwmon_channel_info * const thermal_hwmon_info[] = …;
static const struct hwmon_chip_info thermal_hwmon_chip_info = …;
static ssize_t temp1_max_policy_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(temp1_max_policy);
static struct attribute *thermal_extra_attrs[] = …;
static umode_t thermal_extra_attrs_visible(struct kobject *kobj,
struct attribute *attr, int index)
{ … }
static const struct attribute_group thermal_extra_group = …;
__ATTRIBUTE_GROUPS(…);
static int fme_thermal_mgmt_init(struct platform_device *pdev,
struct dfl_feature *feature)
{ … }
static const struct dfl_feature_id fme_thermal_mgmt_id_table[] = …;
static const struct dfl_feature_ops fme_thermal_mgmt_ops = …;
#define FME_PWR_STATUS …
#define FME_LATENCY_TOLERANCE …
#define PWR_CONSUMED …
#define FME_PWR_THRESHOLD …
#define PWR_THRESHOLD1 …
#define PWR_THRESHOLD2 …
#define PWR_THRESHOLD_MAX …
#define PWR_THRESHOLD1_STATUS …
#define PWR_THRESHOLD2_STATUS …
#define FME_PWR_XEON_LIMIT …
#define XEON_PWR_LIMIT …
#define XEON_PWR_EN …
#define FME_PWR_FPGA_LIMIT …
#define FPGA_PWR_LIMIT …
#define FPGA_PWR_EN …
static int power_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ … }
static int power_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{ … }
static umode_t power_hwmon_attrs_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static const struct hwmon_ops power_hwmon_ops = …;
static const struct hwmon_channel_info * const power_hwmon_info[] = …;
static const struct hwmon_chip_info power_hwmon_chip_info = …;
static ssize_t power1_xeon_limit_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t power1_fpga_limit_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t power1_ltr_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(power1_xeon_limit);
static DEVICE_ATTR_RO(power1_fpga_limit);
static DEVICE_ATTR_RO(power1_ltr);
static struct attribute *power_extra_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int fme_power_mgmt_init(struct platform_device *pdev,
struct dfl_feature *feature)
{ … }
static const struct dfl_feature_id fme_power_mgmt_id_table[] = …;
static const struct dfl_feature_ops fme_power_mgmt_ops = …;
static struct dfl_feature_driver fme_feature_drvs[] = …;
static long fme_ioctl_check_extension(struct dfl_feature_platform_data *pdata,
unsigned long arg)
{ … }
static int fme_open(struct inode *inode, struct file *filp)
{ … }
static int fme_release(struct inode *inode, struct file *filp)
{ … }
static long fme_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ … }
static int fme_dev_init(struct platform_device *pdev)
{ … }
static void fme_dev_destroy(struct platform_device *pdev)
{ … }
static const struct file_operations fme_fops = …;
static int fme_probe(struct platform_device *pdev)
{ … }
static void fme_remove(struct platform_device *pdev)
{ … }
static const struct attribute_group *fme_dev_groups[] = …;
static struct platform_driver fme_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;