#include <linux/device.h>
#include <linux/spi/spi.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/unaligned.h>
#define LTC2632_CMD_WRITE_INPUT_N …
#define LTC2632_CMD_UPDATE_DAC_N …
#define LTC2632_CMD_WRITE_INPUT_N_UPDATE_ALL …
#define LTC2632_CMD_WRITE_INPUT_N_UPDATE_N …
#define LTC2632_CMD_POWERDOWN_DAC_N …
#define LTC2632_CMD_POWERDOWN_CHIP …
#define LTC2632_CMD_INTERNAL_REFER …
#define LTC2632_CMD_EXTERNAL_REFER …
struct ltc2632_chip_info { … };
struct ltc2632_state { … };
enum ltc2632_supported_device_ids { … };
static int ltc2632_spi_write(struct spi_device *spi,
u8 cmd, u8 addr, u16 val, u8 shift)
{ … }
static int ltc2632_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{ … }
static int ltc2632_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val,
int val2,
long mask)
{ … }
static ssize_t ltc2632_read_dac_powerdown(struct iio_dev *indio_dev,
uintptr_t private,
const struct iio_chan_spec *chan,
char *buf)
{ … }
static ssize_t ltc2632_write_dac_powerdown(struct iio_dev *indio_dev,
uintptr_t private,
const struct iio_chan_spec *chan,
const char *buf,
size_t len)
{ … }
static const struct iio_info ltc2632_info = …;
static const struct iio_chan_spec_ext_info ltc2632_ext_info[] = …;
#define LTC2632_CHANNEL(_chan, _bits) …
#define DECLARE_LTC2632_CHANNELS(_name, _bits) …
static DECLARE_LTC2632_CHANNELS(ltc2632x12, 12);
static DECLARE_LTC2632_CHANNELS(ltc2632x10, 10);
static DECLARE_LTC2632_CHANNELS(ltc2632x8, 8);
static const struct ltc2632_chip_info ltc2632_chip_info_tbl[] = …;
static int ltc2632_probe(struct spi_device *spi)
{ … }
static void ltc2632_remove(struct spi_device *spi)
{ … }
static const struct spi_device_id ltc2632_id[] = …;
MODULE_DEVICE_TABLE(spi, ltc2632_id);
static const struct of_device_id ltc2632_of_match[] = …;
MODULE_DEVICE_TABLE(of, ltc2632_of_match);
static struct spi_driver ltc2632_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;