sound-dai = <&dummy_codec>;
};
};
- /*
- * dai link for i2s to hdmix,
- * Notice to select a tdm lane not used by hw
- */
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
pinctrl-0 = <&tdmc_mclk &tdmout_c &tdmin_c>;
};
- /* copy a useless tdm to output for hdmi, no pinmux */
- aml_i2s2hdmi: i2s2hdmi {
- compatible = "amlogic, g12a-snd-tdmc";
- #sound-dai-cells = <0>;
- dai-tdm-lane-slot-mask-out = <1 1 1 1>;
- dai-tdm-clk-sel = <2>;
- clocks = <&clkaudio CLKID_AUDIO_MCLK_C
- &clkc CLKID_MPLL2>;
- clock-names = "mclk", "clk_srcpll";
-
- i2s2hdmi = <1>;
-
- status = "okay";
- };
aml_spdif: spdif {
compatible = "amlogic, g12a-snd-spdif-a";
aml-audio-card,dai-link@4 {
mclk-fs = <128>;
- //continuous-clock;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdif";
+ suffix-name = "alsaPORT-spdifb2hdmi";
cpu {
sound-dai = <&aml_spdif>;
system-clock-frequency = <6144000>;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdifb2hdmi";
+ suffix-name = "alsaPORT-spdif";
cpu {
sound-dai = <&aml_spdif_b>;
system-clock-frequency = <6144000>;
* dai link for i2s to hdmix,
* Notice to select a tdm lane not used by hw
*/
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
+ /*
+ * aml-audio-card,dai-link@6 {
+ * format = "i2s";
+ * mclk-fs = <256>;
+ * //continuous-clock;
+ * //bitclock-inversion;
+ * //frame-inversion;
+ * bitclock-master = <&aml_i2s2hdmi>;
+ * frame-master = <&aml_i2s2hdmi>;
+ * suffix-name = "alsaPORT-i2s2hdmi";
+ * cpu {
+ * sound-dai = <&aml_i2s2hdmi>;
+ * dai-tdm-slot-tx-mask = <1 1>;
+ * dai-tdm-slot-num = <2>;
+ * dai-tdm-slot-width = <32>;
+ * system-clock-frequency = <12288000>;
+ * };
+ * codec {
+ * sound-dai = <&dummy_codec>;
+ * };
+ * };
+ */
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
i2s2hdmi = <1>;
- status = "okay";
+ status = "disabled";
};
aml_spdif: spdif {
sound-dai = <&dummy_codec>;
};
};
- /*
- * dai link for i2s to hdmix,
- * Notice to select a tdm lane not used by hw
- */
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
pinctrl-0 = <&tdmc_mclk &tdmout_c &tdmin_c>;
};
- /* copy a useless tdm to output for hdmi, no pinmux */
- aml_i2s2hdmi: i2s2hdmi {
- compatible = "amlogic, g12a-snd-tdmc";
- #sound-dai-cells = <0>;
- dai-tdm-lane-slot-mask-out = <1 1 1 1>;
- dai-tdm-clk-sel = <2>;
- clocks = <&clkaudio CLKID_AUDIO_MCLK_C
- &clkc CLKID_MPLL2>;
- clock-names = "mclk", "clk_srcpll";
-
- i2s2hdmi = <1>;
-
- status = "okay";
- };
aml_spdif: spdif {
compatible = "amlogic, g12a-snd-spdif-a";
sound-dai = <&dummy_codec>;
};
};
- /*
- * dai link for i2s to hdmix,
- * Notice to select a tdm lane not used by hw
- */
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
pinctrl-0 = <&tdmc_mclk &tdmout_c &tdmin_c>;
};
- /* copy a useless tdm to output for hdmi, no pinmux */
- aml_i2s2hdmi: i2s2hdmi {
- compatible = "amlogic, g12a-snd-tdmc";
- #sound-dai-cells = <0>;
- dai-tdm-lane-slot-mask-out = <1 1 1 1>;
- dai-tdm-clk-sel = <2>;
- clocks = <&clkaudio CLKID_AUDIO_MCLK_C
- &clkc CLKID_MPLL2>;
- clock-names = "mclk", "clk_srcpll";
-
- i2s2hdmi = <1>;
-
- status = "okay";
- };
aml_spdif: spdif {
compatible = "amlogic, g12a-snd-spdif-a";
aml-audio-card,dai-link@4 {
mclk-fs = <128>;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdif";
+ suffix-name = "alsaPORT-spdifb2hdmi";
cpu {
sound-dai = <&aml_spdif>;
system-clock-frequency = <6144000>;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdifb2hdmi";
+ suffix-name = "alsaPORT-spdif";
cpu {
sound-dai = <&aml_spdif_b>;
system-clock-frequency = <6144000>;
* dai link for i2s to hdmix,
* Notice to select a tdm lane not used by hw
*/
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
+ /*
+ * aml-audio-card,dai-link@6 {
+ * format = "i2s";
+ * mclk-fs = <256>;
+ * //continuous-clock;
+ * //bitclock-inversion;
+ * //frame-inversion;
+ * bitclock-master = <&aml_i2s2hdmi>;
+ * frame-master = <&aml_i2s2hdmi>;
+ * suffix-name = "alsaPORT-i2s2hdmi";
+ * cpu {
+ * sound-dai = <&aml_i2s2hdmi>;
+ * dai-tdm-slot-tx-mask = <1 1>;
+ * dai-tdm-slot-num = <2>;
+ * dai-tdm-slot-width = <32>;
+ * system-clock-frequency = <12288000>;
+ * };
+ * codec {
+ * sound-dai = <&dummy_codec>;
+ * };
+ * };
+ */
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
i2s2hdmi = <1>;
- status = "okay";
+ status = "disabled";
};
aml_spdif: spdif {
aml-audio-card,dai-link@4 {
mclk-fs = <128>;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdif";
+ suffix-name = "alsaPORT-spdifb2hdmi";
cpu {
sound-dai = <&aml_spdif>;
system-clock-frequency = <6144000>;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdifb2hdmi";
+ suffix-name = "alsaPORT-spdif";
cpu {
sound-dai = <&aml_spdif_b>;
system-clock-frequency = <6144000>;
* dai link for i2s to hdmix,
* Notice to select a tdm lane not used by hw
*/
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
+ /*
+ * aml-audio-card,dai-link@6 {
+ * format = "i2s";
+ * mclk-fs = <256>;
+ * //continuous-clock;
+ * //bitclock-inversion;
+ * //frame-inversion;
+ * bitclock-master = <&aml_i2s2hdmi>;
+ * frame-master = <&aml_i2s2hdmi>;
+ * suffix-name = "alsaPORT-i2s2hdmi";
+ * cpu {
+ * sound-dai = <&aml_i2s2hdmi>;
+ * dai-tdm-slot-tx-mask = <1 1>;
+ * dai-tdm-slot-num = <2>;
+ * dai-tdm-slot-width = <32>;
+ * system-clock-frequency = <12288000>;
+ * };
+ * codec {
+ * sound-dai = <&dummy_codec>;
+ * };
+ * };
+ */
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
i2s2hdmi = <1>;
- status = "okay";
+ status = "disabled";
};
aml_spdif: spdif {
aml-audio-card,dai-link@4 {
mclk-fs = <128>;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdif";
+ suffix-name = "alsaPORT-spdifb2hdmi";
cpu {
sound-dai = <&aml_spdif>;
system-clock-frequency = <6144000>;
/* spdif_b to hdmi, only playback */
aml-audio-card,dai-link@5 {
mclk-fs = <128>;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdifb2hdmi";
+ suffix-name = "alsaPORT-spdif";
cpu {
sound-dai = <&aml_spdif_b>;
system-clock-frequency = <6144000>;
* dai link for i2s to hdmix,
* Notice to select a tdm lane not used by hw
*/
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
+ /*
+ * aml-audio-card,dai-link@6 {
+ * format = "i2s";
+ * mclk-fs = <256>;
+ * //continuous-clock;
+ * //bitclock-inversion;
+ * //frame-inversion;
+ * bitclock-master = <&aml_i2s2hdmi>;
+ * frame-master = <&aml_i2s2hdmi>;
+ * suffix-name = "alsaPORT-i2s2hdmi";
+ * cpu {
+ * sound-dai = <&aml_i2s2hdmi>;
+ * dai-tdm-slot-tx-mask = <1 1>;
+ * dai-tdm-slot-num = <2>;
+ * dai-tdm-slot-width = <32>;
+ * system-clock-frequency = <12288000>;
+ * };
+ * codec {
+ * sound-dai = <&dummy_codec>;
+ * };
+ * };
+ */
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
* 3: spdifout;
* 4: spdifout_b;
*/
- samesource_sel = <4>;
+ samesource_sel = <3>;
};
aml_tdmc: tdmc {
i2s2hdmi = <1>;
- status = "okay";
+ status = "disabled";
};
aml_spdif: spdif {
aml-audio-card,dai-link@4 {
mclk-fs = <128>;
+ continuous-clock;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdif";
+ suffix-name = "alsaPORT-spdifb2hdmi";
cpu {
sound-dai = <&aml_spdif>;
system-clock-frequency = <6144000>;
/* suffix-name, sync with android audio hal
* what's the dai link used for
*/
- suffix-name = "alsaPORT-spdifb2hdmi";
+ suffix-name = "alsaPORT-spdif";
cpu {
sound-dai = <&aml_spdif_b>;
system-clock-frequency = <6144000>;
* dai link for i2s to hdmix,
* Notice to select a tdm lane not used by hw
*/
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
+ /*
+ * aml-audio-card,dai-link@6 {
+ * format = "i2s";
+ * mclk-fs = <256>;
+ * //continuous-clock;
+ * //bitclock-inversion;
+ * //frame-inversion;
+ * bitclock-master = <&aml_i2s2hdmi>;
+ * frame-master = <&aml_i2s2hdmi>;
+ * suffix-name = "alsaPORT-i2s2hdmi";
+ * cpu {
+ * sound-dai = <&aml_i2s2hdmi>;
+ * dai-tdm-slot-tx-mask = <1 1>;
+ * dai-tdm-slot-num = <2>;
+ * dai-tdm-slot-width = <32>;
+ * system-clock-frequency = <12288000>;
+ * };
+ * codec {
+ * sound-dai = <&dummy_codec>;
+ * };
+ * };
+ */
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
i2s2hdmi = <1>;
- status = "okay";
+ status = "disabled";
};
aml_spdif: spdif {
sound-dai = <&dummy_codec>;
};
};
- /*
- * dai link for i2s to hdmix,
- * Notice to select a tdm lane not used by hw
- */
- aml-audio-card,dai-link@6 {
- format = "i2s";
- mclk-fs = <256>;
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- bitclock-master = <&aml_i2s2hdmi>;
- frame-master = <&aml_i2s2hdmi>;
- /* suffix-name, sync with android audio hal
- * what's the dai link used for
- */
- suffix-name = "alsaPORT-i2s2hdmi";
- cpu {
- sound-dai = <&aml_i2s2hdmi>;
- dai-tdm-slot-tx-mask = <1 1>;
- dai-tdm-slot-num = <2>;
- dai-tdm-slot-width = <32>;
- system-clock-frequency = <12288000>;
- };
- codec {
- sound-dai = <&dummy_codec>;
- };
- };
};
audiolocker: locker {
compatible = "amlogic, audiolocker";
pinctrl-0 = <&tdmc_mclk &tdmout_c &tdmin_c>;
};
- /* copy a useless tdm to output for hdmi, no pinmux */
- aml_i2s2hdmi: i2s2hdmi {
- compatible = "amlogic, g12a-snd-tdmc";
- #sound-dai-cells = <0>;
- dai-tdm-lane-slot-mask-out = <1 1 1 1>;
- dai-tdm-clk-sel = <2>;
- clocks = <&clkaudio CLKID_AUDIO_MCLK_C
- &clkc CLKID_MPLL2>;
- clock-names = "mclk", "clk_srcpll";
-
- i2s2hdmi = <1>;
-
- status = "okay";
- };
aml_spdif: spdif {
compatible = "amlogic, g12a-snd-spdif-a";
unsigned int reg;
reg = calc_frddr_address(EE_AUDIO_FRDDR_A_CTRL0, reg_base);
+ /* ensure disable before enable frddr */
aml_audiobus_update_bits(actrl, reg, 1<<31, enable<<31);
if (!enable)
}
}
-void frddr_init_default(unsigned int frddr_index, unsigned int src0_sel)
+void frddr_init_without_mngr(unsigned int frddr_index, unsigned int src0_sel)
{
unsigned int offset, reg;
unsigned int start_addr, end_addr, int_addr;
);
}
+void frddr_deinit_without_mngr(unsigned int frddr_index)
+{
+ unsigned int offset, reg;
+
+ offset = EE_AUDIO_FRDDR_B_CTRL0 - EE_AUDIO_FRDDR_A_CTRL0;
+ reg = EE_AUDIO_FRDDR_A_CTRL0 + offset * frddr_index;
+ audiobus_write(reg, 0x0);
+}
+
static struct ddr_chipinfo g12a_ddr_chipinfo = {
.addr_separated = true,
.same_src_fn = true,
/* audio eq drc */
void aml_aed_enable(bool enable, int aed_module);
-void frddr_init_default(unsigned int frddr_index, unsigned int src0_sel);
+void frddr_init_without_mngr(unsigned int frddr_index, unsigned int src0_sel);
+void frddr_deinit_without_mngr(unsigned int frddr_index);
#endif
#define PREALLOC_BUFFER_MAX (256 * 1024)
static int aml_spdif_new(struct snd_soc_pcm_runtime *rtd)
{
+ struct device *dev = rtd->platform->dev;
+ struct aml_spdif *p_spdif;
+
+ p_spdif = (struct aml_spdif *)dev_get_drvdata(dev);
+
+ pr_info("%s spdif_%s, clk continuous:%d\n",
+ __func__,
+ (p_spdif->id == 0) ? "a":"b",
+ p_spdif->clk_cont);
+ /* keep frddr, when spdif init done, frddr can be released. */
+ if (p_spdif->clk_cont)
+ spdifout_play_with_zerodata_free(p_spdif->id);
+
return snd_pcm_lib_preallocate_pages_for_all(
rtd->pcm, SNDRV_DMA_TYPE_DEV,
rtd->card->snd_card->dev,
dev_info(substream->pcm->card->dev, "spdif capture disable\n");
aml_toddr_enable(p_spdif->tddr, 0);
}
- if (!p_spdif->clk_cont)
+ /* continuous, spdif out is only mute, not disable */
+ if (p_spdif->clk_cont
+ && (substream->stream == SNDRV_PCM_STREAM_PLAYBACK))
+ aml_spdif_mute(p_spdif->actrl,
+ substream->stream, p_spdif->id, true);
+ else
aml_spdif_enable(p_spdif->actrl,
substream->stream, p_spdif->id, false);
break;
/* for spdif_b, clk be continuous,
* and keep silence when no valid data
*/
- if (aml_spdif->id == 1)
+ /*if (aml_spdif->id == 1)*/
aml_spdif->clk_cont = 1;
- if (aml_spdif->clk_cont)
- spdifout_play_with_zerodata(aml_spdif->id);
-
aml_spdif->chipinfo = p_spdif_chipinfo;
} else
dev_warn_once(dev,
if (ret)
return -EINVAL;
+ if (aml_spdif->clk_cont)
+ spdifout_play_with_zerodata(aml_spdif->id);
+
ret = devm_snd_soc_register_component(dev, &aml_spdif_component,
&aml_spdif_dai[aml_spdif->id], 1);
if (ret) {
}
}
+void aml_spdif_mute(
+ struct aml_audio_controller *actrl,
+ int stream,
+ int index,
+ bool is_mute)
+{
+ int mute_lr = 0;
+
+ if (is_mute)
+ mute_lr = 0x3;
+
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ unsigned int offset, reg;
+
+ offset = EE_AUDIO_SPDIFOUT_B_CTRL0 - EE_AUDIO_SPDIFOUT_CTRL0;
+ reg = EE_AUDIO_SPDIFOUT_CTRL0 + offset * index;
+ aml_audiobus_update_bits(actrl,
+ reg, 0x3 << 21, mute_lr << 21);
+ } else {
+ aml_audiobus_update_bits(actrl,
+ EE_AUDIO_SPDIFIN_CTRL0, 0x3 << 6, mute_lr << 6);
+ }
+}
+
void aml_spdif_arb_config(struct aml_audio_controller *actrl)
{
/* config ddr arb */
audiobus_update_bits(reg, 1<<28, 1<<28);
}
-static void spdifout_mute(int spdif_id)
-{
- unsigned int offset, reg;
-
- /* mute */
- offset = EE_AUDIO_SPDIFOUT_B_CTRL0 - EE_AUDIO_SPDIFOUT_CTRL0;
- reg = EE_AUDIO_SPDIFOUT_CTRL0 + offset * spdif_id;
- audiobus_update_bits(reg, 0x3 << 21, 0x3 << 21);
-}
-
static bool spdifout_is_enable(int spdif_id)
{
unsigned int offset, reg, val;
spdif_id = 0;
/* clk for spdif_b is always on */
- if (!spdif_id)
- spdifout_clk_ctrl(spdif_id, is_enable);
+ /*if (!spdif_id)*/
+ spdifout_clk_ctrl(spdif_id, /*is_enable*/true);
if (is_enable)
spdifout_fifo_ctrl(spdif_id, fifo_id, bitwidth);
struct snd_pcm_runtime runtime;
substream.runtime = &runtime;
- runtime.rate = 48000;
+ runtime.rate = sample_rate;
runtime.format = SNDRV_PCM_FORMAT_S16_LE;
runtime.channels = 2;
runtime.sample_bits = 16;
if (spdif_id == 0)
src0_sel = 3;
+ /* spdif clk */
+ spdifout_clk_ctrl(spdif_id, true);
+ /* spdif to hdmitx */
+ spdifoutb_to_hdmitx_ctrl(spdif_id);
+
/* spdif ctrl */
spdifout_fifo_ctrl(spdif_id, frddr_index, bitwidth);
spdif_set_channel_status_info(&chsts, spdif_id);
/* notify hdmitx audio */
- spdifoutb_to_hdmitx_ctrl(spdif_id);
aout_notifier_call_chain(0x1, &substream);
- frddr_init_default(frddr_index, src0_sel);
+ /* init frddr to output zero data. */
+ frddr_init_without_mngr(frddr_index, src0_sel);
+ /* spdif enable */
spdifout_enable(spdif_id, true);
-
- spdifout_mute(spdif_id);
}
}
+
+void spdifout_play_with_zerodata_free(unsigned int spdif_id)
+{
+ pr_info("%s, spdif id:%d\n", __func__, spdif_id);
+
+ /* free frddr, then frddr in mngr */
+ frddr_deinit_without_mngr(spdif_id);
+}
int index,
bool is_enable);
+extern void aml_spdif_mute(
+ struct aml_audio_controller *actrl,
+ int stream,
+ int index,
+ bool is_mute);
+
extern void aml_spdif_arb_config(struct aml_audio_controller *actrl);
extern int aml_spdifin_status_check(
struct iec958_chsts *chsts, int spdif_id);
extern void spdifout_play_with_zerodata(unsigned int spdif_id);
+extern void spdifout_play_with_zerodata_free(unsigned int spdif_id);
#endif