mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
odroid-common:Matching the mixer control with alsa-util
Change-Id: I276e86be72f8bd00215b540e4c312ba5a4a1706c
This commit is contained in:
@@ -404,6 +404,8 @@ static int aml_dai_tdm_prepare(struct snd_pcm_substream *substream,
|
||||
i2s_to_hdmitx_ctrl(p_tdm->id);
|
||||
aout_notifier_call_chain(AOUT_EVENT_IEC_60958_PCM,
|
||||
substream);
|
||||
} else {
|
||||
i2s_to_hdmitx_disable();
|
||||
}
|
||||
|
||||
fifo_id = aml_frddr_get_fifo_id(fr);
|
||||
|
||||
@@ -694,6 +694,10 @@ void i2s_to_hdmitx_ctrl(int tdm_index)
|
||||
);
|
||||
}
|
||||
|
||||
void i2s_to_hdmitx_disable(void)
|
||||
{
|
||||
audiobus_write(EE_AUDIO_TOHDMITX_CTRL0, 0);
|
||||
}
|
||||
void aml_tdm_mute_playback(
|
||||
struct aml_audio_controller *actrl,
|
||||
int tdm_index,
|
||||
|
||||
@@ -142,6 +142,7 @@ extern void aml_tdm_clk_pad_select(
|
||||
int tdm_index, int clk_sel);
|
||||
|
||||
extern void i2s_to_hdmitx_ctrl(int tdm_index);
|
||||
extern void i2s_to_hdmitx_disable(void);
|
||||
void aml_tdm_mute_playback(
|
||||
struct aml_audio_controller *actrl,
|
||||
int index,
|
||||
|
||||
@@ -56,7 +56,7 @@ struct aml_T9015_audio_priv {
|
||||
};
|
||||
|
||||
static const struct reg_default t9015_init_list[] = {
|
||||
{AUDIO_CONFIG_BLOCK_ENABLE, 0x0000300F},
|
||||
{AUDIO_CONFIG_BLOCK_ENABLE, 0x00000000},
|
||||
{ADC_VOL_CTR_PGA_IN_CONFIG, 0x00000000},
|
||||
{DAC_VOL_CTR_DAC_SOFT_MUTE, 0xFEFE0000},
|
||||
{LINE_OUT_CONFIG, 0x00001111},
|
||||
@@ -202,15 +202,15 @@ static const struct snd_soc_dapm_widget T9015_audio_dapm_widgets[] = {
|
||||
|
||||
/*DAC playback stream */
|
||||
SND_SOC_DAPM_DAC("Left DAC", "HIFI Playback",
|
||||
AUDIO_CONFIG_BLOCK_ENABLE,
|
||||
DACL_EN, 0),
|
||||
SND_SOC_NOPM,
|
||||
0, 0),
|
||||
SND_SOC_DAPM_DAC("Right DAC", "HIFI Playback",
|
||||
AUDIO_CONFIG_BLOCK_ENABLE,
|
||||
DACR_EN, 0),
|
||||
SND_SOC_NOPM,
|
||||
0, 0),
|
||||
|
||||
/*DRV output */
|
||||
SND_SOC_DAPM_OUT_DRV("LOLP_OUT_EN", AUDIO_CONFIG_BLOCK_ENABLE,
|
||||
VMID_GEN_EN, 0, NULL, 0),
|
||||
SND_SOC_DAPM_OUT_DRV("LOLP_OUT_EN", SND_SOC_NOPM,
|
||||
0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_OUT_DRV("LOLN_OUT_EN", SND_SOC_NOPM,
|
||||
0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_OUT_DRV("LORP_OUT_EN", SND_SOC_NOPM,
|
||||
@@ -293,6 +293,7 @@ static int aml_T9015_hw_params(struct snd_pcm_substream *substream,
|
||||
snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
T9015_audio->params = params;
|
||||
auge_toacodec_ctrl(T9015_audio->tdmout_index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -300,6 +301,20 @@ static int aml_T9015_hw_params(struct snd_pcm_substream *substream,
|
||||
static int aml_T9015_audio_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
u32 value = snd_soc_read(codec, AUDIO_CONFIG_BLOCK_ENABLE);
|
||||
bool Vmid_eanble = (bool)((value >> VMID_GEN_EN) & 0x1);
|
||||
|
||||
if (!Vmid_eanble) {
|
||||
value &= ~(0x1 << VMID_GEN_EN);
|
||||
snd_soc_write(codec, AUDIO_CONFIG_BLOCK_ENABLE, value);
|
||||
msleep(20);
|
||||
value |= 0x1 << VMID_GEN_EN;
|
||||
value |= 0x1 << BIAS_CURRENT_EN;
|
||||
value |= 0x1 << REFP_BUF_EN;
|
||||
value |= 0x3F;
|
||||
snd_soc_write(codec, AUDIO_CONFIG_BLOCK_ENABLE, value);
|
||||
}
|
||||
|
||||
switch (level) {
|
||||
case SND_SOC_BIAS_ON:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user