#include <asm/unaligned.h>
#include <linux/firmware.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
#include <linux/regmap.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include "pcm6240.h"
static const struct i2c_device_id pcmdevice_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, pcmdevice_i2c_id);
static const char *const pcmdev_ctrl_name[] = …;
static const struct pcmdevice_mixer_control adc5120_analog_gain_ctl[] = …;
static const struct pcmdevice_mixer_control adc5120_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm1690_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm6240_analog_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm6240_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm6260_analog_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm6260_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcm9211_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcmd3140_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcmd3140_fine_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcmd3180_digi_gain_ctl[] = …;
static const struct pcmdevice_mixer_control pcmd3180_fine_gain_ctl[] = …;
static const struct pcmdevice_mixer_control taa5412_digi_vol_ctl[] = …;
static const struct pcmdevice_mixer_control taa5412_fine_gain_ctl[] = …;
static const DECLARE_TLV_DB_MINMAX_MUTE(pcmd3140_dig_gain_tlv,
-10000, 2700);
static const DECLARE_TLV_DB_MINMAX_MUTE(pcm1690_fine_dig_gain_tlv,
-12750, 0);
static const DECLARE_TLV_DB_MINMAX_MUTE(pcm1690_dig_gain_tlv,
-25500, 0);
static const DECLARE_TLV_DB_MINMAX_MUTE(pcm9211_dig_gain_tlv,
-11450, 2000);
static const DECLARE_TLV_DB_MINMAX_MUTE(adc5120_fgain_tlv,
-10050, 2700);
static const DECLARE_TLV_DB_LINEAR(adc5120_chgain_tlv, 0, 4200);
static const DECLARE_TLV_DB_MINMAX_MUTE(pcm6260_fgain_tlv,
-10000, 2700);
static const DECLARE_TLV_DB_LINEAR(pcm6260_chgain_tlv, 0, 4200);
static const DECLARE_TLV_DB_MINMAX_MUTE(taa5412_dig_vol_tlv,
-8050, 4700);
static const DECLARE_TLV_DB_LINEAR(taa5412_fine_gain_tlv,
-80, 70);
static int pcmdev_change_dev(struct pcmdevice_priv *pcm_priv,
unsigned short dev_no)
{ … }
static int pcmdev_dev_read(struct pcmdevice_priv *pcm_dev,
unsigned int dev_no, unsigned int reg, unsigned int *val)
{ … }
static int pcmdev_dev_update_bits(struct pcmdevice_priv *pcm_dev,
unsigned int dev_no, unsigned int reg, unsigned int mask,
unsigned int value)
{ … }
static int pcmdev_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol, int vol_ctrl_type)
{ … }
static int pcmdevice_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcm1690_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcm1690_get_finevolsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcmdev_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol, int vol_ctrl_type)
{ … }
static int pcmdevice_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcm1690_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcm1690_put_finevolsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct pcmdev_ctrl_info pcmdev_gain_ctl_info[][2] = …;
static int pcmdev_dev_bulk_write(struct pcmdevice_priv *pcm_dev,
unsigned int dev_no, unsigned int reg, unsigned char *data,
unsigned int len)
{ … }
static int pcmdev_dev_write(struct pcmdevice_priv *pcm_dev,
unsigned int dev_no, unsigned int reg, unsigned int value)
{ … }
static int pcmdevice_info_profile(
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int pcmdevice_get_profile_id(
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcmdevice_set_profile_id(
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int pcmdevice_info_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static void pcm9211_sw_rst(struct pcmdevice_priv *pcm_dev)
{ … }
static void pcmdevice_sw_rst(struct pcmdevice_priv *pcm_dev)
{ … }
static struct pcmdevice_config_info *pcmdevice_add_config(void *ctxt,
const unsigned char *config_data, unsigned int config_size,
int *status)
{ … }
static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev,
int dev_no, int ctl_id)
{ … }
static int pcmdev_profile_ctrl_add(struct pcmdevice_priv *pcm_dev)
{ … }
static void pcmdevice_config_info_remove(void *ctxt)
{ … }
static int pcmdev_regbin_ready(const struct firmware *fmw, void *ctxt)
{ … }
static int pcmdevice_comp_probe(struct snd_soc_component *comp)
{ … }
static void pcmdevice_comp_remove(struct snd_soc_component *codec)
{ … }
static const struct snd_soc_dapm_widget pcmdevice_dapm_widgets[] = …;
static const struct snd_soc_dapm_route pcmdevice_audio_map[] = …;
static const struct snd_soc_component_driver
soc_codec_driver_pcmdevice = …;
static int pcmdev_single_byte_wr(struct pcmdevice_priv *pcm_dev,
unsigned char *data, int devn, int sublocksize)
{ … }
static int pcmdev_burst_wr(struct pcmdevice_priv *pcm_dev,
unsigned char *data, int devn, int sublocksize)
{ … }
static int pcmdev_delay(struct pcmdevice_priv *pcm_dev,
unsigned char *data, int devn, int sublocksize)
{ … }
static int pcmdev_bits_wr(struct pcmdevice_priv *pcm_dev,
unsigned char *data, int devn, int sublocksize)
{ … }
static int pcmdevice_process_block(void *ctxt, unsigned char *data,
unsigned char dev_idx, int sublocksize)
{ … }
static void pcmdevice_select_cfg_blk(void *ctxt, int conf_no,
unsigned char block_type)
{ … }
static int pcmdevice_mute(struct snd_soc_dai *dai, int mute, int stream)
{ … }
static int pcmdevice_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops pcmdevice_dai_ops = …;
static struct snd_soc_dai_driver pcmdevice_dai_driver[] = …;
#ifdef CONFIG_OF
static const struct of_device_id pcmdevice_of_match[] = …;
MODULE_DEVICE_TABLE(of, pcmdevice_of_match);
#endif
static const struct regmap_range_cfg pcmdevice_ranges[] = …;
static const struct regmap_config pcmdevice_i2c_regmap = …;
static void pcmdevice_remove(struct pcmdevice_priv *pcm_dev)
{ … }
static char *str_to_upper(char *str)
{ … }
static int pcmdevice_i2c_probe(struct i2c_client *i2c)
{ … }
static void pcmdevice_i2c_remove(struct i2c_client *i2c)
{ … }
static struct i2c_driver pcmdevice_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;