linux/drivers/hwmon/adcxx.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * adcxx.c
 *
 * The adcxx4s is an AD converter family from National Semiconductor (NS).
 *
 * Copyright (c) 2008 Marc Pignat <[email protected]>
 *
 * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
 * interface. This driver supports the whole family of devices with name
 * ADC<bb><c>S<sss>, where
 * * bb is the resolution in number of bits (8, 10, 12)
 * * c is the number of channels (1, 2, 4, 8)
 * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS
 *   and 101 for 1 MSPS)
 *
 * Complete datasheets are available at National's website here:
 * http://www.national.com/ds/DC/ADC<bb><c>S<sss>.pdf
 *
 * Handling of 8, 10 and 12 bits converters are the same, the
 * unavailable bits are 0 :)
 */

#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 {};

/* sysfs hook function */
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();