#include <linux/bitops.h>
#include <linux/byteorder/generic.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/irqreturn.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <vdso/bits.h>
#include <linux/iio/buffer.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/trigger_consumer.h>
#include "sx_common.h"
#define SX_COMMON_CONVDONE_IRQ …
#define SX_COMMON_FAR_IRQ …
#define SX_COMMON_CLOSE_IRQ …
const struct iio_event_spec sx_common_events[3] = …;
EXPORT_SYMBOL_NS_GPL(…);
static irqreturn_t sx_common_irq_handler(int irq, void *private)
{ … }
static void sx_common_push_events(struct iio_dev *indio_dev)
{ … }
static int sx_common_enable_irq(struct sx_common_data *data, unsigned int irq)
{ … }
static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq)
{ … }
static int sx_common_update_chan_en(struct sx_common_data *data,
unsigned long chan_read,
unsigned long chan_event)
{ … }
static int sx_common_get_read_channel(struct sx_common_data *data, int channel)
{ … }
static int sx_common_put_read_channel(struct sx_common_data *data, int channel)
{ … }
static int sx_common_get_event_channel(struct sx_common_data *data, int channel)
{ … }
static int sx_common_put_event_channel(struct sx_common_data *data, int channel)
{ … }
int sx_common_read_proximity(struct sx_common_data *data,
const struct iio_chan_spec *chan, int *val)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int sx_common_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int sx_common_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int sx_common_set_trigger_state(struct iio_trigger *trig, bool state)
{ … }
static const struct iio_trigger_ops sx_common_trigger_ops = …;
static irqreturn_t sx_common_irq_thread_handler(int irq, void *private)
{ … }
static irqreturn_t sx_common_trigger_handler(int irq, void *private)
{ … }
static int sx_common_buffer_preenable(struct iio_dev *indio_dev)
{ … }
static int sx_common_buffer_postdisable(struct iio_dev *indio_dev)
{ … }
static const struct iio_buffer_setup_ops sx_common_buffer_setup_ops = …;
void sx_common_get_raw_register_config(struct device *dev,
struct sx_common_reg_default *reg_def)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
#define SX_COMMON_SOFT_RESET …
static int sx_common_init_device(struct device *dev, struct iio_dev *indio_dev)
{ … }
int sx_common_probe(struct i2c_client *client,
const struct sx_common_chip_info *chip_info,
const struct regmap_config *regmap_config)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;