#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/sysfs.h>
struct tlc4541_state { … };
struct tlc4541_chip_info { … };
enum tlc4541_id { … };
#define TLC4541_V_CHAN(bits, bitshift) …
#define DECLARE_TLC4541_CHANNELS(name, bits, bitshift) …
static DECLARE_TLC4541_CHANNELS(tlc3541, 14, 2);
static DECLARE_TLC4541_CHANNELS(tlc4541, 16, 0);
static const struct tlc4541_chip_info tlc4541_chip_info[] = …;
static irqreturn_t tlc4541_trigger_handler(int irq, void *p)
{ … }
static int tlc4541_get_range(struct tlc4541_state *st)
{ … }
static int tlc4541_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{ … }
static const struct iio_info tlc4541_info = …;
static int tlc4541_probe(struct spi_device *spi)
{ … }
static void tlc4541_remove(struct spi_device *spi)
{ … }
static const struct of_device_id tlc4541_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, tlc4541_dt_ids);
static const struct spi_device_id tlc4541_id[] = …;
MODULE_DEVICE_TABLE(spi, tlc4541_id);
static struct spi_driver tlc4541_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;