}
}
+void aml_spdifout_mute_without_actrl(
+ int index,
+ bool is_mute)
+{
+ unsigned int offset, reg;
+ int mute_lr = 0;
+
+ if (is_mute)
+ mute_lr = 0x3;
+
+ offset = EE_AUDIO_SPDIFOUT_B_CTRL0 - EE_AUDIO_SPDIFOUT_CTRL0;
+ reg = EE_AUDIO_SPDIFOUT_CTRL0 + offset * index;
+
+ audiobus_update_bits(reg, 0x3 << 21, mute_lr << 21);
+}
+
void aml_spdif_arb_config(struct aml_audio_controller *actrl)
{
/* config ddr arb */
reg = EE_AUDIO_SPDIFOUT_CTRL0 + offset * index;
aml_audiobus_update_bits(actrl,
reg,
- 0x1<<29|0x1<<28|0x3<<21|0x1<<20|0x1<<19|0xff<<4,
- 1<<29|1<<28|0x0<<21|0<<20|0<<19|0x3<<4);
+ 0x1<<29|0x1<<28|0x1<<20|0x1<<19|0xff<<4,
+ 1<<29|1<<28|0<<20|0<<19|0x3<<4);
offset = EE_AUDIO_SPDIFOUT_B_CTRL1 - EE_AUDIO_SPDIFOUT_CTRL1;
reg = EE_AUDIO_SPDIFOUT_CTRL1 + offset * index;
offset = EE_AUDIO_SPDIFOUT_B_CTRL0 - EE_AUDIO_SPDIFOUT_CTRL0;
reg = EE_AUDIO_SPDIFOUT_CTRL0 + offset * spdif_id;
audiobus_update_bits(reg,
- 0x3<<21|0x1<<20|0x1<<19|0xff<<4,
- 0x0<<21|0<<20|0<<19|chmask<<4);
+ 0x1<<20|0x1<<19|0xff<<4,
+ 0<<20|0<<19|chmask<<4);
offset = EE_AUDIO_SPDIFOUT_B_CTRL1 - EE_AUDIO_SPDIFOUT_CTRL1;
reg = EE_AUDIO_SPDIFOUT_CTRL1 + offset * spdif_id;
if (!is_enable) {
/* share buffer, spdif should be active, so mute it */
- audiobus_update_bits(reg, 0x3 << 21, 0x3 << 21);
+ /*audiobus_update_bits(reg, 0x3 << 21, 0x3 << 21);*/
return;
}
#include "tdm_hw.h"
#include "sharebuffer.h"
#include "vad.h"
+#include "spdif_hw.h"
/*#define __PTM_TDM_CLK__*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dev_info(substream->pcm->card->dev, "tdm playback enable\n");
aml_frddr_enable(p_tdm->fddr, 1);
+ aml_tdm_enable(p_tdm->actrl,
+ substream->stream, p_tdm->id, true);
+ udelay(100);
+ aml_tdm_mute_playback(p_tdm->actrl, p_tdm->id, false);
+ if (p_tdm->chipinfo
+ && p_tdm->chipinfo->same_src_fn
+ && (p_tdm->samesource_sel >= 0)
+ && (aml_check_sharebuffer_valid(p_tdm->fddr,
+ p_tdm->samesource_sel))) {
+ aml_spdifout_mute_without_actrl(0, false);
+ }
} else {
dev_info(substream->pcm->card->dev, "tdm capture enable\n");
aml_toddr_enable(p_tdm->tddr, 1);
+ aml_tdm_enable(p_tdm->actrl,
+ substream->stream, p_tdm->id, true);
}
- aml_tdm_enable(p_tdm->actrl,
- substream->stream, p_tdm->id, true);
-
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dev_info(substream->pcm->card->dev, "tdm playback stop\n");
aml_frddr_enable(p_tdm->fddr, 0);
+ aml_tdm_mute_playback(p_tdm->actrl, p_tdm->id, true);
+ if (p_tdm->chipinfo
+ && p_tdm->chipinfo->same_src_fn
+ && (p_tdm->samesource_sel >= 0)
+ && (aml_check_sharebuffer_valid(p_tdm->fddr,
+ p_tdm->samesource_sel))) {
+ aml_spdifout_mute_without_actrl(0, true);
+ }
} else {
dev_info(substream->pcm->card->dev, "tdm capture stop\n");
aml_toddr_enable(p_tdm->tddr, 0);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
pr_debug("tdm playback mute: %d\n", mute);
- aml_tdm_mute_playback(p_tdm->actrl, p_tdm->id, mute);
+ //aml_tdm_mute_playback(p_tdm->actrl, p_tdm->id, mute);
} else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
pr_debug("tdm capture mute: %d\n", mute);
aml_tdm_mute_capture(p_tdm->actrl, p_tdm->id, mute);