#include <linux/completion.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/iio/consumer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
struct envelope { … };
static int envelope_detector_comp_latch(struct envelope *env)
{ … }
static irqreturn_t envelope_detector_comp_isr(int irq, void *ctx)
{ … }
static void envelope_detector_setup_compare(struct envelope *env)
{ … }
static void envelope_detector_timeout(struct work_struct *work)
{ … }
static int envelope_detector_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static ssize_t envelope_show_invert(struct iio_dev *indio_dev,
uintptr_t private,
struct iio_chan_spec const *ch, char *buf)
{ … }
static ssize_t envelope_store_invert(struct iio_dev *indio_dev,
uintptr_t private,
struct iio_chan_spec const *ch,
const char *buf, size_t len)
{ … }
static ssize_t envelope_show_comp_interval(struct iio_dev *indio_dev,
uintptr_t private,
struct iio_chan_spec const *ch,
char *buf)
{ … }
static ssize_t envelope_store_comp_interval(struct iio_dev *indio_dev,
uintptr_t private,
struct iio_chan_spec const *ch,
const char *buf, size_t len)
{ … }
static const struct iio_chan_spec_ext_info envelope_detector_ext_info[] = …;
static const struct iio_chan_spec envelope_detector_iio_channel = …;
static const struct iio_info envelope_detector_info = …;
static int envelope_detector_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id envelope_detector_match[] = …;
MODULE_DEVICE_TABLE(of, envelope_detector_match);
static struct platform_driver envelope_detector_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;