diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/nau8822.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/nau8822.h | 9 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_sai.h | 2 |
4 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index 6ffd0f5e3a60..a82098c9bb55 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -1045,6 +1045,7 @@ static const int update_reg[] = { static int nau8822_probe(struct snd_soc_component *component) { int i; + struct device_node *of_node = component->dev->of_node; /* * Set the update bit in all registers, that have one. This way all @@ -1055,6 +1056,14 @@ static int nau8822_probe(struct snd_soc_component *component) snd_soc_component_update_bits(component, update_reg[i], 0x100, 0x100); + /* Check property to configure the two loudspeaker outputs as + * a single Bridge Tied Load output + */ + if (of_property_read_bool(of_node, "nuvoton,spk-btl")) + snd_soc_component_update_bits(component, + NAU8822_REG_RIGHT_SPEAKER_CONTROL, + NAU8822_RSUBBYP, NAU8822_RSUBBYP); + return 0; } diff --git a/sound/soc/codecs/nau8822.h b/sound/soc/codecs/nau8822.h index b45d42c15de6..14be81c763fe 100644 --- a/sound/soc/codecs/nau8822.h +++ b/sound/soc/codecs/nau8822.h @@ -187,6 +187,15 @@ /* NAU8822_REG_PLL_K3 (0x27) */ #define NAU8822_PLLK3_MASK 0x1FF +/* NAU8822_REG_RIGHT_SPEAKER_CONTROL (0x2B) */ +#define NAU8822_RMIXMUT 0x20 +#define NAU8822_RSUBBYP 0x10 + +#define NAU8822_RAUXRSUBG_SFT 1 +#define NAU8822_RAUXRSUBG_MASK 0x0E + +#define NAU8822_RAUXSMUT 0x01 + /* System Clock Source */ enum { NAU8822_CLK_MCLK, diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 61d41349bb63..4ed8c450e7cc 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -706,6 +706,11 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, regmap_write(sai->regmap, FSL_SAI_xMR(tx), ~0UL - ((1 << min(channels, slots)) - 1)); + if (sai->soc_data->mclk_gated_by_bce) + /* Enable phyiscal MCLK pin signal early */ + regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), + FSL_SAI_CSR_BCE, FSL_SAI_CSR_BCE); + return 0; } @@ -1640,6 +1645,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx8mp_data = { .fifos = 8, .flags = 0, .max_register = FSL_SAI_MDIV, + .mclk_gated_by_bce = 1, }; static const struct fsl_sai_soc_data fsl_sai_imx8ulp_data = { diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index de7b2a6d4461..acc047d159d5 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -237,6 +237,8 @@ struct fsl_sai_soc_data { unsigned int flags; unsigned int max_register; unsigned int max_burst[2]; + /* Set to 1 if the SAI gates MCLK to the output pin with BCE */ + bool mclk_gated_by_bce; }; /** |