From 600cfeccca67edfcbcfe6a6cb87d4cdccda4a573 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Thu, 27 Jun 2019 14:04:19 +0530 Subject: [PATCH] ASoC: tegra-alt: remove set_bclk_ratio() callbacks snd_soc_dai_ops has a callback function pointer to set bclk ratio. For DMIC, DSPK and SPDIF drivers though the callback is implemented but looks redundant. Such callbacks are removed from the driver and a NULL check for set_bclk_ratio function ptr is added in machine driver. Bug 200503387 Bug 200520821 Change-Id: Ia3b96d0e0f4789f8bc54960b3a7ebaf482da1434 Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/2144430 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Mohan Kumar D Reviewed-by: Ravindra Lokhande Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../machine_drivers/tegra_machine_driver_mobile.c | 3 +++ sound/soc/tegra-alt/tegra186_dspk_alt.c | 12 ------------ sound/soc/tegra-alt/tegra210_dmic_alt.c | 7 ------- sound/soc/tegra-alt/tegra210_spdif_alt.c | 7 ------- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c index 9c850a00..8630a304 100644 --- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c +++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c @@ -376,6 +376,9 @@ static int tegra_machine_set_bclk_ratio(struct tegra_machine *machine, unsigned int bclk_ratio; int err; + if (!rtd->cpu_dai->driver->ops->set_bclk_ratio) + return 0; + if (machine->bclk_ratio_override) { bclk_ratio = machine->bclk_ratio_override; } else { diff --git a/sound/soc/tegra-alt/tegra186_dspk_alt.c b/sound/soc/tegra-alt/tegra186_dspk_alt.c index f1a5c679..fbd8fcae 100644 --- a/sound/soc/tegra-alt/tegra186_dspk_alt.c +++ b/sound/soc/tegra-alt/tegra186_dspk_alt.c @@ -165,12 +165,6 @@ static int tegra186_dspk_set_audio_cif(struct tegra186_dspk *dspk, return 0; } -static int tegra186_dspk_set_dai_bclk_ratio(struct snd_soc_dai *dai, - unsigned int ratio) -{ - return 0; -} - static int tegra186_dspk_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { @@ -266,15 +260,10 @@ static int tegra186_dspk_hw_params(struct snd_pcm_substream *substream, static struct snd_soc_dai_ops tegra186_dspk_dai_ops = { .hw_params = tegra186_dspk_hw_params, - .set_bclk_ratio = tegra186_dspk_set_dai_bclk_ratio, .startup = tegra186_dspk_startup, .shutdown = tegra186_dspk_shutdown, }; -static struct snd_soc_dai_ops tegra186_dspk_dai_ops2 = { - .set_bclk_ratio = tegra186_dspk_set_dai_bclk_ratio, -}; - static struct snd_soc_dai_driver tegra186_dspk_dais[] = { { .name = "DAP", @@ -314,7 +303,6 @@ static struct snd_soc_dai_driver tegra186_dspk_dais[] = { .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, }, - .ops = &tegra186_dspk_dai_ops2, .symmetric_rates = 1, }, { diff --git a/sound/soc/tegra-alt/tegra210_dmic_alt.c b/sound/soc/tegra-alt/tegra210_dmic_alt.c index aa0c4548..85646fbe 100644 --- a/sound/soc/tegra-alt/tegra210_dmic_alt.c +++ b/sound/soc/tegra-alt/tegra210_dmic_alt.c @@ -102,12 +102,6 @@ static int tegra210_dmic_runtime_resume(struct device *dev) return 0; } -static int tegra210_dmic_set_dai_bclk_ratio(struct snd_soc_dai *dai, - unsigned int ratio) -{ - return 0; -} - static const int tegra210_dmic_fmt_values[] = { 0, TEGRA210_AUDIOCIF_BITS_16, @@ -343,7 +337,6 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol, static struct snd_soc_dai_ops tegra210_dmic_dai_ops = { .hw_params = tegra210_dmic_hw_params, - .set_bclk_ratio = tegra210_dmic_set_dai_bclk_ratio, .startup = tegra210_dmic_startup, .shutdown = tegra210_dmic_shutdown, }; diff --git a/sound/soc/tegra-alt/tegra210_spdif_alt.c b/sound/soc/tegra-alt/tegra210_spdif_alt.c index e6e63a4d..8cc039fd 100644 --- a/sound/soc/tegra-alt/tegra210_spdif_alt.c +++ b/sound/soc/tegra-alt/tegra210_spdif_alt.c @@ -247,16 +247,9 @@ static int tegra210_spdif_hw_params(struct snd_pcm_substream *substream, return 0; } -static int tegra210_spdif_set_dai_bclk_ratio(struct snd_soc_dai *dai, - unsigned int ratio) -{ - return 0; -} - static struct snd_soc_dai_ops tegra210_spdif_dai_ops = { .hw_params = tegra210_spdif_hw_params, .set_sysclk = tegra210_spdif_set_dai_sysclk, - .set_bclk_ratio = tegra210_spdif_set_dai_bclk_ratio, }; static struct snd_soc_dai_driver tegra210_spdif_dais[] = {