#include <linux/bitrev.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#define IDT821034_NB_CHANNEL …
struct idt821034_amp { … };
struct idt821034 { … };
static int idt821034_8bit_write(struct idt821034 *idt821034, u8 val)
{ … }
static int idt821034_2x8bit_write(struct idt821034 *idt821034, u8 val1, u8 val2)
{ … }
static int idt821034_8bit_read(struct idt821034 *idt821034, u8 valw, u8 *valr)
{ … }
#define IDT821034_MODE_CODEC(_ch) …
#define IDT821034_MODE_SLIC(_ch) …
#define IDT821034_MODE_GAIN(_ch) …
#define IDT821034_CONF_PWRUP_TX …
#define IDT821034_CONF_PWRUP_RX …
static int idt821034_set_channel_power(struct idt821034 *idt821034, u8 ch, u8 power)
{ … }
static u8 idt821034_get_channel_power(struct idt821034 *idt821034, u8 ch)
{ … }
#define IDT821034_CONF_ALAW_MODE …
#define IDT821034_CONF_DELAY_MODE …
static int idt821034_set_codec_conf(struct idt821034 *idt821034, u8 codec_conf)
{ … }
static u8 idt821034_get_codec_conf(struct idt821034 *idt821034)
{ … }
#define IDT821034_CH_RX …
#define IDT821034_CH_TX …
static int idt821034_set_channel_ts(struct idt821034 *idt821034, u8 ch, u8 ch_dir, u8 ts_num)
{ … }
#define IDT821034_SLIC_IO1_IN …
#define IDT821034_SLIC_IO0_IN …
static int idt821034_set_slic_conf(struct idt821034 *idt821034, u8 ch, u8 slic_dir)
{ … }
static u8 idt821034_get_slic_conf(struct idt821034 *idt821034, u8 ch)
{ … }
static int idt821034_write_slic_raw(struct idt821034 *idt821034, u8 ch, u8 slic_raw)
{ … }
static u8 idt821034_get_written_slic_raw(struct idt821034 *idt821034, u8 ch)
{ … }
static int idt821034_read_slic_raw(struct idt821034 *idt821034, u8 ch, u8 *slic_raw)
{ … }
#define IDT821034_GAIN_RX …
#define IDT821034_GAIN_TX …
static int idt821034_set_gain_channel(struct idt821034 *idt821034, u8 ch,
u8 gain_type, u16 gain_val)
{ … }
#define IDT821034_DIR_OUT …
#define IDT821034_DIR_IN …
#define IDT821034_ID(_ch, _dir) …
#define IDT821034_ID_OUT(_ch) …
#define IDT821034_ID_IN(_ch) …
#define IDT821034_ID_GET_CHAN(_id) …
#define IDT821034_ID_GET_DIR(_id) …
#define IDT821034_ID_IS_OUT(_id) …
static int idt821034_kctrl_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int idt821034_kctrl_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int idt821034_kctrl_mute_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int idt821034_kctrl_mute_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_in, -6520, 1306);
#define IDT821034_GAIN_IN_MIN_RAW …
#define IDT821034_GAIN_IN_MAX_RAW …
#define IDT821034_GAIN_IN_INIT_RAW …
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_out, -6798, 1029);
#define IDT821034_GAIN_OUT_MIN_RAW …
#define IDT821034_GAIN_OUT_MAX_RAW …
#define IDT821034_GAIN_OUT_INIT_RAW …
static const struct snd_kcontrol_new idt821034_controls[] = …;
static int idt821034_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static const struct snd_soc_dapm_widget idt821034_dapm_widgets[] = …;
static const struct snd_soc_dapm_route idt821034_dapm_routes[] = …;
static int idt821034_dai_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int width)
{ … }
static int idt821034_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int idt821034_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static const unsigned int idt821034_sample_bits[] = …;
static struct snd_pcm_hw_constraint_list idt821034_sample_bits_constr = …;
static int idt821034_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static const u64 idt821034_dai_formats[] = …;
static const struct snd_soc_dai_ops idt821034_dai_ops = …;
static struct snd_soc_dai_driver idt821034_dai_driver = …;
static int idt821034_reset_audio(struct idt821034 *idt821034)
{ … }
static int idt821034_component_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver idt821034_component_driver = …;
#define IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(_offset) …
#define IDT821034_GPIO_OFFSET_TO_SLIC_MASK(_offset) …
static void idt821034_chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
{ … }
static int idt821034_chip_gpio_get(struct gpio_chip *c, unsigned int offset)
{ … }
static int idt821034_chip_get_direction(struct gpio_chip *c, unsigned int offset)
{ … }
static int idt821034_chip_direction_input(struct gpio_chip *c, unsigned int offset)
{ … }
static int idt821034_chip_direction_output(struct gpio_chip *c, unsigned int offset, int val)
{ … }
static int idt821034_reset_gpio(struct idt821034 *idt821034)
{ … }
static int idt821034_gpio_init(struct idt821034 *idt821034)
{ … }
static int idt821034_spi_probe(struct spi_device *spi)
{ … }
static const struct of_device_id idt821034_of_match[] = …;
MODULE_DEVICE_TABLE(of, idt821034_of_match);
static const struct spi_device_id idt821034_id_table[] = …;
MODULE_DEVICE_TABLE(spi, idt821034_id_table);
static struct spi_driver idt821034_spi_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;