#include <linux/delay.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_event.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#include <linux/gpio/consumer.h>
#define DRV_NAME …
#define HI8435_CTRL_REG …
#define HI8435_PSEN_REG …
#define HI8435_TMDATA_REG …
#define HI8435_GOCENHYS_REG …
#define HI8435_SOCENHYS_REG …
#define HI8435_SO7_0_REG …
#define HI8435_SO15_8_REG …
#define HI8435_SO23_16_REG …
#define HI8435_SO31_24_REG …
#define HI8435_SO31_0_REG …
#define HI8435_WRITE_OPCODE …
#define HI8435_READ_OPCODE …
#define HI8435_CTRL_TEST …
#define HI8435_CTRL_SRST …
struct hi8435_priv { … };
static int hi8435_readb(struct hi8435_priv *priv, u8 reg, u8 *val)
{ … }
static int hi8435_readw(struct hi8435_priv *priv, u8 reg, u16 *val)
{ … }
static int hi8435_readl(struct hi8435_priv *priv, u8 reg, u32 *val)
{ … }
static int hi8435_writeb(struct hi8435_priv *priv, u8 reg, u8 val)
{ … }
static int hi8435_writew(struct hi8435_priv *priv, u8 reg, u16 val)
{ … }
static int hi8435_read_raw(struct iio_dev *idev,
const struct iio_chan_spec *chan,
int *val, int *val2, long mask)
{ … }
static int hi8435_read_event_config(struct iio_dev *idev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir)
{ … }
static int hi8435_write_event_config(struct iio_dev *idev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
{ … }
static int hi8435_read_event_value(struct iio_dev *idev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info,
int *val, int *val2)
{ … }
static int hi8435_write_event_value(struct iio_dev *idev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info,
int val, int val2)
{ … }
static int hi8435_debugfs_reg_access(struct iio_dev *idev,
unsigned reg, unsigned writeval,
unsigned *readval)
{ … }
static const struct iio_event_spec hi8435_events[] = …;
static int hi8435_get_sensing_mode(struct iio_dev *idev,
const struct iio_chan_spec *chan)
{ … }
static int hi8435_set_sensing_mode(struct iio_dev *idev,
const struct iio_chan_spec *chan,
unsigned int mode)
{ … }
static const char * const hi8435_sensing_modes[] = …;
static const struct iio_enum hi8435_sensing_mode = …;
static const struct iio_chan_spec_ext_info hi8435_ext_info[] = …;
#define HI8435_VOLTAGE_CHANNEL(num) …
static const struct iio_chan_spec hi8435_channels[] = …;
static const struct iio_info hi8435_info = …;
static void hi8435_iio_push_event(struct iio_dev *idev, unsigned int val)
{ … }
static irqreturn_t hi8435_trigger_handler(int irq, void *private)
{ … }
static void hi8435_triggered_event_cleanup(void *data)
{ … }
static int hi8435_probe(struct spi_device *spi)
{ … }
static const struct of_device_id hi8435_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, hi8435_dt_ids);
static const struct spi_device_id hi8435_id[] = …;
MODULE_DEVICE_TABLE(spi, hi8435_id);
static struct spi_driver hi8435_driver = …;
module_spi_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;