mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
ASoC: tegra-alt: Support adma iso client
Support adma as a part iso client to calculate the adma bandwidth based on the usecase on both cpu and adsp side. This will help the iso manager to alter the emc frequency. Bug 1675078 Change-Id: I301aa710929665ea56f8183de8d22851913afa9c Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: http://git-master/r/924061 Reviewed-by: Ayoosh Bansal <ayooshb@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
287853b54f
commit
2f07906bd0
@@ -7,6 +7,7 @@ snd-soc-tegra-alt-pcm-objs := tegra_pcm_alt.o
|
||||
snd-soc-tegra-alt-utils-objs := tegra_asoc_utils_alt.o
|
||||
snd-soc-tegra-alt-hwdep-objs := tegra_asoc_hwdep_alt.o
|
||||
snd-soc-tegra-alt-machine-objs := tegra_asoc_machine_alt.o
|
||||
snd-soc-tegra-alt-isomgr-objs := tegra_isomgr_bw_alt.o
|
||||
snd-soc-tegra30-alt-apbif-objs := tegra30_apbif_alt.o
|
||||
snd-soc-tegra30-alt-xbar-objs := tegra30_xbar_alt.o
|
||||
snd-soc-tegra30-alt-i2s-objs := tegra30_i2s_alt.o
|
||||
@@ -36,6 +37,7 @@ snd-soc-tegra210-alt-fpga-clock-objs := ahub_unit_fpga_clock.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ALT) += snd-soc-tegra-alt-utils.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ALT) += snd-soc-tegra-alt-pcm.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ALT) += snd-soc-tegra210-alt-fpga-clock.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ALT) += snd-soc-tegra-alt-isomgr.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ASOC_HWDEP_ALT) += snd-soc-tegra-alt-hwdep.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA_ASOC_MACHINE_ALT) += snd-soc-tegra-alt-machine.o
|
||||
obj-$(CONFIG_SND_SOC_TEGRA30_APBIF_ALT) += snd-soc-tegra30-alt-apbif.o
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "tegra_pcm_alt.h"
|
||||
#include "tegra210_xbar_alt.h"
|
||||
#include "tegra_isomgr_bw_alt.h"
|
||||
#if defined(CONFIG_ARCH_TEGRA_18x_SOC)
|
||||
#include <sound/tegra_audio.h>
|
||||
#endif
|
||||
@@ -287,6 +288,26 @@ static int tegra210_admaif_set_pack_mode(struct regmap *map, unsigned int reg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra210_admaif_prepare(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
tegra_isomgr_adma_setbw(substream, true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra210_admaif_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tegra210_admaif_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
tegra_isomgr_adma_setbw(substream, false);
|
||||
}
|
||||
|
||||
static int tegra210_admaif_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai)
|
||||
@@ -463,6 +484,9 @@ static int tegra210_admaif_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
|
||||
.hw_params = tegra210_admaif_hw_params,
|
||||
.trigger = tegra210_admaif_trigger,
|
||||
.startup = tegra210_admaif_startup,
|
||||
.shutdown = tegra210_admaif_shutdown,
|
||||
.prepare = tegra210_admaif_prepare,
|
||||
};
|
||||
|
||||
static int tegra210_admaif_get_channels(struct snd_kcontrol *kcontrol,
|
||||
@@ -857,6 +881,8 @@ static int tegra210_admaif_probe(struct platform_device *pdev)
|
||||
goto err_pm_disable;
|
||||
}
|
||||
|
||||
tegra_isomgr_adma_register();
|
||||
|
||||
for (i = 0; i < admaif->soc_data->num_ch; i++) {
|
||||
admaif->playback_dma_data[i].addr = res->start +
|
||||
TEGRA210_ADMAIF_XBAR_TX_FIFO_WRITE +
|
||||
@@ -940,6 +966,8 @@ err:
|
||||
|
||||
static int tegra210_admaif_remove(struct platform_device *pdev)
|
||||
{
|
||||
tegra_isomgr_adma_unregister();
|
||||
|
||||
snd_soc_unregister_component(&pdev->dev);
|
||||
|
||||
snd_soc_unregister_codec(&pdev->dev);
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <sound/tegra_nvfx.h>
|
||||
#include <sound/tegra_nvfx_apm.h>
|
||||
#include <sound/tegra_nvfx_plugin.h>
|
||||
#include "tegra_isomgr_bw_alt.h"
|
||||
|
||||
#include "tegra210_adsp_alt.h"
|
||||
|
||||
@@ -1308,6 +1309,8 @@ static int tegra210_adsp_pcm_open(struct snd_pcm_substream *substream)
|
||||
|
||||
dev_vdbg(adsp->dev, "%s", __func__);
|
||||
|
||||
tegra_isomgr_adma_setbw(substream, true);
|
||||
|
||||
if (!adsp->pcm_path[fe_reg][substream->stream].fe_reg ||
|
||||
!adsp->pcm_path[fe_reg][substream->stream].be_reg) {
|
||||
dev_err(adsp->dev, "Broken Path%d - FE not linked to BE", fe_reg);
|
||||
@@ -1377,6 +1380,8 @@ static int tegra210_adsp_pcm_close(struct snd_pcm_substream *substream)
|
||||
|
||||
dev_vdbg(prtd->dev, "%s", __func__);
|
||||
|
||||
tegra_isomgr_adma_setbw(substream, false);
|
||||
|
||||
if (prtd) {
|
||||
tegra210_adsp_send_reset_msg(prtd->fe_apm,
|
||||
TEGRA210_ADSP_MSG_FLAG_SEND);
|
||||
|
||||
Reference in New Issue
Block a user