From 7d7012a9aa7646112877cba16c3800a57a473e09 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Wed, 26 Jun 2019 21:32:24 +0530 Subject: [PATCH] ASoC: tegra-alt: cleanup driver codec_probe snd_soc_codec_driver probe() callback for most of the drivers appear to be redundant, as only some member initialization is done. The same can be done in platform_driver probe(). Hence codec_probe is removed from drivers except OPE driver, where peq and mbdrc initialization is done. Bug 200503387 Bug 200520821 Change-Id: Icd03df1d65d61388bf563468eb86bc134701479f Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/2144216 Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/tegra186_arad_alt.c | 8 -------- sound/soc/tegra-alt/tegra186_asrc_alt.c | 8 -------- sound/soc/tegra-alt/tegra186_dspk_alt.c | 13 ++----------- sound/soc/tegra-alt/tegra210_admaif_alt.c | 9 --------- sound/soc/tegra-alt/tegra210_adsp_alt.c | 6 ------ sound/soc/tegra-alt/tegra210_adx_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_afc_alt.c | 14 ++------------ sound/soc/tegra-alt/tegra210_amx_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_dmic_alt.c | 11 +---------- sound/soc/tegra-alt/tegra210_i2s_alt.c | 13 ++----------- sound/soc/tegra-alt/tegra210_iqc_alt.c | 9 --------- sound/soc/tegra-alt/tegra210_mixer_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_mvc_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_ope_alt.c | 2 -- sound/soc/tegra-alt/tegra210_sfc_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_spdif_alt.c | 8 -------- sound/soc/tegra-alt/tegra210_xbar_alt.c | 2 -- .../soc/tegra-alt/utils/tegra210_xbar_utils_alt.c | 7 ------- 18 files changed, 7 insertions(+), 143 deletions(-) diff --git a/sound/soc/tegra-alt/tegra186_arad_alt.c b/sound/soc/tegra-alt/tegra186_arad_alt.c index 8704dc1e..66bd85d5 100644 --- a/sound/soc/tegra-alt/tegra186_arad_alt.c +++ b/sound/soc/tegra-alt/tegra186_arad_alt.c @@ -102,13 +102,6 @@ static int tegra186_arad_runtime_resume(struct device *dev) } #endif -static int tegra186_arad_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra186_arad *arad = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static int tegra186_arad_get_lane_lock_status( struct tegra186_arad *arad, unsigned int lane_id) { @@ -548,7 +541,6 @@ void tegra186_arad_send_ratio(void) EXPORT_SYMBOL(tegra186_arad_send_ratio); static struct snd_soc_codec_driver tegra186_arad_codec = { - .probe = tegra186_arad_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra186_arad_widgets, diff --git a/sound/soc/tegra-alt/tegra186_asrc_alt.c b/sound/soc/tegra-alt/tegra186_asrc_alt.c index 7c553bce..6cef1576 100644 --- a/sound/soc/tegra-alt/tegra186_asrc_alt.c +++ b/sound/soc/tegra-alt/tegra186_asrc_alt.c @@ -585,13 +585,6 @@ static int tegra186_asrc_req_arad_ratio(struct snd_soc_dapm_widget *w, return ret; } -static int tegra186_asrc_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra186_asrc *asrc = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra186_asrc_in_dai_ops = { .hw_params = tegra186_asrc_in_hw_params, }; @@ -891,7 +884,6 @@ static const struct snd_kcontrol_new tegra186_asrc_controls[] = { }; static struct snd_soc_codec_driver tegra186_asrc_codec = { - .probe = tegra186_asrc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra186_asrc_widgets, diff --git a/sound/soc/tegra-alt/tegra186_dspk_alt.c b/sound/soc/tegra-alt/tegra186_dspk_alt.c index 9f8cbaad..fb30240f 100644 --- a/sound/soc/tegra-alt/tegra186_dspk_alt.c +++ b/sound/soc/tegra-alt/tegra186_dspk_alt.c @@ -264,16 +264,6 @@ static int tegra186_dspk_hw_params(struct snd_pcm_substream *substream, return ret; } -static int tegra186_dspk_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra186_dspk *dspk = snd_soc_codec_get_drvdata(codec); - - dspk->rx_fifo_th = 0; - dspk->osr_val = TEGRA186_DSPK_OSR_64; - - return 0; -} - 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, @@ -373,7 +363,6 @@ static const struct snd_kcontrol_new tegrat186_dspk_controls[] = { }; static struct snd_soc_codec_driver tegra186_dspk_codec = { - .probe = tegra186_dspk_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra186_dspk_widgets, @@ -487,6 +476,8 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev) dspk->is_shutdown = false; dspk->prod_name = NULL; + dspk->rx_fifo_th = 0; + dspk->osr_val = TEGRA186_DSPK_OSR_64; if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { dspk->clk_dspk = devm_clk_get(&pdev->dev, NULL); diff --git a/sound/soc/tegra-alt/tegra210_admaif_alt.c b/sound/soc/tegra-alt/tegra210_admaif_alt.c index 7a20eb95..8623862e 100644 --- a/sound/soc/tegra-alt/tegra210_admaif_alt.c +++ b/sound/soc/tegra-alt/tegra210_admaif_alt.c @@ -1071,15 +1071,7 @@ static struct snd_kcontrol_new tegra186_admaif_controls[] = { tegra210_ape_dump_reg_get, tegra210_ape_dump_reg_put), }; -static int tegra_admaif_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra_admaif *admaif = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_codec_driver tegra210_admaif_codec = { - .probe = tegra_admaif_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra_admaif_widgets, @@ -1092,7 +1084,6 @@ static struct snd_soc_codec_driver tegra210_admaif_codec = { }; static struct snd_soc_codec_driver tegra186_admaif_codec = { - .probe = tegra_admaif_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra_admaif_widgets, diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index ab50e133..c2d772d6 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -4404,13 +4404,7 @@ static const struct snd_soc_component_driver tegra210_adsp_component = { .probe = tegra210_adsp_component_probe, }; -static int tegra210_adsp_codec_probe(struct snd_soc_codec *codec) -{ - return 0; -} - static struct snd_soc_codec_driver tegra210_adsp_codec = { - .probe = tegra210_adsp_codec_probe, .idle_bias_off = 1, }; diff --git a/sound/soc/tegra-alt/tegra210_adx_alt.c b/sound/soc/tegra-alt/tegra210_adx_alt.c index 319f3a67..bc1a2bc7 100644 --- a/sound/soc/tegra-alt/tegra210_adx_alt.c +++ b/sound/soc/tegra-alt/tegra210_adx_alt.c @@ -521,13 +521,6 @@ static int tegra210_adx_put_out_channels(struct snd_kcontrol *kcontrol, return 0; } -static int tegra210_adx_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_adx *adx = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_adx_in_dai_ops = { .hw_params = tegra210_adx_in_hw_params, .set_channel_map = tegra210_adx_set_channel_map, @@ -683,7 +676,6 @@ static struct snd_kcontrol_new tegra210_adx_controls[] = { }; static struct snd_soc_codec_driver tegra210_adx_codec = { - .probe = tegra210_adx_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_adx_widgets, diff --git a/sound/soc/tegra-alt/tegra210_afc_alt.c b/sound/soc/tegra-alt/tegra210_afc_alt.c index 7be1ac9b..0b37a54f 100644 --- a/sound/soc/tegra-alt/tegra210_afc_alt.c +++ b/sound/soc/tegra-alt/tegra210_afc_alt.c @@ -59,6 +59,7 @@ static const struct reg_default tegra210_afc_reg_defaults[] = { static void tegra210_afc_init(struct tegra210_afc *afc) { + afc->is_shutdown = false; afc->ppm_diff = AFC_CLK_PPM_DIFF; afc->threshold_type = TH_DEFAULT; afc->src_burst = 0; @@ -364,15 +365,6 @@ static int tegra210_afc_hw_params(struct snd_pcm_substream *substream, } -static int tegra210_afc_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_afc *afc = snd_soc_codec_get_drvdata(codec); - - tegra210_afc_init(afc); - - return 0; -} - static struct snd_soc_dai_ops tegra210_afc_dai_ops = { .hw_params = tegra210_afc_hw_params, }; @@ -415,7 +407,6 @@ static const struct snd_soc_dapm_route tegra210_afc_routes[] = { }; static const struct snd_soc_codec_driver tegra210_afc_codec = { - .probe = tegra210_afc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_afc_widgets, @@ -426,7 +417,6 @@ static const struct snd_soc_codec_driver tegra210_afc_codec = { }; static const struct snd_soc_codec_driver tegra186_afc_codec = { - .probe = tegra210_afc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_afc_widgets, @@ -544,7 +534,7 @@ static int tegra210_afc_platform_probe(struct platform_device *pdev) } afc->soc_data = soc_data; - afc->is_shutdown = false; + tegra210_afc_init(afc); dev_set_drvdata(&pdev->dev, afc); diff --git a/sound/soc/tegra-alt/tegra210_amx_alt.c b/sound/soc/tegra-alt/tegra210_amx_alt.c index e33bcc5a..1b0d41cb 100644 --- a/sound/soc/tegra-alt/tegra210_amx_alt.c +++ b/sound/soc/tegra-alt/tegra210_amx_alt.c @@ -569,13 +569,6 @@ static int tegra210_amx_put_channels(struct snd_kcontrol *kcontrol, return 0; } -static int tegra210_amx_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_amx *amx = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_amx_out_dai_ops = { .hw_params = tegra210_amx_out_hw_params, .set_channel_map = tegra210_amx_set_channel_map, @@ -730,7 +723,6 @@ static struct snd_kcontrol_new tegra210_amx_controls[] = { }; static struct snd_soc_codec_driver tegra210_amx_codec = { - .probe = tegra210_amx_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_amx_widgets, diff --git a/sound/soc/tegra-alt/tegra210_dmic_alt.c b/sound/soc/tegra-alt/tegra210_dmic_alt.c index 8d9d25c5..5058eba6 100644 --- a/sound/soc/tegra-alt/tegra210_dmic_alt.c +++ b/sound/soc/tegra-alt/tegra210_dmic_alt.c @@ -364,15 +364,6 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol, return 0; } -static int tegra210_dmic_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_dmic *dmic = snd_soc_codec_get_drvdata(codec); - - dmic->osr_val = TEGRA210_DMIC_OSR_64; - - return 0; -} - 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, @@ -485,7 +476,6 @@ static const struct snd_kcontrol_new tegra210_dmic_controls[] = { }; static struct snd_soc_codec_driver tegra210_dmic_codec = { - .probe = tegra210_dmic_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_dmic_widgets, @@ -606,6 +596,7 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev) dmic->is_shutdown = false; dmic->prod_name = NULL; + dmic->osr_val = TEGRA210_DMIC_OSR_64; dev_set_drvdata(&pdev->dev, dmic); if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { diff --git a/sound/soc/tegra-alt/tegra210_i2s_alt.c b/sound/soc/tegra-alt/tegra210_i2s_alt.c index b90db0b7..acddc61b 100644 --- a/sound/soc/tegra-alt/tegra210_i2s_alt.c +++ b/sound/soc/tegra-alt/tegra210_i2s_alt.c @@ -708,16 +708,6 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, return 0; } -static int tegra210_i2s_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_i2s *i2s = snd_soc_codec_get_drvdata(codec); - - /* default threshold settings */ - i2s->rx_fifo_th = 3; - - return 0; -} - static struct snd_soc_dai_ops tegra210_i2s_dai_ops = { .set_fmt = tegra210_i2s_set_fmt, .hw_params = tegra210_i2s_hw_params, @@ -911,7 +901,6 @@ static const struct snd_soc_dapm_route tegra210_i2s_routes[] = { }; static struct snd_soc_codec_driver tegra210_i2s_codec = { - .probe = tegra210_i2s_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_i2s_widgets, @@ -1066,6 +1055,8 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) i2s->loopback = 0; i2s->is_shutdown = false; i2s->prod_name = NULL; + /* default threshold settings */ + i2s->rx_fifo_th = 3; dev_set_drvdata(&pdev->dev, i2s); if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { diff --git a/sound/soc/tegra-alt/tegra210_iqc_alt.c b/sound/soc/tegra-alt/tegra210_iqc_alt.c index 634851d6..7e923696 100644 --- a/sound/soc/tegra-alt/tegra210_iqc_alt.c +++ b/sound/soc/tegra-alt/tegra210_iqc_alt.c @@ -143,14 +143,6 @@ static int tegra210_iqc_hw_params(struct snd_pcm_substream *substream, return ret; } - -static int tegra210_iqc_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_iqc *iqc = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_iqc_dai_ops = { .hw_params = tegra210_iqc_hw_params, }; @@ -213,7 +205,6 @@ static const struct snd_soc_dapm_route tegra210_iqc_routes[] = { }; static struct snd_soc_codec_driver tegra210_iqc_codec = { - .probe = tegra210_iqc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_iqc_widgets, diff --git a/sound/soc/tegra-alt/tegra210_mixer_alt.c b/sound/soc/tegra-alt/tegra210_mixer_alt.c index 39bc342b..085dea78 100644 --- a/sound/soc/tegra-alt/tegra210_mixer_alt.c +++ b/sound/soc/tegra-alt/tegra210_mixer_alt.c @@ -300,13 +300,6 @@ static int tegra210_mixer_out_hw_params(struct snd_pcm_substream *substream, return ret; } -static int tegra210_mixer_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_mixer *mixer = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_mixer_out_dai_ops = { .hw_params = tegra210_mixer_out_hw_params, }; @@ -530,7 +523,6 @@ static const struct snd_soc_dapm_route tegra210_mixer_routes[] = { }; static struct snd_soc_codec_driver tegra210_mixer_codec = { - .probe = tegra210_mixer_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_mixer_widgets, diff --git a/sound/soc/tegra-alt/tegra210_mvc_alt.c b/sound/soc/tegra-alt/tegra210_mvc_alt.c index 2be49765..9cbbaee6 100644 --- a/sound/soc/tegra-alt/tegra210_mvc_alt.c +++ b/sound/soc/tegra-alt/tegra210_mvc_alt.c @@ -430,13 +430,6 @@ static int tegra210_mvc_hw_params(struct snd_pcm_substream *substream, return ret; } -static int tegra210_mvc_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_mvc *mvc = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_mvc_dai_ops = { .hw_params = tegra210_mvc_hw_params, }; @@ -524,7 +517,6 @@ static const struct snd_soc_dapm_route tegra210_mvc_routes[] = { }; static struct snd_soc_codec_driver tegra210_mvc_codec = { - .probe = tegra210_mvc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_mvc_widgets, diff --git a/sound/soc/tegra-alt/tegra210_ope_alt.c b/sound/soc/tegra-alt/tegra210_ope_alt.c index 049e884f..f51fb6ff 100644 --- a/sound/soc/tegra-alt/tegra210_ope_alt.c +++ b/sound/soc/tegra-alt/tegra210_ope_alt.c @@ -144,8 +144,6 @@ static int tegra210_ope_hw_params(struct snd_pcm_substream *substream, static int tegra210_ope_codec_probe(struct snd_soc_codec *codec) { - struct tegra210_ope *ope = snd_soc_codec_get_drvdata(codec); - tegra210_peq_codec_init(codec); tegra210_mbdrc_codec_init(codec); diff --git a/sound/soc/tegra-alt/tegra210_sfc_alt.c b/sound/soc/tegra-alt/tegra210_sfc_alt.c index ace1751d..f5e5d6ca 100644 --- a/sound/soc/tegra-alt/tegra210_sfc_alt.c +++ b/sound/soc/tegra-alt/tegra210_sfc_alt.c @@ -613,13 +613,6 @@ static int tegra210_sfc_put_mono_conv(struct snd_kcontrol *kcontrol, return 0; } -static int tegra210_sfc_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_sfc *sfc = snd_soc_codec_get_drvdata(codec); - - return 0; -} - static struct snd_soc_dai_ops tegra210_sfc_in_dai_ops = { .hw_params = tegra210_sfc_in_hw_params, .set_sysclk = tegra210_sfc_set_dai_sysclk, @@ -722,7 +715,6 @@ static const struct snd_kcontrol_new tegra210_sfc_controls[] = { }; static struct snd_soc_codec_driver tegra210_sfc_codec = { - .probe = tegra210_sfc_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_sfc_widgets, diff --git a/sound/soc/tegra-alt/tegra210_spdif_alt.c b/sound/soc/tegra-alt/tegra210_spdif_alt.c index a2d29f9c..e6e63a4d 100644 --- a/sound/soc/tegra-alt/tegra210_spdif_alt.c +++ b/sound/soc/tegra-alt/tegra210_spdif_alt.c @@ -253,13 +253,6 @@ static int tegra210_spdif_set_dai_bclk_ratio(struct snd_soc_dai *dai, return 0; } -static int tegra210_spdif_codec_probe(struct snd_soc_codec *codec) -{ - struct tegra210_spdif *spdif = snd_soc_codec_get_drvdata(codec); - - 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, @@ -355,7 +348,6 @@ static const struct snd_soc_dapm_route tegra210_spdif_routes[] = { }; static struct snd_soc_codec_driver tegra210_spdif_codec = { - .probe = tegra210_spdif_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_spdif_widgets, diff --git a/sound/soc/tegra-alt/tegra210_xbar_alt.c b/sound/soc/tegra-alt/tegra210_xbar_alt.c index 62a0b8fb..09525ebc 100644 --- a/sound/soc/tegra-alt/tegra210_xbar_alt.c +++ b/sound/soc/tegra-alt/tegra210_xbar_alt.c @@ -1247,7 +1247,6 @@ static struct of_dev_auxdata tegra186_xbar_auxdata[] = { }; static struct snd_soc_codec_driver tegra210_xbar_codec = { - .probe = tegra_xbar_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra210_xbar_widgets, @@ -1258,7 +1257,6 @@ static struct snd_soc_codec_driver tegra210_xbar_codec = { }; static struct snd_soc_codec_driver tegra186_xbar_codec = { - .probe = tegra_xbar_codec_probe, .idle_bias_off = 1, .component_driver = { .dapm_widgets = tegra186_xbar_widgets, diff --git a/sound/soc/tegra-alt/utils/tegra210_xbar_utils_alt.c b/sound/soc/tegra-alt/utils/tegra210_xbar_utils_alt.c index b359dde7..5801dea7 100644 --- a/sound/soc/tegra-alt/utils/tegra210_xbar_utils_alt.c +++ b/sound/soc/tegra-alt/utils/tegra210_xbar_utils_alt.c @@ -311,13 +311,6 @@ int tegra_xbar_remove(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(tegra_xbar_remove); -int tegra_xbar_codec_probe(struct snd_soc_codec *codec) -{ - return 0; -} -EXPORT_SYMBOL_GPL(tegra_xbar_codec_probe); - - int tegra_xbar_probe(struct platform_device *pdev, struct tegra_xbar_soc_data *soc_data) {