#include <linux/bitfield.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/units.h>
#include <asm/unaligned.h>
#define ADMV4420_SPI_CONFIG_1 …
#define ADMV4420_SPI_CONFIG_2 …
#define ADMV4420_CHIPTYPE …
#define ADMV4420_PRODUCT_ID_L …
#define ADMV4420_PRODUCT_ID_H …
#define ADMV4420_SCRATCHPAD …
#define ADMV4420_SPI_REV …
#define ADMV4420_ENABLES …
#define ADMV4420_SDO_LEVEL …
#define ADMV4420_INT_L …
#define ADMV4420_INT_H …
#define ADMV4420_FRAC_L …
#define ADMV4420_FRAC_M …
#define ADMV4420_FRAC_H …
#define ADMV4420_MOD_L …
#define ADMV4420_MOD_M …
#define ADMV4420_MOD_H …
#define ADMV4420_R_DIV_L …
#define ADMV4420_R_DIV_H …
#define ADMV4420_REFERENCE …
#define ADMV4420_VCO_DATA_READBACK1 …
#define ADMV4420_VCO_DATA_READBACK2 …
#define ADMV4420_PLL_MUX_SEL …
#define ADMV4420_LOCK_DETECT …
#define ADMV4420_BAND_SELECT …
#define ADMV4420_VCO_ALC_TIMEOUT …
#define ADMV4420_VCO_MANUAL …
#define ADMV4420_ALC …
#define ADMV4420_VCO_TIMEOUT1 …
#define ADMV4420_VCO_TIMEOUT2 …
#define ADMV4420_VCO_BAND_DIV …
#define ADMV4420_VCO_READBACK_SEL …
#define ADMV4420_AUTOCAL …
#define ADMV4420_CP_STATE …
#define ADMV4420_CP_BLEED_EN …
#define ADMV4420_CP_CURRENT …
#define ADMV4420_CP_BLEED …
#define ADMV4420_SPI_CONFIG_1_SDOACTIVE …
#define ADMV4420_SPI_CONFIG_1_ENDIAN …
#define ADMV4420_SPI_CONFIG_1_SOFTRESET …
#define ADMV4420_REFERENCE_DIVIDE_BY_2_MASK …
#define ADMV4420_REFERENCE_MODE_MASK …
#define ADMV4420_REFERENCE_DOUBLER_MASK …
#define ADMV4420_REF_DIVIDER_MAX_VAL …
#define ADMV4420_N_COUNTER_INT_MAX …
#define ADMV4420_N_COUNTER_FRAC_MAX …
#define ADMV4420_N_COUNTER_MOD_MAX …
#define ENABLE_PLL …
#define ENABLE_LO …
#define ENABLE_VCO …
#define ENABLE_IFAMP …
#define ENABLE_MIXER …
#define ENABLE_LNA …
#define ADMV4420_SCRATCH_PAD_VAL_1 …
#define ADMV4420_SCRATCH_PAD_VAL_2 …
#define ADMV4420_REF_FREQ_HZ …
#define MAX_N_COUNTER …
#define MAX_R_DIVIDER …
#define ADMV4420_DEFAULT_LO_FREQ_HZ …
enum admv4420_mux_sel { … };
struct admv4420_reference_block { … };
struct admv4420_n_counter { … };
struct admv4420_state { … };
static const struct regmap_config admv4420_regmap_config = …;
static int admv4420_reg_access(struct iio_dev *indio_dev,
u32 reg, u32 writeval,
u32 *readval)
{ … }
static int admv4420_set_n_counter(struct admv4420_state *st, u32 int_val,
u32 frac_val, u32 mod_val)
{ … }
static int admv4420_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long info)
{ … }
static const struct iio_info admv4420_info = …;
static const struct iio_chan_spec admv4420_channels[] = …;
static void admv4420_fw_parse(struct admv4420_state *st)
{ … }
static inline uint64_t admv4420_calc_pfd_vco(struct admv4420_state *st)
{ … }
static inline uint32_t admv4420_calc_pfd_ref(struct admv4420_state *st)
{ … }
static int admv4420_calc_parameters(struct admv4420_state *st)
{ … }
static int admv4420_setup(struct iio_dev *indio_dev)
{ … }
static int admv4420_probe(struct spi_device *spi)
{ … }
static const struct of_device_id admv4420_of_match[] = …;
MODULE_DEVICE_TABLE(of, admv4420_of_match);
static struct spi_driver admv4420_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;