linux/drivers/iio/adc/adi-axi-adc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Analog Devices Generic AXI ADC IP core
 * Link: https://wiki.analog.com/resources/fpga/docs/axi_adc_ip
 *
 * Copyright 2012-2020 Analog Devices Inc.
 */

#include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#include <linux/fpga/adi-axi-common.h>

#include <linux/iio/backend.h>
#include <linux/iio/buffer-dmaengine.h>
#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>

/*
 * Register definitions:
 *   https://wiki.analog.com/resources/fpga/docs/axi_adc_ip#register_map
 */

/* ADC controls */

#define ADI_AXI_REG_RSTN
#define ADI_AXI_REG_RSTN_CE_N
#define ADI_AXI_REG_RSTN_MMCM_RSTN
#define ADI_AXI_REG_RSTN_RSTN

#define ADI_AXI_ADC_REG_CTRL
#define ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK

#define ADI_AXI_ADC_REG_DRP_STATUS
#define ADI_AXI_ADC_DRP_LOCKED

/* ADC Channel controls */

#define ADI_AXI_REG_CHAN_CTRL(c)
#define ADI_AXI_REG_CHAN_CTRL_LB_OWR
#define ADI_AXI_REG_CHAN_CTRL_PN_SEL_OWR
#define ADI_AXI_REG_CHAN_CTRL_IQCOR_EN
#define ADI_AXI_REG_CHAN_CTRL_DCFILT_EN
#define ADI_AXI_REG_CHAN_CTRL_FMT_MASK
#define ADI_AXI_REG_CHAN_CTRL_FMT_SIGNEXT
#define ADI_AXI_REG_CHAN_CTRL_FMT_TYPE
#define ADI_AXI_REG_CHAN_CTRL_FMT_EN
#define ADI_AXI_REG_CHAN_CTRL_PN_TYPE_OWR
#define ADI_AXI_REG_CHAN_CTRL_ENABLE

#define ADI_AXI_ADC_REG_CHAN_STATUS(c)
#define ADI_AXI_ADC_CHAN_STAT_PN_MASK

#define ADI_AXI_ADC_REG_CHAN_CTRL_3(c)
#define ADI_AXI_ADC_CHAN_PN_SEL_MASK

/* IO Delays */
#define ADI_AXI_ADC_REG_DELAY(l)
#define AXI_ADC_DELAY_CTRL_MASK

#define ADI_AXI_ADC_MAX_IO_NUM_LANES

#define ADI_AXI_REG_CHAN_CTRL_DEFAULTS

struct adi_axi_adc_state {};

static int axi_adc_enable(struct iio_backend *back)
{}

static void axi_adc_disable(struct iio_backend *back)
{}

static int axi_adc_data_format_set(struct iio_backend *back, unsigned int chan,
				   const struct iio_backend_data_fmt *data)
{}

static int axi_adc_data_sample_trigger(struct iio_backend *back,
				       enum iio_backend_sample_trigger trigger)
{}

static int axi_adc_iodelays_set(struct iio_backend *back, unsigned int lane,
				unsigned int tap)
{}

static int axi_adc_test_pattern_set(struct iio_backend *back,
				    unsigned int chan,
				    enum iio_backend_test_pattern pattern)
{}

static int axi_adc_chan_status(struct iio_backend *back, unsigned int chan,
			       bool *error)
{}

static int axi_adc_chan_enable(struct iio_backend *back, unsigned int chan)
{}

static int axi_adc_chan_disable(struct iio_backend *back, unsigned int chan)
{}

static struct iio_buffer *axi_adc_request_buffer(struct iio_backend *back,
						 struct iio_dev *indio_dev)
{}

static void axi_adc_free_buffer(struct iio_backend *back,
				struct iio_buffer *buffer)
{}

static const struct regmap_config axi_adc_regmap_config =;

static const struct iio_backend_ops adi_axi_adc_generic =;

static int adi_axi_adc_probe(struct platform_device *pdev)
{}

static unsigned int adi_axi_adc_10_0_a_info =;

/* Match table for of_platform binding */
static const struct of_device_id adi_axi_adc_of_match[] =;
MODULE_DEVICE_TABLE(of, adi_axi_adc_of_match);

static struct platform_driver adi_axi_adc_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();