#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#define MAGIC_NUMBER …
struct nsa320_hwmon { … };
enum nsa320_inputs { … };
static const char * const nsa320_input_names[] = …;
static s32 nsa320_hwmon_update(struct device *dev)
{ … }
static ssize_t label_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t temp1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fan1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_label, label, NSA320_TEMP);
static DEVICE_ATTR_RO(temp1_input);
static SENSOR_DEVICE_ATTR_RO(fan1_label, label, NSA320_FAN);
static DEVICE_ATTR_RO(fan1_input);
static struct attribute *nsa320_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct of_device_id of_nsa320_hwmon_match[] = …;
static int nsa320_hwmon_probe(struct platform_device *pdev)
{ … }
static struct platform_driver nsa320_hwmon_driver = …;
module_platform_driver(…) …;
MODULE_DEVICE_TABLE(of, of_nsa320_hwmon_match);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;