linux/drivers/iio/adc/xilinx-xadc.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Xilinx XADC driver
 *
 * Copyright 2013 Analog Devices Inc.
 *  Author: Lars-Peter Clausen <[email protected]>
 */

#ifndef __IIO_XILINX_XADC__
#define __IIO_XILINX_XADC__

#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>

struct iio_dev;
struct clk;
struct xadc_ops;
struct platform_device;

void xadc_handle_events(struct iio_dev *indio_dev, unsigned long events);

int xadc_read_event_config(struct iio_dev *indio_dev,
	const struct iio_chan_spec *chan, enum iio_event_type type,
	enum iio_event_direction dir);
int xadc_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);
int xadc_read_event_value(struct iio_dev *indio_dev,
	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);
int xadc_write_event_value(struct iio_dev *indio_dev,
	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);

enum xadc_external_mux_mode {};

struct xadc {};

enum xadc_type {};

struct xadc_ops {};

static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg,
	uint16_t *val)
{}

static inline int _xadc_write_adc_reg(struct xadc *xadc, unsigned int reg,
	uint16_t val)
{}

static inline int xadc_read_adc_reg(struct xadc *xadc, unsigned int reg,
	uint16_t *val)
{}

static inline int xadc_write_adc_reg(struct xadc *xadc, unsigned int reg,
	uint16_t val)
{}

/* XADC hardmacro register definitions */
#define XADC_REG_TEMP
#define XADC_REG_VCCINT
#define XADC_REG_VCCAUX
#define XADC_REG_VPVN
#define XADC_REG_VREFP
#define XADC_REG_VREFN
#define XADC_REG_VCCBRAM

#define XADC_REG_VCCPINT
#define XADC_REG_VCCPAUX
#define XADC_REG_VCCO_DDR
#define XADC_REG_VAUX(x)

#define XADC_REG_MAX_TEMP
#define XADC_REG_MAX_VCCINT
#define XADC_REG_MAX_VCCAUX
#define XADC_REG_MAX_VCCBRAM
#define XADC_REG_MIN_TEMP
#define XADC_REG_MIN_VCCINT
#define XADC_REG_MIN_VCCAUX
#define XADC_REG_MIN_VCCBRAM
#define XADC_REG_MAX_VCCPINT
#define XADC_REG_MAX_VCCPAUX
#define XADC_REG_MAX_VCCO_DDR
#define XADC_REG_MIN_VCCPINT
#define XADC_REG_MIN_VCCPAUX
#define XADC_REG_MIN_VCCO_DDR

#define XADC_REG_CONF0
#define XADC_REG_CONF1
#define XADC_REG_CONF2
#define XADC_REG_SEQ(x)
#define XADC_REG_INPUT_MODE(x)
#define XADC_REG_THRESHOLD(x)

#define XADC_REG_FLAG

#define XADC_CONF0_EC
#define XADC_CONF0_ACQ
#define XADC_CONF0_MUX
#define XADC_CONF0_CHAN(x)

#define XADC_CONF1_SEQ_MASK
#define XADC_CONF1_SEQ_DEFAULT
#define XADC_CONF1_SEQ_SINGLE_PASS
#define XADC_CONF1_SEQ_CONTINUOUS
#define XADC_CONF1_SEQ_SINGLE_CHANNEL
#define XADC_CONF1_SEQ_SIMULTANEOUS
#define XADC_CONF1_SEQ_INDEPENDENT
#define XADC_CONF1_ALARM_MASK

#define XADC_CONF2_DIV_MASK
#define XADC_CONF2_DIV_OFFSET

#define XADC_CONF2_PD_MASK
#define XADC_CONF2_PD_NONE
#define XADC_CONF2_PD_ADC_B
#define XADC_CONF2_PD_BOTH

#define XADC_ALARM_TEMP_MASK
#define XADC_ALARM_VCCINT_MASK
#define XADC_ALARM_VCCAUX_MASK
#define XADC_ALARM_OT_MASK
#define XADC_ALARM_VCCBRAM_MASK
#define XADC_ALARM_VCCPINT_MASK
#define XADC_ALARM_VCCPAUX_MASK
#define XADC_ALARM_VCCODDR_MASK

#define XADC_THRESHOLD_TEMP_MAX
#define XADC_THRESHOLD_VCCINT_MAX
#define XADC_THRESHOLD_VCCAUX_MAX
#define XADC_THRESHOLD_OT_MAX
#define XADC_THRESHOLD_TEMP_MIN
#define XADC_THRESHOLD_VCCINT_MIN
#define XADC_THRESHOLD_VCCAUX_MIN
#define XADC_THRESHOLD_OT_MIN
#define XADC_THRESHOLD_VCCBRAM_MAX
#define XADC_THRESHOLD_VCCPINT_MAX
#define XADC_THRESHOLD_VCCPAUX_MAX
#define XADC_THRESHOLD_VCCODDR_MAX
#define XADC_THRESHOLD_VCCBRAM_MIN
#define XADC_THRESHOLD_VCCPINT_MIN
#define XADC_THRESHOLD_VCCPAUX_MIN
#define XADC_THRESHOLD_VCCODDR_MIN

#endif