#include <linux/dma-mapping.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/regulator/consumer.h>
#include "mt6357.h"
static void set_playback_gpio(struct mt6357_priv *priv, bool enable)
{ … }
static void set_capture_gpio(struct mt6357_priv *priv, bool enable)
{ … }
static void hp_main_output_ramp(struct mt6357_priv *priv, bool up)
{ … }
static void hp_aux_feedback_loop_gain_ramp(struct mt6357_priv *priv, bool up)
{ … }
static void hp_pull_down(struct mt6357_priv *priv, bool enable)
{ … }
static bool is_valid_hp_pga_idx(int reg_idx)
{ … }
static void volume_ramp(struct mt6357_priv *priv, int lfrom, int lto,
int rfrom, int rto, unsigned int reg_addr)
{ … }
static void lo_volume_ramp(struct mt6357_priv *priv, int lfrom, int lto, int rfrom, int rto)
{ … }
static void hp_volume_ramp(struct mt6357_priv *priv, int lfrom, int lto, int rfrom, int rto)
{ … }
static void hs_volume_ramp(struct mt6357_priv *priv, int from, int to)
{ … }
static const DECLARE_TLV_DB_SCALE(playback_tlv, -1000, 100, 0);
static const DECLARE_TLV_DB_SCALE(capture_tlv, 0, 600, 0);
static const DECLARE_TLV_DB_SCALE(hp_degain_tlv, -1200, 1200, 0);
static const struct snd_kcontrol_new mt6357_controls[] = …;
enum { … };
#define IS_DCC_BASE(type) …
static const char * const mic_type_mux_map[] = …;
static SOC_ENUM_SINGLE_DECL(mic_type_mux_map_enum, SND_SOC_NOPM,
0, mic_type_mux_map);
static const struct snd_kcontrol_new mic_type_mux_control = …;
static const char * const pga_mux_map[] = …;
static SOC_ENUM_SINGLE_DECL(pga_left_mux_map_enum,
MT6357_AUDENC_ANA_CON0,
MT6357_AUDPREAMPLINPUTSEL_SFT,
pga_mux_map);
static const struct snd_kcontrol_new pga_left_mux_control = …;
static SOC_ENUM_SINGLE_DECL(pga_right_mux_map_enum,
MT6357_AUDENC_ANA_CON1,
MT6357_AUDPREAMPRINPUTSEL_SFT,
pga_mux_map);
static const struct snd_kcontrol_new pga_right_mux_control = …;
static const char * const hslo_mux_map[] = …;
static SOC_ENUM_SINGLE_DECL(lo_mux_map_enum,
MT6357_AUDDEC_ANA_CON4,
MT6357_AUD_LOL_MUX_INPUT_VAUDP15_SFT,
hslo_mux_map);
static const struct snd_kcontrol_new lo_mux_control = …;
static SOC_ENUM_SINGLE_DECL(hs_mux_map_enum,
MT6357_AUDDEC_ANA_CON3,
MT6357_AUD_HS_MUX_INPUT_VAUDP15_SFT,
hslo_mux_map);
static const struct snd_kcontrol_new hs_mux_control = …;
static const char * const hplr_mux_map[] = …;
static SOC_ENUM_SINGLE_DECL(hpr_mux_map_enum,
MT6357_AUDDEC_ANA_CON0,
MT6357_AUD_HPR_MUX_INPUT_VAUDP15_SFT,
hplr_mux_map);
static const struct snd_kcontrol_new hpr_mux_control = …;
static SOC_ENUM_SINGLE_DECL(hpl_mux_map_enum,
MT6357_AUDDEC_ANA_CON0,
MT6357_AUD_HPL_MUX_INPUT_VAUDP15_SFT,
hplr_mux_map);
static const struct snd_kcontrol_new hpl_mux_control = …;
static const char * const dac_mux_map[] = …;
static SOC_ENUM_SINGLE_DECL(dac_mux_map_enum,
MT6357_AFE_TOP_CON0,
MT6357_DL_SINE_ON_SFT,
dac_mux_map);
static const struct snd_kcontrol_new dac_mux_control = …;
static int mt6357_set_dmic(struct mt6357_priv *priv, bool enable)
{ … }
static int mt6357_set_amic(struct mt6357_priv *priv, bool enable, unsigned int mic_type)
{ … }
static int mt6357_set_loopback(struct mt6357_priv *priv, bool enable)
{ … }
static int mt6357_set_ul_sine_gen(struct mt6357_priv *priv, bool enable)
{ … }
static int mt_aif_out_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int mt_adc_supply_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int mt_mic_type_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int mt_pga_left_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int mt_pga_right_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int adc_enable_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static void configure_downlinks(struct mt6357_priv *priv, bool enable)
{ … }
static int mt_audio_in_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int mt_delay_250_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int lo_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int hs_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int hp_main_mux_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int right_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
static int left_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{ … }
enum { … };
static const struct snd_soc_dapm_widget mt6357_dapm_widgets[] = …;
static const struct snd_soc_dapm_route mt6357_dapm_routes[] = …;
static struct snd_soc_dai_driver mtk_6357_dai_codecs[] = …;
static int mt6357_codec_probe(struct snd_soc_component *codec)
{ … }
static const struct snd_soc_component_driver mt6357_soc_component_driver = …;
static const u32 micbias_values[] = …;
static u32 mt6357_get_micbias_idx(struct device_node *np, const char *micbias)
{ … }
static int mt6357_parse_dt(struct mt6357_priv *priv)
{ … }
static int mt6357_platform_driver_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id mt6357_platform_ids[] = …;
MODULE_DEVICE_TABLE(platform, mt6357_platform_ids);
static struct platform_driver mt6357_platform_driver = …;
module_platform_driver(…) …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;