Skip to content

Commit e91d54f

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: sof-rt5682: add mclk_en to sof_rt5682_private
Add a variable mclk_en to sof_rt5682_private structure to reduce global variable access. No functional change. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0cb6a81 commit e91d54f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

sound/soc/intel/boards/sof_board_helpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ struct sof_da7219_private {
101101
*
102102
* @mclk: mclk clock data
103103
* @is_legacy_cpu: true for BYT/CHT boards
104+
* @mclk_en: true for mclk pin is connected
104105
*/
105106
struct sof_rt5682_private {
106107
struct clk *mclk;
107108
bool is_legacy_cpu;
109+
bool mclk_en;
108110
};
109111

110112
/*

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
165165
int extra_jack_data;
166166
int ret, mclk_freq;
167167

168-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN) {
168+
if (ctx->rt5682.mclk_en) {
169169
mclk_freq = sof_dai_get_mclk(rtd);
170170
if (mclk_freq <= 0) {
171171
dev_err(rtd->dev, "invalid mclk freq %d\n", mclk_freq);
@@ -278,7 +278,7 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
278278
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
279279
int pll_id, pll_source, pll_in, pll_out, clk_id, ret;
280280

281-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN) {
281+
if (ctx->rt5682.mclk_en) {
282282
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
283283
ret = clk_prepare_enable(ctx->rt5682.mclk);
284284
if (ret < 0) {
@@ -728,6 +728,9 @@ static int sof_audio_probe(struct platform_device *pdev)
728728
}
729729
}
730730

731+
if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN)
732+
ctx->rt5682.mclk_en = true;
733+
731734
/* need to get main clock from pmc */
732735
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
733736
ctx->rt5682.mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");

0 commit comments

Comments
 (0)