linux/drivers/iio/frequency/admv1014.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ADMV1014 driver
 *
 * Copyright 2022 Analog Devices Inc.
 */

#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/device.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/notifier.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <linux/units.h>

#include <linux/unaligned.h>

/* ADMV1014 Register Map */
#define ADMV1014_REG_SPI_CONTROL
#define ADMV1014_REG_ALARM
#define ADMV1014_REG_ALARM_MASKS
#define ADMV1014_REG_ENABLE
#define ADMV1014_REG_QUAD
#define ADMV1014_REG_LO_AMP_PHASE_ADJUST1
#define ADMV1014_REG_MIXER
#define ADMV1014_REG_IF_AMP
#define ADMV1014_REG_IF_AMP_BB_AMP
#define ADMV1014_REG_BB_AMP_AGC
#define ADMV1014_REG_VVA_TEMP_COMP

/* ADMV1014_REG_SPI_CONTROL Map */
#define ADMV1014_PARITY_EN_MSK
#define ADMV1014_SPI_SOFT_RESET_MSK
#define ADMV1014_CHIP_ID_MSK
#define ADMV1014_CHIP_ID
#define ADMV1014_REVISION_ID_MSK

/* ADMV1014_REG_ALARM Map */
#define ADMV1014_PARITY_ERROR_MSK
#define ADMV1014_TOO_FEW_ERRORS_MSK
#define ADMV1014_TOO_MANY_ERRORS_MSK
#define ADMV1014_ADDRESS_RANGE_ERROR_MSK

/* ADMV1014_REG_ENABLE Map */
#define ADMV1014_IBIAS_PD_MSK
#define ADMV1014_P1DB_COMPENSATION_MSK
#define ADMV1014_IF_AMP_PD_MSK
#define ADMV1014_QUAD_BG_PD_MSK
#define ADMV1014_BB_AMP_PD_MSK
#define ADMV1014_QUAD_IBIAS_PD_MSK
#define ADMV1014_DET_EN_MSK
#define ADMV1014_BG_PD_MSK

/* ADMV1014_REG_QUAD Map */
#define ADMV1014_QUAD_SE_MODE_MSK
#define ADMV1014_QUAD_FILTERS_MSK

/* ADMV1014_REG_LO_AMP_PHASE_ADJUST1 Map */
#define ADMV1014_LOAMP_PH_ADJ_I_FINE_MSK
#define ADMV1014_LOAMP_PH_ADJ_Q_FINE_MSK

/* ADMV1014_REG_MIXER Map */
#define ADMV1014_MIXER_VGATE_MSK
#define ADMV1014_DET_PROG_MSK

/* ADMV1014_REG_IF_AMP Map */
#define ADMV1014_IF_AMP_COARSE_GAIN_I_MSK
#define ADMV1014_IF_AMP_FINE_GAIN_Q_MSK
#define ADMV1014_IF_AMP_FINE_GAIN_I_MSK

/* ADMV1014_REG_IF_AMP_BB_AMP Map */
#define ADMV1014_IF_AMP_COARSE_GAIN_Q_MSK
#define ADMV1014_BB_AMP_OFFSET_Q_MSK
#define ADMV1014_BB_AMP_OFFSET_I_MSK

/* ADMV1014_REG_BB_AMP_AGC Map */
#define ADMV1014_BB_AMP_REF_GEN_MSK
#define ADMV1014_BB_AMP_GAIN_CTRL_MSK
#define ADMV1014_BB_SWITCH_HIGH_LOW_CM_MSK

/* ADMV1014_REG_VVA_TEMP_COMP Map */
#define ADMV1014_VVA_TEMP_COMP_MSK

/* ADMV1014 Miscellaneous Defines */
#define ADMV1014_READ
#define ADMV1014_REG_ADDR_READ_MSK
#define ADMV1014_REG_ADDR_WRITE_MSK
#define ADMV1014_REG_DATA_MSK
#define ADMV1014_NUM_REGULATORS

enum {};

enum {};

enum {};

static const int detector_table[] =;

static const char * const input_mode_names[] =;

static const char * const quad_se_mode_names[] =;

struct admv1014_state {};

static const int mixer_vgate_table[] =;

static int __admv1014_spi_read(struct admv1014_state *st, unsigned int reg,
			       unsigned int *val)
{}

static int admv1014_spi_read(struct admv1014_state *st, unsigned int reg,
			     unsigned int *val)
{}

static int __admv1014_spi_write(struct admv1014_state *st,
				unsigned int reg,
				unsigned int val)
{}

static int admv1014_spi_write(struct admv1014_state *st, unsigned int reg,
			      unsigned int val)
{}

static int __admv1014_spi_update_bits(struct admv1014_state *st, unsigned int reg,
				      unsigned int mask, unsigned int val)
{}

static int admv1014_spi_update_bits(struct admv1014_state *st, unsigned int reg,
				    unsigned int mask, unsigned int val)
{}

static int admv1014_update_quad_filters(struct admv1014_state *st)
{}

static int admv1014_update_vcm_settings(struct admv1014_state *st)
{}

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

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

static ssize_t admv1014_read(struct iio_dev *indio_dev,
			     uintptr_t private,
			     const struct iio_chan_spec *chan,
			     char *buf)
{}

static ssize_t admv1014_write(struct iio_dev *indio_dev,
			      uintptr_t private,
			      const struct iio_chan_spec *chan,
			      const char *buf, size_t len)
{}

static int admv1014_read_avail(struct iio_dev *indio_dev,
			       struct iio_chan_spec const *chan,
			       const int **vals, int *type, int *length,
			       long info)
{}

static int admv1014_reg_access(struct iio_dev *indio_dev,
			       unsigned int reg,
			       unsigned int write_val,
			       unsigned int *read_val)
{}

static const struct iio_info admv1014_info =;

static const char * const admv1014_reg_name[] =;

static int admv1014_freq_change(struct notifier_block *nb, unsigned long action, void *data)
{}

#define _ADMV1014_EXT_INFO(_name, _shared, _ident)

static const struct iio_chan_spec_ext_info admv1014_ext_info[] =;

#define ADMV1014_CHAN_IQ(_channel, rf_comp)

#define ADMV1014_CHAN_IF(_channel, rf_comp)

#define ADMV1014_CHAN_POWER(_channel)

#define ADMV1014_CHAN_CALIBSCALE(_channel, rf_comp, _admv1014_ext_info)

static const struct iio_chan_spec admv1014_channels_iq[] =;

static const struct iio_chan_spec admv1014_channels_if[] =;

static void admv1014_clk_disable(void *data)
{}

static void admv1014_reg_disable(void *data)
{}

static void admv1014_powerdown(void *data)
{}

static int admv1014_init(struct admv1014_state *st)
{}

static int admv1014_properties_parse(struct admv1014_state *st)
{}

static int admv1014_probe(struct spi_device *spi)
{}

static const struct spi_device_id admv1014_id[] =;
MODULE_DEVICE_TABLE(spi, admv1014_id);

static const struct of_device_id admv1014_of_match[] =;
MODULE_DEVICE_TABLE(of, admv1014_of_match);

static struct spi_driver admv1014_driver =;
module_spi_driver();

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