mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 01:31:30 +03:00
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 <vkarandikar@nvidia.com> Reviewed-on: http://git-master/r/499313 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
193082c2b1
commit
3cc29c8795
@@ -34,7 +34,6 @@
|
|||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
#include <linux/workqueue.h>
|
|
||||||
#include <linux/tegra_nvadsp.h>
|
#include <linux/tegra_nvadsp.h>
|
||||||
#include <linux/irqchip/tegra-agic.h>
|
#include <linux/irqchip/tegra-agic.h>
|
||||||
|
|
||||||
@@ -104,7 +103,6 @@ struct tegra210_adsp_compr_rtd {
|
|||||||
|
|
||||||
struct tegra210_adsp {
|
struct tegra210_adsp {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct work_struct work;
|
|
||||||
struct tegra210_adsp_app apps[TEGRA210_ADSP_VIRT_REG_MAX];
|
struct tegra210_adsp_app apps[TEGRA210_ADSP_VIRT_REG_MAX];
|
||||||
atomic_t reg_val[TEGRA210_ADSP_VIRT_REG_MAX];
|
atomic_t reg_val[TEGRA210_ADSP_VIRT_REG_MAX];
|
||||||
DECLARE_BITMAP(adma_usage, TEGRA210_ADSP_ADMA_CHANNEL_COUNT);
|
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);
|
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 */
|
/* ADSP-CPU message send-receive utility functions */
|
||||||
static int tegra210_adsp_get_msg(apm_shared_state_t *apm, apm_msg_t *apm_msg)
|
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;
|
uint32_t cur_val = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (!adsp->init_done)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
/* Init or de-init app based on connection */
|
/* Init or de-init app based on connection */
|
||||||
if (IS_ADSP_APP(e->reg)) {
|
if (IS_ADSP_APP(e->reg)) {
|
||||||
app = &adsp->apps[e->reg];
|
app = &adsp->apps[e->reg];
|
||||||
@@ -1973,8 +1956,6 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
/* HACK end */
|
/* HACK end */
|
||||||
|
|
||||||
INIT_WORK(&adsp->work, tegra210_adsp_init_work);
|
|
||||||
|
|
||||||
for (i = 0; i < TEGRA210_ADSP_VIRT_REG_MAX; i++)
|
for (i = 0; i < TEGRA210_ADSP_VIRT_REG_MAX; i++)
|
||||||
adsp->apps[i].reg = 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;
|
goto err_unregister_platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_ADSP
|
|
||||||
schedule_work(&adsp->work);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pr_info("tegra210_adsp_audio_platform_probe probe successfull.");
|
pr_info("tegra210_adsp_audio_platform_probe probe successfull.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user