mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
audio: auge: fix tdm skew, pdm clk, spdif to hdmxtx clk inv
PD#156734: audio: auge: fix tdm skew, pdm clk, spdif to hdmxtx clk inv Change-Id: I2033bb0d0843eca309ad58483183293f1c4d92fa Signed-off-by: Xing Wang <xing.wang@amlogic.com>
This commit is contained in:
@@ -843,7 +843,7 @@
|
||||
};
|
||||
|
||||
aml-audio-card,dai-link@1 {
|
||||
format = "i2s";
|
||||
format = "i2s"; /*"dsp_a";*/
|
||||
mclk-fs = <256>;
|
||||
//continuous-clock;
|
||||
//bitclock-inversion;
|
||||
@@ -855,11 +855,19 @@
|
||||
dai-tdm-slot-tx-mask = <1 1>;
|
||||
dai-tdm-slot-rx-mask = <1 1>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
/*
|
||||
* dai-tdm-slot-tx-mask =
|
||||
* <1 1 1 1 1 1 1 1>;
|
||||
* dai-tdm-slot-rx-mask =
|
||||
* <1 1 1 1 1 1 1 1>;
|
||||
* dai-tdm-slot-num = <8>;
|
||||
*/
|
||||
dai-tdm-slot-width = <32>;
|
||||
system-clock-frequency = <12288000>;
|
||||
};
|
||||
codec {
|
||||
sound-dai = <&dummy_codec &amlogic_codec>;
|
||||
sound-dai = <&dummy_codec &amlogic_codec
|
||||
/*&ad82584f_62*/>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -992,6 +1000,15 @@
|
||||
pinctrl-names="default";
|
||||
pinctrl-0=<&c_i2c_master_pin1>;
|
||||
|
||||
/* for ref board */
|
||||
ad82584f_62: ad82584f_62@62 {
|
||||
compatible = "ESMT, ad82584f";
|
||||
#sound-dai-cells = <0>;
|
||||
reg = <0x31>;
|
||||
status = "okay";
|
||||
reset_pin = <&gpio GPIOA_5 0>;
|
||||
};
|
||||
|
||||
tas5707_36: tas5707_36@36 {
|
||||
compatible = "ti,tas5707";
|
||||
#sound-dai-cells = <0>;
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#include "regs.h"
|
||||
#include "ddr_mngr.h"
|
||||
|
||||
/*#define G12A_PTM*/
|
||||
#define CLK_INTEGER_MODE
|
||||
|
||||
static struct snd_pcm_hardware aml_pdm_hardware = {
|
||||
.info =
|
||||
SNDRV_PCM_INFO_MMAP |
|
||||
@@ -706,8 +709,6 @@ static int aml_pdm_dai_trigger(
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#define G12A_PTM*/
|
||||
|
||||
static int aml_pdm_dai_set_sysclk(struct snd_soc_dai *cpu_dai,
|
||||
int clk_id, unsigned int freq, int dir)
|
||||
{
|
||||
@@ -719,13 +720,17 @@ static int aml_pdm_dai_set_sysclk(struct snd_soc_dai *cpu_dai,
|
||||
|
||||
#ifdef G12A_PTM
|
||||
clk_set_rate(p_pdm->dclk_srcpll, 24576000);
|
||||
#else
|
||||
#ifdef CLK_INTEGER_MODE
|
||||
clk_set_rate(p_pdm->clk_pdm_sysclk,
|
||||
sysclk_srcpll_freq / 4);
|
||||
#else
|
||||
clk_set_rate(p_pdm->clk_pdm_sysclk,
|
||||
sysclk_srcpll_freq / 5);
|
||||
#endif
|
||||
if (dclk_srcpll_freq == 0)
|
||||
clk_set_rate(p_pdm->dclk_srcpll, 24576000);
|
||||
#endif
|
||||
|
||||
if (pdm_dclk == 1)
|
||||
clk_set_rate(p_pdm->clk_pdm_dclk, 1024000);
|
||||
else if (pdm_dclk == 2)
|
||||
@@ -733,6 +738,10 @@ static int aml_pdm_dai_set_sysclk(struct snd_soc_dai *cpu_dai,
|
||||
else
|
||||
clk_set_rate(p_pdm->clk_pdm_dclk, 3072000);
|
||||
|
||||
pr_info("pdm pdm_sysclk:%lu clk_pdm_dclk:%lu\n",
|
||||
clk_get_rate(p_pdm->clk_pdm_sysclk),
|
||||
clk_get_rate(p_pdm->clk_pdm_dclk));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@
|
||||
/* TOACODEC Registers */
|
||||
#define EE_AUDIO_TOACODEC_CTRL0 0x1d0
|
||||
/* TOHDMITX Registers */
|
||||
#define EE_AUDIO_TOHDMITX_CTRL0 0x1d0
|
||||
#define EE_AUDIO_TOHDMITX_CTRL0 0x1d1
|
||||
|
||||
/* acodec reset */
|
||||
#define EE_RESET1 0x002
|
||||
|
||||
@@ -274,6 +274,7 @@ void spdifoutb_to_hdmitx_ctrl(void)
|
||||
{
|
||||
audiobus_write(EE_AUDIO_TOHDMITX_CTRL0,
|
||||
1 << 31
|
||||
| 1 << 3 /* spdif_clk_cap_inv */
|
||||
| 0 << 2 /* spdif_clk_inv */
|
||||
| 1 << 1 /* spdif_out_b */
|
||||
| 1 << 0 /* spdif_clk_b */
|
||||
|
||||
@@ -264,7 +264,10 @@ void aml_tdm_set_format(
|
||||
* that is, together with the last bit of the previous
|
||||
* data word.
|
||||
*/
|
||||
bclkout_skew = 1;
|
||||
if (p_config->sclk_ws_inv)
|
||||
bclkout_skew = 2;
|
||||
else
|
||||
bclkout_skew = 1;
|
||||
bclkin_skew = 3;
|
||||
|
||||
if (capture_active)
|
||||
|
||||
Reference in New Issue
Block a user