From 428cd83bb700589070ad37b69d6629691e4dbc04 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Thu, 5 Jan 2017 11:28:28 +0530 Subject: [PATCH] ASoC: tegra-alt: fix noisy audio issue Playback of few sample rates is affected due to incorrect pll_a and pll_a_out0 values. Issues seen with 8kHz, 176.4kHz and some of the odd frequency (multiples of 11.025kHz) streams. Current patch provides required rates for pll_a and pll_a_out0. pll_a rate is fixed at 338.688MHz, which can serve odd sample rates. To support lower frequency sample rates (8/11.025 kHz), pll_a_out0 is reduced to half of its value corresponding to even/odd stream rates. Bug 1849362 Change-Id: Icc1e7b08b573dc6ca1f4cc84ff931bf9fefe1a98 Signed-off-by: Sameer Pujar Reviewed-on: http://git-master/r/1280564 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mohan Kumar D GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande --- sound/soc/tegra-alt/tegra_asoc_utils_alt.c | 5 +++-- sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sound/soc/tegra-alt/tegra_asoc_utils_alt.c b/sound/soc/tegra-alt/tegra_asoc_utils_alt.c index da00f55..baebc04 100644 --- a/sound/soc/tegra-alt/tegra_asoc_utils_alt.c +++ b/sound/soc/tegra-alt/tegra_asoc_utils_alt.c @@ -2,7 +2,7 @@ * tegra_asoc_utils_alt.c - MCLK and DAP Utility driver * * Author: Stephen Warren - * Copyright (c) 2010-2016 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2010-2017 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -142,12 +142,13 @@ int tegra_alt_asoc_utils_set_rate(struct tegra_asoc_audio_clock_info *data, case 22050: case 44100: case 88200: + case 176400: if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20) new_baseclock = 56448000; else if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA30) new_baseclock = 564480000; else - new_baseclock = 282240000; + new_baseclock = 338688000; break; case 8000: case 16000: diff --git a/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c b/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c index 4f71ac8..0434a7f 100644 --- a/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c +++ b/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c @@ -1,7 +1,7 @@ /* * tegra_t210ref_mobile_rt565x_alt.c - Tegra T210 Machine driver for mobile * - * Copyright (c) 2015-2016 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2017 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -86,7 +86,7 @@ static const int tegra_t210ref_srate_values[] = { 32000, 88200, 96000, - 176000, + 176400, 192000, }; @@ -189,18 +189,22 @@ static int tegra_t210ref_dai_init(struct snd_soc_pcm_runtime *rtd, codec_rate = tegra_t210ref_srate_values[machine->rate_via_kcontrol]; clk_rate = (machine->rate_via_kcontrol) ? codec_rate : rate; + /* aud_mclk, 256 times the sample rate */ + clk_out_rate = clk_rate << 8; switch (clk_rate) { case 11025: + mclk = 22579200; + break; case 22050: case 44100: case 88200: - case 176000: - /* aud_mclk, 256 times the sample rate */ - clk_out_rate = clk_rate << 8; - mclk = 11289600 * 4; + case 176400: + mclk = 45158400; break; case 8000: + mclk = 24576000; + break; case 16000: case 32000: case 48000: @@ -208,8 +212,7 @@ static int tegra_t210ref_dai_init(struct snd_soc_pcm_runtime *rtd, case 96000: case 192000: default: - clk_out_rate = clk_rate << 8; - mclk = 12288000 * 4; + mclk = 49152000; break; } -- 2.1.4