]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
ASoC: tegra-alt: enable clock driver for T210
authorJunghyun Kim <juskim@nvidia.com>
Fri, 8 Aug 2014 00:34:34 +0000 (17:34 -0700)
committerRavindra Lokhande <rlokhande@nvidia.com>
Tue, 24 May 2016 06:40:39 +0000 (12:10 +0530)
This change is for enabling clock driver by removing CONFIG_MACH_GRENADA

Bug 1442940
Bug 1537191

Change-Id: I6373df9ee225fc379eafc187b7b13a83580b7fca
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/454221
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
sound/soc/tegra-alt/tegra210_adx_alt.c
sound/soc/tegra-alt/tegra210_afc_alt.c
sound/soc/tegra-alt/tegra210_amx_alt.c
sound/soc/tegra-alt/tegra210_i2s_alt.c
sound/soc/tegra-alt/tegra210_mixer_alt.c
sound/soc/tegra-alt/tegra210_mvc_alt.c
sound/soc/tegra-alt/tegra210_sfc_alt.c
sound/soc/tegra-alt/tegra210_spdif_alt.c

index 1bf95af95a53d77971fbac830a37b6cb94b2838c..7cf1b8fbbc6ef641a32fc0acb14ca4e21443229a 100644 (file)
@@ -178,9 +178,7 @@ static int tegra210_adx_runtime_suspend(struct device *dev)
 
        regcache_cache_only(adx->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(adx->clk_adx);
-#endif
 
        return 0;
 }
@@ -188,7 +186,6 @@ static int tegra210_adx_runtime_suspend(struct device *dev)
 static int tegra210_adx_runtime_resume(struct device *dev)
 {
        struct tegra210_adx *adx = dev_get_drvdata(dev);
-#ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(adx->clk_adx);
@@ -196,7 +193,6 @@ static int tegra210_adx_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(adx->regmap, false);
 
@@ -537,14 +533,12 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)
 
        adx->soc_data = soc_data;
 
-#ifndef CONFIG_MACH_GRENADA
        adx->clk_adx = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(adx->clk_adx)) {
                dev_err(&pdev->dev, "Can't retrieve adx clock\n");
                ret = PTR_ERR(adx->clk_adx);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -609,29 +603,22 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, adx->clk_adx);
-#else
-       dev_err(&pdev->dev, "err\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_adx_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_adx *adx = dev_get_drvdata(&pdev->dev);
-#endif
        snd_soc_unregister_codec(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_adx_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, adx->clk_adx);
-#endif
+
        return 0;
 }
 
index 198b7a0204fdfe3caf68df2a31136893dc74336d..9143b35201010197a4fe66b806a1cae7077b3963 100644 (file)
@@ -42,9 +42,7 @@ static int tegra210_afc_runtime_suspend(struct device *dev)
 
        regcache_cache_only(afc->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(afc->clk_afc);
-#endif
 
        return 0;
 }
@@ -52,8 +50,6 @@ static int tegra210_afc_runtime_suspend(struct device *dev)
 static int tegra210_afc_runtime_resume(struct device *dev)
 {
        struct tegra210_afc *afc = dev_get_drvdata(dev);
-
-#ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(afc->clk_afc);
@@ -61,7 +57,6 @@ static int tegra210_afc_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(afc->regmap, false);
 
@@ -362,14 +357,12 @@ static int tegra210_afc_platform_probe(struct platform_device *pdev)
        /* initialize default destination I2S */
        afc->destination_i2s = 1;
 
-#ifndef CONFIG_MACH_GRENADA
        afc->clk_afc = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(afc->clk_afc)) {
                dev_err(&pdev->dev, "Can't retrieve afc clock\n");
                ret = PTR_ERR(afc->clk_afc);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -434,29 +427,21 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, afc->clk_afc);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_afc_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_afc *afc = dev_get_drvdata(&pdev->dev);
-#endif
        snd_soc_unregister_codec(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_afc_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, afc->clk_afc);
-#endif
 
        return 0;
 }
index c88cd2339ebfdc13c5fa8173e7f8ee3538351d7d..9fcdd197ecadcb8a7bfc8fc33bd240139d05a53c 100644 (file)
@@ -173,9 +173,7 @@ static int tegra210_amx_runtime_suspend(struct device *dev)
 
        regcache_cache_only(amx->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(amx->clk_amx);
-#endif
 
        return 0;
 }
@@ -214,7 +212,6 @@ static unsigned int tegra210_amx_read_map_ram(struct tegra210_amx *amx,
 static int tegra210_amx_runtime_resume(struct device *dev)
 {
        struct tegra210_amx *amx = dev_get_drvdata(dev);
-#ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(amx->clk_amx);
@@ -222,7 +219,6 @@ static int tegra210_amx_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(amx->regmap, false);
 
@@ -572,14 +568,12 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
 
        amx->soc_data = soc_data;
 
-#ifndef CONFIG_MACH_GRENADA
        amx->clk_amx = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(amx->clk_amx)) {
                dev_err(&pdev->dev, "Can't retrieve tegra210_amx clock\n");
                ret = PTR_ERR(amx->clk_amx);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -644,20 +638,14 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, amx->clk_amx);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_amx_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_amx *amx = dev_get_drvdata(&pdev->dev);
-#endif
 
        snd_soc_unregister_codec(&pdev->dev);
 
@@ -665,9 +653,7 @@ static int tegra210_amx_platform_remove(struct platform_device *pdev)
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_amx_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, amx->clk_amx);
-#endif
 
        return 0;
 }
index 514fff9e886e88eb3fba35d7337e653d773ffb3e..c4fc313e5dac4cba0c34084ece8e987dcbb17707 100644 (file)
@@ -40,7 +40,6 @@
 
 static int tegra210_i2s_set_clock_rate(struct device *dev, int clock_rate)
 {
-#ifndef CONFIG_MACH_GRENADA
        unsigned int val;
        struct tegra210_i2s *i2s = dev_get_drvdata(dev);
        int ret;
@@ -75,9 +74,6 @@ static int tegra210_i2s_set_clock_rate(struct device *dev, int clock_rate)
        }
 
        return ret;
-#else
-       return 0;
-#endif
 }
 
 static int tegra210_i2s_runtime_suspend(struct device *dev)
index be8d889824ceb16e742cd35696f0a1efce53bbe9..d2a246730152f96ca3d9496e2e2f96bda078edd3 100644 (file)
@@ -46,9 +46,7 @@ static int tegra210_mixer_runtime_suspend(struct device *dev)
 
        regcache_cache_only(mixer->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(mixer->clk_mixer);
-#endif
 
        return 0;
 }
@@ -56,7 +54,6 @@ static int tegra210_mixer_runtime_suspend(struct device *dev)
 static int tegra210_mixer_runtime_resume(struct device *dev)
 {
        struct tegra210_mixer *mixer = dev_get_drvdata(dev);
-#ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(mixer->clk_mixer);
@@ -64,7 +61,6 @@ static int tegra210_mixer_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(mixer->regmap, false);
 
@@ -582,14 +578,12 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
        mixer->gain_coeff[12] = 0x3e80;
        mixer->gain_coeff[13] = 0x83126E;
 
-#ifndef CONFIG_MACH_GRENADA
        mixer->clk_mixer = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(mixer->clk_mixer)) {
                dev_err(&pdev->dev, "Can't retrieve tegra210_mixer clock\n");
                ret = PTR_ERR(mixer->clk_mixer);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -654,20 +648,14 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, mixer->clk_mixer);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_mixer_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_mixer *mixer = dev_get_drvdata(&pdev->dev);
-#endif
 
        snd_soc_unregister_codec(&pdev->dev);
 
@@ -675,9 +663,7 @@ static int tegra210_mixer_platform_remove(struct platform_device *pdev)
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_mixer_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, mixer->clk_mixer);
-#endif
 
        return 0;
 }
index 3eaffcf0e6640e166a7b9cf68d2deb9f500d67d3..8c413ffa43651ada6d7ac9415ff3a485300df5ef 100644 (file)
@@ -42,9 +42,7 @@ static int tegra210_mvc_runtime_suspend(struct device *dev)
 
        regcache_cache_only(mvc->regmap, true);
 
-       #ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(mvc->clk_mvc);
-       #endif
 
        return 0;
 }
@@ -53,7 +51,6 @@ static int tegra210_mvc_runtime_resume(struct device *dev)
 {
        struct tegra210_mvc *mvc = dev_get_drvdata(dev);
 
-       #ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(mvc->clk_mvc);
@@ -61,7 +58,6 @@ static int tegra210_mvc_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-       #endif
 
        regcache_cache_only(mvc->regmap, false);
 
@@ -426,14 +422,12 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev)
        mvc->poly_coeff[7] = 5527252;
        mvc->poly_coeff[8] = -785042;
 
-#ifndef CONFIG_MACH_GRENADA
        mvc->clk_mvc = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(mvc->clk_mvc)) {
                dev_err(&pdev->dev, "Can't retrieve mvc clock\n");
                ret = PTR_ERR(mvc->clk_mvc);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -498,29 +492,22 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, mvc->clk_mvc);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_mvc_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_mvc *mvc = dev_get_drvdata(&pdev->dev);
-#endif
+
        snd_soc_unregister_codec(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_mvc_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, mvc->clk_mvc);
-#endif
 
        return 0;
 }
index 78dfb11fe4428d8fd3b33eef12b5b1b44540b7ca..4a8721a935d5160c03e44ec86f37d6f052f33165 100644 (file)
@@ -42,9 +42,7 @@ static int tegra210_sfc_runtime_suspend(struct device *dev)
 
        regcache_cache_only(sfc->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(sfc->clk_sfc);
-#endif
 
        return 0;
 }
@@ -53,7 +51,6 @@ static int tegra210_sfc_runtime_resume(struct device *dev)
 {
        struct tegra210_sfc *sfc = dev_get_drvdata(dev);
 
-#ifndef CONFIG_MACH_GRENADA
        int ret;
 
        ret = clk_prepare_enable(sfc->clk_sfc);
@@ -61,7 +58,6 @@ static int tegra210_sfc_runtime_resume(struct device *dev)
                dev_err(dev, "clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(sfc->regmap, false);
 
@@ -473,14 +469,12 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev)
        /* initialize default output srate */
        sfc->srate_out = TEGRA210_SFC_FS48;
 
-#ifndef CONFIG_MACH_GRENADA
        sfc->clk_sfc = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(sfc->clk_sfc)) {
                dev_err(&pdev->dev, "Can't retrieve sfc clock\n");
                ret = PTR_ERR(sfc->clk_sfc);
                goto err;
        }
-#endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -545,29 +539,22 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, sfc->clk_sfc);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_sfc_platform_remove(struct platform_device *pdev)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct tegra210_sfc *sfc = dev_get_drvdata(&pdev->dev);
-#endif
+
        snd_soc_unregister_codec(&pdev->dev);
 
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_sfc_runtime_suspend(&pdev->dev);
 
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, sfc->clk_sfc);
-#endif
 
        return 0;
 }
index 1b1b1be96b95b5950255746fa1b026ded7796136..447151c3ccc0bbdd12aaac0fd2d12396967319d8 100644 (file)
@@ -42,10 +42,8 @@ static int tegra210_spdif_runtime_suspend(struct device *dev)
 
        regcache_cache_only(spdif->regmap, true);
 
-#ifndef CONFIG_MACH_GRENADA
        clk_disable_unprepare(spdif->clk_spdif_out);
        clk_disable_unprepare(spdif->clk_spdif_in);
-#endif
 
        return 0;
 }
@@ -55,7 +53,6 @@ static int tegra210_spdif_runtime_resume(struct device *dev)
        struct tegra210_spdif *spdif = dev_get_drvdata(dev);
        int ret = 0;
 
-#ifndef CONFIG_MACH_GRENADA
        ret = clk_prepare_enable(spdif->clk_spdif_out);
        if (ret) {
                dev_err(dev, "spdif_out_clk_enable failed: %d\n", ret);
@@ -67,7 +64,6 @@ static int tegra210_spdif_runtime_resume(struct device *dev)
                dev_err(dev, "spdif_in_clk_enable failed: %d\n", ret);
                return ret;
        }
-#endif
 
        regcache_cache_only(spdif->regmap, false);
 
@@ -77,7 +73,6 @@ static int tegra210_spdif_runtime_resume(struct device *dev)
 static int tegra210_spdif_set_dai_sysclk(struct snd_soc_dai *dai,
                int clk_id, unsigned int freq, int dir)
 {
-#ifndef CONFIG_MACH_GRENADA
        struct device *dev = dai->dev;
        struct tegra210_spdif *spdif = snd_soc_dai_get_drvdata(dai);
        int spdif_out_clock_rate, spdif_in_clock_rate;
@@ -131,7 +126,6 @@ static int tegra210_spdif_set_dai_sysclk(struct snd_soc_dai *dai,
                        return ret;
                }
        }
-#endif
 
        return 0;
 }
@@ -361,7 +355,6 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev)
 
        spdif->soc_data = soc_data;
 
-       #ifndef CONFIG_MACH_GRENADA
        spdif->clk_spdif_out = devm_clk_get(&pdev->dev, "spdif_out");
        if (IS_ERR(spdif->clk_spdif_out)) {
                dev_err(&pdev->dev, "Can't retrieve spdif clock\n");
@@ -375,7 +368,6 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev)
                ret = PTR_ERR(spdif->clk_spdif_in);
                goto err_spdif_out_clk_put;
        }
-       #endif
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
@@ -440,26 +432,16 @@ err_suspend:
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
 err_spdif_in_clk_put:
-#ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, spdif->clk_spdif_in);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
-#ifndef CONFIG_MACH_GRENADA
 err_spdif_out_clk_put:
        devm_clk_put(&pdev->dev, spdif->clk_spdif_out);
-#else
-       dev_err(&pdev->dev, "error\n");
-#endif
 err:
        return ret;
 }
 
 static int tegra210_spdif_platform_remove(struct platform_device *pdev)
 {
-       #ifndef CONFIG_MACH_GRENADA
        struct tegra210_spdif *spdif = dev_get_drvdata(&pdev->dev);
-       #endif
 
        snd_soc_unregister_codec(&pdev->dev);
 
@@ -467,10 +449,8 @@ static int tegra210_spdif_platform_remove(struct platform_device *pdev)
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra210_spdif_runtime_suspend(&pdev->dev);
 
-       #ifndef CONFIG_MACH_GRENADA
        devm_clk_put(&pdev->dev, spdif->clk_spdif_out);
        devm_clk_put(&pdev->dev, spdif->clk_spdif_in);
-       #endif
 
        return 0;
 }