#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#define MAX31722_REG_CFG …
#define MAX31722_REG_TEMP_LSB …
#define MAX31722_MODE_CONTINUOUS …
#define MAX31722_MODE_STANDBY …
#define MAX31722_MODE_MASK …
#define MAX31722_RESOLUTION_12BIT …
#define MAX31722_WRITE_MASK …
struct max31722_data { … };
static int max31722_set_mode(struct max31722_data *data, u8 mode)
{ … }
static ssize_t max31722_temp_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static SENSOR_DEVICE_ATTR_RO(temp1_input, max31722_temp, 0);
static struct attribute *max31722_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int max31722_probe(struct spi_device *spi)
{ … }
static void max31722_remove(struct spi_device *spi)
{ … }
static int max31722_suspend(struct device *dev)
{ … }
static int max31722_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(max31722_pm_ops, max31722_suspend, max31722_resume);
static const struct spi_device_id max31722_spi_id[] = …;
MODULE_DEVICE_TABLE(spi, max31722_spi_id);
static struct spi_driver max31722_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;