linux/drivers/iio/adc/dln2-adc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for the Diolan DLN-2 USB-ADC adapter
 *
 * Copyright (c) 2017 Jack Andersen
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/mfd/dln2.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_buffer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/kfifo_buf.h>

#define DLN2_ADC_MOD_NAME

#define DLN2_ADC_ID

#define DLN2_ADC_GET_CHANNEL_COUNT
#define DLN2_ADC_ENABLE
#define DLN2_ADC_DISABLE
#define DLN2_ADC_CHANNEL_ENABLE
#define DLN2_ADC_CHANNEL_DISABLE
#define DLN2_ADC_SET_RESOLUTION
#define DLN2_ADC_CHANNEL_GET_VAL
#define DLN2_ADC_CHANNEL_GET_ALL_VAL
#define DLN2_ADC_CHANNEL_SET_CFG
#define DLN2_ADC_CHANNEL_GET_CFG
#define DLN2_ADC_CONDITION_MET_EV

#define DLN2_ADC_EVENT_NONE
#define DLN2_ADC_EVENT_BELOW
#define DLN2_ADC_EVENT_LEVEL_ABOVE
#define DLN2_ADC_EVENT_OUTSIDE
#define DLN2_ADC_EVENT_INSIDE
#define DLN2_ADC_EVENT_ALWAYS

#define DLN2_ADC_MAX_CHANNELS
#define DLN2_ADC_DATA_BITS

/*
 * Plays similar role to iio_demux_table in subsystem core; except allocated
 * in a fixed 8-element array.
 */
struct dln2_adc_demux_table {};

struct dln2_adc {};

struct dln2_adc_port_chan {};

struct dln2_adc_get_all_vals {};

static void dln2_adc_add_demux(struct dln2_adc *dln2,
	unsigned int in_loc, unsigned int out_loc,
	unsigned int length)
{}

static void dln2_adc_update_demux(struct dln2_adc *dln2)
{}

static int dln2_adc_get_chan_count(struct dln2_adc *dln2)
{}

static int dln2_adc_set_port_resolution(struct dln2_adc *dln2)
{}

static int dln2_adc_set_chan_enabled(struct dln2_adc *dln2,
				     int channel, bool enable)
{}

static int dln2_adc_set_port_enabled(struct dln2_adc *dln2, bool enable,
				     u16 *conflict_out)
{}

static int dln2_adc_set_chan_period(struct dln2_adc *dln2,
	unsigned int channel, unsigned int period)
{}

static int dln2_adc_read(struct dln2_adc *dln2, unsigned int channel)
{}

static int dln2_adc_read_all(struct dln2_adc *dln2,
			     struct dln2_adc_get_all_vals *get_all_vals)
{}

static int dln2_adc_read_raw(struct iio_dev *indio_dev,
			     struct iio_chan_spec const *chan,
			     int *val,
			     int *val2,
			     long mask)
{}

static int dln2_adc_write_raw(struct iio_dev *indio_dev,
			      struct iio_chan_spec const *chan,
			      int val,
			      int val2,
			      long mask)
{}

static int dln2_update_scan_mode(struct iio_dev *indio_dev,
				 const unsigned long *scan_mask)
{}

#define DLN2_ADC_CHAN(lval, idx)

/* Assignment version of IIO_CHAN_SOFT_TIMESTAMP */
#define IIO_CHAN_SOFT_TIMESTAMP_ASSIGN(lval, _si)

static const struct iio_info dln2_adc_info =;

static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
{}

static int dln2_adc_triggered_buffer_postenable(struct iio_dev *indio_dev)
{}

static int dln2_adc_triggered_buffer_predisable(struct iio_dev *indio_dev)
{}

static const struct iio_buffer_setup_ops dln2_adc_buffer_setup_ops =;

static void dln2_adc_event(struct platform_device *pdev, u16 echo,
			   const void *data, int len)
{}

static int dln2_adc_probe(struct platform_device *pdev)
{}

static void dln2_adc_remove(struct platform_device *pdev)
{}

static struct platform_driver dln2_adc_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();