#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/mutex.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#define DRVNAME …
struct adcxx { … };
static ssize_t adcxx_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t adcxx_min_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t adcxx_max_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static ssize_t adcxx_max_store(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{ … }
static ssize_t adcxx_name_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static struct sensor_device_attribute ad_input[] = …;
static int adcxx_probe(struct spi_device *spi)
{ … }
static void adcxx_remove(struct spi_device *spi)
{ … }
static const struct spi_device_id adcxx_ids[] = …;
MODULE_DEVICE_TABLE(spi, adcxx_ids);
static struct spi_driver adcxx_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;