From 3cc29c8795bc604e91e5fb467c5cccb86cc9409c Mon Sep 17 00:00:00 2001 From: Viraj Karandikar Date: Tue, 16 Sep 2014 16:53:31 +0530 Subject: [PATCH] ASoC: tegra-alt: don't init ADSP at boot Do not initialize ADSP using work queue. Initialization will be done from userspace by setting mixer control "ADSP init" to 1. Bug 1552863 Change-Id: I0fd435b581a4fb9e851e8505e451c52cf0746df2 Signed-off-by: Viraj Karandikar Reviewed-on: http://git-master/r/499313 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sumit Bhattacharya --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 29 +++---------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index 74571a52..a8743ee5 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -104,7 +103,6 @@ struct tegra210_adsp_compr_rtd { struct tegra210_adsp { struct device *dev; - struct work_struct work; struct tegra210_adsp_app apps[TEGRA210_ADSP_VIRT_REG_MAX]; atomic_t reg_val[TEGRA210_ADSP_VIRT_REG_MAX]; DECLARE_BITMAP(adma_usage, TEGRA210_ADSP_ADMA_CHANNEL_COUNT); @@ -323,24 +321,6 @@ static void tegra210_adsp_deinit(struct tegra210_adsp *adsp) mutex_unlock(&adsp->mutex); } -static void tegra210_adsp_init_work(struct work_struct *work) -{ - struct tegra210_adsp *adsp = - container_of(work, struct tegra210_adsp, work); - int retry = 10; - int ret = 0; - - while (retry) { - ret = tegra210_adsp_init(adsp); - if (!ret) - break; - - dev_warn(adsp->dev, "Failed to load adsp OS. Will retry."); - msleep(5000); - retry--; - } -} - /* ADSP-CPU message send-receive utility functions */ static int tegra210_adsp_get_msg(apm_shared_state_t *apm, apm_msg_t *apm_msg) { @@ -1428,6 +1408,9 @@ static int tegra210_adsp_mux_put(struct snd_kcontrol *kcontrol, uint32_t cur_val = 0; int ret = 0; + if (!adsp->init_done) + return -ENODEV; + /* Init or de-init app based on connection */ if (IS_ADSP_APP(e->reg)) { app = &adsp->apps[e->reg]; @@ -1973,8 +1956,6 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev) } /* HACK end */ - INIT_WORK(&adsp->work, tegra210_adsp_init_work); - for (i = 0; i < TEGRA210_ADSP_VIRT_REG_MAX; i++) adsp->apps[i].reg = i; @@ -2005,10 +1986,6 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev) goto err_unregister_platform; } -#if ENABLE_ADSP - schedule_work(&adsp->work); -#endif - pr_info("tegra210_adsp_audio_platform_probe probe successfull."); return 0;