#include <asm/unaligned.h>
#include <linux/clk.h>
#include <linux/firmware.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#define PEB2466_NB_CHANNEL …
struct peb2466_lookup { … };
#define PEB2466_TLV_SIZE …
struct peb2466_lkup_ctrl { … };
struct peb2466 { … };
#define PEB2466_CMD_R …
#define PEB2466_CMD_W …
#define PEB2466_CMD_MASK …
#define PEB2466_CMD_XOP …
#define PEB2466_CMD_SOP …
#define PEB2466_CMD_COP …
#define PEB2466_CMD_COP1 …
#define PEB2466_MAKE_XOP(_lsel) …
#define PEB2466_MAKE_SOP(_ad, _lsel) …
#define PEB2466_MAKE_COP(_ad, _code) …
#define PEB2466_CR0(_ch) …
#define PEB2466_CR0_TH …
#define PEB2466_CR0_IMR1 …
#define PEB2466_CR0_FRX …
#define PEB2466_CR0_FRR …
#define PEB2466_CR0_AX …
#define PEB2466_CR0_AR …
#define PEB2466_CR0_THSEL_MASK …
#define PEB2466_CR0_THSEL(_set) …
#define PEB2466_CR1(_ch) …
#define PEB2466_CR1_ETG2 …
#define PEB2466_CR1_ETG1 …
#define PEB2466_CR1_PTG2 …
#define PEB2466_CR1_PTG1 …
#define PEB2466_CR1_LAW_MASK …
#define PEB2466_CR1_LAW_ALAW …
#define PEB2466_CR1_LAW_MULAW …
#define PEB2466_CR1_PU …
#define PEB2466_CR2(_ch) …
#define PEB2466_CR3(_ch) …
#define PEB2466_CR4(_ch) …
#define PEB2466_CR5(_ch) …
#define PEB2466_XR0 …
#define PEB2466_XR1 …
#define PEB2466_XR2 …
#define PEB2466_XR3 …
#define PEB2466_XR4 …
#define PEB2466_XR5 …
#define PEB2466_XR5_MCLK_1536 …
#define PEB2466_XR5_MCLK_2048 …
#define PEB2466_XR5_MCLK_4096 …
#define PEB2466_XR5_MCLK_8192 …
#define PEB2466_XR6 …
#define PEB2466_XR6_PCM_OFFSET(_off) …
#define PEB2466_XR7 …
#define PEB2466_TH_FILTER_P1(_ch) …
#define PEB2466_TH_FILTER_P2(_ch) …
#define PEB2466_TH_FILTER_P3(_ch) …
#define PEB2466_IMR1_FILTER_P1(_ch) …
#define PEB2466_IMR1_FILTER_P2(_ch) …
#define PEB2466_FRX_FILTER(_ch) …
#define PEB2466_FRR_FILTER(_ch) …
#define PEB2466_AX_FILTER(_ch) …
#define PEB2466_AR_FILTER(_ch) …
#define PEB2466_TG1(_ch) …
#define PEB2466_TG2(_ch) …
static int peb2466_write_byte(struct peb2466 *peb2466, u8 cmd, u8 val)
{ … }
static int peb2466_read_byte(struct peb2466 *peb2466, u8 cmd, u8 *val)
{ … }
static int peb2466_write_buf(struct peb2466 *peb2466, u8 cmd, const u8 *buf, unsigned int len)
{ … }
static int peb2466_reg_write(void *context, unsigned int reg, unsigned int val)
{ … }
static int peb2466_reg_read(void *context, unsigned int reg, unsigned int *val)
{ … }
static const struct regmap_config peb2466_regmap_config = …;
static int peb2466_lkup_ctrl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int peb2466_lkup_ctrl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int peb2466_lkup_ctrl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int peb2466_add_lkup_ctrl(struct snd_soc_component *component,
struct peb2466_lkup_ctrl *lkup_ctrl,
const char *name, int min_val, int step)
{ … }
enum peb2466_tone_freq { … };
static const u8 peb2466_tone_lookup[][4] = …;
static const char * const peb2466_tone_freq_txt[] = …;
static const struct soc_enum peb2466_tg_freq[][2] = …;
static int peb2466_tg_freq_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int peb2466_tg_freq_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new peb2466_ch0_out_mix_controls[] = …;
static const struct snd_kcontrol_new peb2466_ch1_out_mix_controls[] = …;
static const struct snd_kcontrol_new peb2466_ch2_out_mix_controls[] = …;
static const struct snd_kcontrol_new peb2466_ch3_out_mix_controls[] = …;
static const struct snd_kcontrol_new peb2466_controls[] = …;
static const struct snd_soc_dapm_widget peb2466_dapm_widgets[] = …;
static const struct snd_soc_dapm_route peb2466_dapm_routes[] = …;
static int peb2466_dai_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int width)
{ … }
static int peb2466_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ … }
static int peb2466_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static const unsigned int peb2466_sample_bits[] = …;
static struct snd_pcm_hw_constraint_list peb2466_sample_bits_constr = …;
static int peb2466_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static const u64 peb2466_dai_formats[] = …;
static const struct snd_soc_dai_ops peb2466_dai_ops = …;
static struct snd_soc_dai_driver peb2466_dai_driver = …;
static int peb2466_reset_audio(struct peb2466 *peb2466)
{ … }
static int peb2466_fw_parse_thfilter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static int peb2466_fw_parse_imr1filter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static int peb2466_fw_parse_frxfilter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static int peb2466_fw_parse_frrfilter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static int peb2466_fw_parse_axfilter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static int peb2466_fw_parse_arfilter(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static const char * const peb2466_ax_ctrl_names[] = …;
static int peb2466_fw_parse_axtable(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
static const char * const peb2466_ar_ctrl_names[] = …;
static int peb2466_fw_parse_artable(struct snd_soc_component *component,
u16 tag, u32 lng, const u8 *data)
{ … }
struct peb2466_fw_tag_def { … };
#define PEB2466_TAG_DEF_LNG_EQ(__tag, __lng, __parse) …
#define PEB2466_TAG_DEF_LNG_MIN(__tag, __lng_min, __parse) …
static const struct peb2466_fw_tag_def peb2466_fw_tag_defs[] = …;
static const struct peb2466_fw_tag_def *peb2466_fw_get_tag_def(u16 tag)
{ … }
static int peb2466_fw_parse(struct snd_soc_component *component,
const u8 *data, size_t size)
{ … }
static int peb2466_load_coeffs(struct snd_soc_component *component, const char *fw_name)
{ … }
static int peb2466_component_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver peb2466_component_driver = …;
static int peb2466_chip_gpio_offset_to_data_regmask(unsigned int offset,
unsigned int *xr_reg,
unsigned int *mask)
{ … }
static int peb2466_chip_gpio_offset_to_dir_regmask(unsigned int offset,
unsigned int *xr_reg,
unsigned int *mask)
{ … }
static unsigned int *peb2466_chip_gpio_get_cache(struct peb2466 *peb2466,
unsigned int xr_reg)
{ … }
static int peb2466_chip_gpio_update_bits(struct peb2466 *peb2466, unsigned int xr_reg,
unsigned int mask, unsigned int val)
{ … }
static void peb2466_chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
{ … }
static int peb2466_chip_gpio_get(struct gpio_chip *c, unsigned int offset)
{ … }
static int peb2466_chip_get_direction(struct gpio_chip *c, unsigned int offset)
{ … }
static int peb2466_chip_direction_input(struct gpio_chip *c, unsigned int offset)
{ … }
static int peb2466_chip_direction_output(struct gpio_chip *c, unsigned int offset, int val)
{ … }
static int peb2466_reset_gpio(struct peb2466 *peb2466)
{ … }
static int peb2466_gpio_init(struct peb2466 *peb2466)
{ … }
static int peb2466_spi_probe(struct spi_device *spi)
{ … }
static void peb2466_spi_remove(struct spi_device *spi)
{ … }
static const struct of_device_id peb2466_of_match[] = …;
MODULE_DEVICE_TABLE(of, peb2466_of_match);
static const struct spi_device_id peb2466_id_table[] = …;
MODULE_DEVICE_TABLE(spi, peb2466_id_table);
static struct spi_driver peb2466_spi_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;