linux/drivers/iio/filter/admv8818.c

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

#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/units.h>

/* ADMV8818 Register Map */
#define ADMV8818_REG_SPI_CONFIG_A
#define ADMV8818_REG_SPI_CONFIG_B
#define ADMV8818_REG_CHIPTYPE
#define ADMV8818_REG_PRODUCT_ID_L
#define ADMV8818_REG_PRODUCT_ID_H
#define ADMV8818_REG_FAST_LATCH_POINTER
#define ADMV8818_REG_FAST_LATCH_STOP
#define ADMV8818_REG_FAST_LATCH_START
#define ADMV8818_REG_FAST_LATCH_DIRECTION
#define ADMV8818_REG_FAST_LATCH_STATE
#define ADMV8818_REG_WR0_SW
#define ADMV8818_REG_WR0_FILTER
#define ADMV8818_REG_WR1_SW
#define ADMV8818_REG_WR1_FILTER
#define ADMV8818_REG_WR2_SW
#define ADMV8818_REG_WR2_FILTER
#define ADMV8818_REG_WR3_SW
#define ADMV8818_REG_WR3_FILTER
#define ADMV8818_REG_WR4_SW
#define ADMV8818_REG_WR4_FILTER
#define ADMV8818_REG_LUT0_SW
#define ADMV8818_REG_LUT0_FILTER
#define ADMV8818_REG_LUT127_SW
#define ADMV8818_REG_LUT127_FILTER

/* ADMV8818_REG_SPI_CONFIG_A Map */
#define ADMV8818_SOFTRESET_N_MSK
#define ADMV8818_LSB_FIRST_N_MSK
#define ADMV8818_ENDIAN_N_MSK
#define ADMV8818_SDOACTIVE_N_MSK
#define ADMV8818_SDOACTIVE_MSK
#define ADMV8818_ENDIAN_MSK
#define ADMV8818_LSBFIRST_MSK
#define ADMV8818_SOFTRESET_MSK

/* ADMV8818_REG_SPI_CONFIG_B Map */
#define ADMV8818_SINGLE_INSTRUCTION_MSK
#define ADMV8818_CSB_STALL_MSK
#define ADMV8818_MASTER_SLAVE_RB_MSK
#define ADMV8818_MASTER_SLAVE_TRANSFER_MSK

/* ADMV8818_REG_WR0_SW Map */
#define ADMV8818_SW_IN_SET_WR0_MSK
#define ADMV8818_SW_OUT_SET_WR0_MSK
#define ADMV8818_SW_IN_WR0_MSK
#define ADMV8818_SW_OUT_WR0_MSK

/* ADMV8818_REG_WR0_FILTER Map */
#define ADMV8818_HPF_WR0_MSK
#define ADMV8818_LPF_WR0_MSK

enum {};

enum {};

struct admv8818_state {};

static const unsigned long long freq_range_hpf[4][2] =;

static const unsigned long long freq_range_lpf[4][2] =;

static const struct regmap_config admv8818_regmap_config =;

static const char * const admv8818_modes[] =;

static int __admv8818_hpf_select(struct admv8818_state *st, u64 freq)
{}

static int admv8818_hpf_select(struct admv8818_state *st, u64 freq)
{}

static int __admv8818_lpf_select(struct admv8818_state *st, u64 freq)
{}

static int admv8818_lpf_select(struct admv8818_state *st, u64 freq)
{}

static int admv8818_rfin_band_select(struct admv8818_state *st)
{}

static int __admv8818_read_hpf_freq(struct admv8818_state *st, u64 *hpf_freq)
{}

static int admv8818_read_hpf_freq(struct admv8818_state *st, u64 *hpf_freq)
{}

static int __admv8818_read_lpf_freq(struct admv8818_state *st, u64 *lpf_freq)
{}

static int admv8818_read_lpf_freq(struct admv8818_state *st, u64 *lpf_freq)
{}

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

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

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

static int admv8818_filter_bypass(struct admv8818_state *st)
{}

static int admv8818_get_mode(struct iio_dev *indio_dev,
			     const struct iio_chan_spec *chan)
{}

static int admv8818_set_mode(struct iio_dev *indio_dev,
			     const struct iio_chan_spec *chan,
			     unsigned int mode)
{}

static const struct iio_info admv8818_info =;

static const struct iio_enum admv8818_mode_enum =;

static const struct iio_chan_spec_ext_info admv8818_ext_info[] =;

#define ADMV8818_CHAN(_channel)

#define ADMV8818_CHAN_BW_CF(_channel, _admv8818_ext_info)

static const struct iio_chan_spec admv8818_channels[] =;

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

static void admv8818_clk_notifier_unreg(void *data)
{}

static void admv8818_clk_disable(void *data)
{}

static int admv8818_init(struct admv8818_state *st)
{}

static int admv8818_clk_setup(struct admv8818_state *st)
{}

static int admv8818_probe(struct spi_device *spi)
{}

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

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

static struct spi_driver admv8818_driver =;
module_spi_driver();

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