#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/spi/spi.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/bitops.h>
#define AD7314_TEMP_MASK …
#define AD7314_TEMP_SHIFT …
#define ADT7301_TEMP_MASK …
enum ad7314_variant { … };
struct ad7314_data { … };
static int ad7314_spi_read(struct ad7314_data *chip)
{ … }
static ssize_t ad7314_temperature_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, ad7314_temperature, 0);
static struct attribute *ad7314_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int ad7314_probe(struct spi_device *spi_dev)
{ … }
static const struct spi_device_id ad7314_id[] = …;
MODULE_DEVICE_TABLE(spi, ad7314_id);
static struct spi_driver ad7314_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;