#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/gpio.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/workqueue.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <sound/uda1380.h>
#include "uda1380.h"
struct uda1380_priv { … };
static const u16 uda1380_reg[UDA1380_CACHEREGNUM] = …;
static unsigned long uda1380_cache_dirty;
static inline unsigned int uda1380_read_reg_cache(struct snd_soc_component *component,
unsigned int reg)
{ … }
static inline void uda1380_write_reg_cache(struct snd_soc_component *component,
u16 reg, unsigned int value)
{ … }
static int uda1380_write(struct snd_soc_component *component, unsigned int reg,
unsigned int value)
{ … }
static void uda1380_sync_cache(struct snd_soc_component *component)
{ … }
static int uda1380_reset(struct snd_soc_component *component)
{ … }
static void uda1380_flush_work(struct work_struct *work)
{ … }
static const char *uda1380_deemp[] = …;
static const char *uda1380_input_sel[] = …;
static const char *uda1380_output_sel[] = …;
static const char *uda1380_spf_mode[] = …;
static const char *uda1380_capture_sel[] = …;
static const char *uda1380_sel_ns[] = …;
static const char *uda1380_mix_control[] = …;
static const char *uda1380_sdet_setting[] = …;
static const char *uda1380_os_setting[] = …;
static const struct soc_enum uda1380_deemp_enum[] = …;
static SOC_ENUM_SINGLE_DECL(uda1380_input_sel_enum,
UDA1380_ADC, 2, uda1380_input_sel);
static SOC_ENUM_SINGLE_DECL(uda1380_output_sel_enum,
UDA1380_PM, 7, uda1380_output_sel);
static SOC_ENUM_SINGLE_DECL(uda1380_spf_enum,
UDA1380_MODE, 14, uda1380_spf_mode);
static SOC_ENUM_SINGLE_DECL(uda1380_capture_sel_enum,
UDA1380_IFACE, 6, uda1380_capture_sel);
static SOC_ENUM_SINGLE_DECL(uda1380_sel_ns_enum,
UDA1380_MIXER, 14, uda1380_sel_ns);
static SOC_ENUM_SINGLE_DECL(uda1380_mix_enum,
UDA1380_MIXER, 12, uda1380_mix_control);
static SOC_ENUM_SINGLE_DECL(uda1380_sdet_enum,
UDA1380_MIXER, 4, uda1380_sdet_setting);
static SOC_ENUM_SINGLE_DECL(uda1380_os_enum,
UDA1380_MIXER, 0, uda1380_os_setting);
static DECLARE_TLV_DB_SCALE(amix_tlv, -4950, 150, 1);
static const DECLARE_TLV_DB_RANGE(mvol_tlv,
0, 15, TLV_DB_SCALE_ITEM(-8200, 100, 1),
16, 43, TLV_DB_SCALE_ITEM(-6600, 50, 0),
44, 252, TLV_DB_SCALE_ITEM(-5200, 25, 0)
);
static const DECLARE_TLV_DB_RANGE(vc_tlv,
0, 7, TLV_DB_SCALE_ITEM(-7800, 150, 1),
8, 15, TLV_DB_SCALE_ITEM(-6600, 75, 0),
16, 43, TLV_DB_SCALE_ITEM(-6000, 50, 0),
44, 228, TLV_DB_SCALE_ITEM(-4600, 25, 0)
);
static DECLARE_TLV_DB_SCALE(tr_tlv, 0, 200, 0);
static DECLARE_TLV_DB_SCALE(bb_tlv, 0, 200, 0);
static DECLARE_TLV_DB_SCALE(dec_tlv, -6400, 50, 1);
static DECLARE_TLV_DB_SCALE(pga_tlv, 0, 300, 0);
static DECLARE_TLV_DB_SCALE(vga_tlv, 0, 200, 0);
static const struct snd_kcontrol_new uda1380_snd_controls[] = …;
static const struct snd_kcontrol_new uda1380_input_mux_control = …;
static const struct snd_kcontrol_new uda1380_output_mux_control = …;
static const struct snd_kcontrol_new uda1380_capture_mux_control = …;
static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = …;
static const struct snd_soc_dapm_route uda1380_dapm_routes[] = …;
static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int uda1380_set_dai_fmt_playback(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int uda1380_set_dai_fmt_capture(struct snd_soc_dai *codec_dai,
unsigned int fmt)
{ … }
static int uda1380_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int uda1380_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{ … }
#define UDA1380_RATES …
static const struct snd_soc_dai_ops uda1380_dai_ops = …;
static const struct snd_soc_dai_ops uda1380_dai_ops_playback = …;
static const struct snd_soc_dai_ops uda1380_dai_ops_capture = …;
static struct snd_soc_dai_driver uda1380_dai[] = …;
static int uda1380_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_component_driver soc_component_dev_uda1380 = …;
static int uda1380_i2c_probe(struct i2c_client *i2c)
{ … }
static const struct i2c_device_id uda1380_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, uda1380_i2c_id);
static const struct of_device_id uda1380_of_match[] = …;
MODULE_DEVICE_TABLE(of, uda1380_of_match);
static struct i2c_driver uda1380_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;