From b9596edbb5e014eb56044ee3a77c29136a8ac8b7 Mon Sep 17 00:00:00 2001 From: Mohan Kumar Date: Sat, 18 Nov 2017 13:47:22 +0530 Subject: [PATCH] ASoC: tegra-alt: fix aud mclk reset aud mclk reset is available only for t186, so move all the code related to aud mclk reset under t186 chip check. Bug 200365570 Change-Id: I2a7ff5eff583b138dca507336408779f5228a2d8 Signed-off-by: Mohan Kumar Reviewed-on: https://git-master.nvidia.com/r/1600769 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sameer Pujar GVS: Gerrit_Virtual_Submit Reviewed-by: Sharad Gupta Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../tegra-alt/include/tegra_asoc_utils_alt.h | 1 + .../tegra-alt/utils/tegra_asoc_utils_alt.c | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sound/soc/tegra-alt/include/tegra_asoc_utils_alt.h b/sound/soc/tegra-alt/include/tegra_asoc_utils_alt.h index 859172ed..a5c0feae 100644 --- a/sound/soc/tegra-alt/include/tegra_asoc_utils_alt.h +++ b/sound/soc/tegra-alt/include/tegra_asoc_utils_alt.h @@ -33,6 +33,7 @@ struct device; enum tegra_asoc_utils_soc { TEGRA_ASOC_UTILS_SOC_TEGRA210, TEGRA_ASOC_UTILS_SOC_TEGRA186, + TEGRA_ASOC_UTILS_SOC_TEGRA194, }; /* Maintain same order in DT entry */ diff --git a/sound/soc/tegra-alt/utils/tegra_asoc_utils_alt.c b/sound/soc/tegra-alt/utils/tegra_asoc_utils_alt.c index a58085b5..a2cdbfb5 100644 --- a/sound/soc/tegra-alt/utils/tegra_asoc_utils_alt.c +++ b/sound/soc/tegra-alt/utils/tegra_asoc_utils_alt.c @@ -169,10 +169,9 @@ int tegra_alt_asoc_utils_clk_enable(struct tegra_asoc_audio_clock_info *data) { int err; -#if defined(CONFIG_COMMON_CLK) - if (data->soc > TEGRA_ASOC_UTILS_SOC_TEGRA210) + if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA186) reset_control_reset(data->clk_cdev1_rst); -#endif + err = clk_prepare_enable(data->clk_cdev1); if (err) { dev_err(data->dev, "Can't enable cdev1: %d\n", err); @@ -207,6 +206,8 @@ int tegra_alt_asoc_utils_init(struct tegra_asoc_audio_clock_info *data, data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA210; else if (of_machine_is_compatible("nvidia,tegra186")) data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA186; + else if (of_machine_is_compatible("nvidia,tegra194")) + data->soc = TEGRA_ASOC_UTILS_SOC_TEGRA194; else /* DT boot, but unknown SoC */ return -EINVAL; @@ -247,17 +248,17 @@ int tegra_alt_asoc_utils_init(struct tegra_asoc_audio_clock_info *data, goto err; } -#if defined(CONFIG_COMMON_CLK) - data->clk_cdev1_rst = devm_reset_control_get(dev, - "extern1_rst"); - if (IS_ERR(data->clk_cdev1_rst)) { - dev_err(dev, "Reset control is not found, err: %ld\n", - PTR_ERR(data->clk_cdev1_rst)); - return PTR_ERR(data->clk_cdev1_rst); + if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA186) { + data->clk_cdev1_rst = devm_reset_control_get(dev, + "extern1_rst"); + if (IS_ERR(data->clk_cdev1_rst)) { + dev_err(dev, + "Reset control is not found, err: %ld\n", + PTR_ERR(data->clk_cdev1_rst)); + return PTR_ERR(data->clk_cdev1_rst); + } + reset_control_reset(data->clk_cdev1_rst); } - - reset_control_reset(data->clk_cdev1_rst); -#endif } return 0;