ANDROID: Revert "ANDROID: ASoC: core - add hostless DAI support"
It causes too many conflicts with the 5.7-rc1 merge, it needs to be added back later, if this really is still needed. Given that it is not upstream, I doubt it really is needed anymore... Bug: 144369166 Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Patrick Lai <plai@codeaurora.org> Cc: Banajit Goswami <bgoswami@codeaurora.org> Cc: Meng Wang <mwang@codeaurora.org> Cc: Gopikrishnaiah Anandan <agopik@codeaurora.org> Cc: Neema Shetty <nshetty@codeaurora.org> Cc: Vidyakumar Athota <vathota@codeaurora.org> Cc: Anish Kumar <kanish@codeaurora.org> Cc: Shiv Maliyappanahalli <smaliyap@codeaurora.org> Cc: Sudheer Papothi <spapothi@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Iafa9f1e6f76e0a16945867070aab2c9916f7a450
This commit is contained in:
@@ -480,7 +480,6 @@ struct snd_pcm_substream {
|
||||
/* misc flags */
|
||||
unsigned int hw_opened: 1;
|
||||
unsigned int managed_buffer_alloc:1;
|
||||
unsigned int hw_no_buffer: 1; /* substream may not have a buffer */
|
||||
};
|
||||
|
||||
#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
|
||||
|
||||
@@ -376,10 +376,6 @@
|
||||
#define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \
|
||||
const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts)
|
||||
|
||||
/* DAI Link Host Mode Support */
|
||||
#define SND_SOC_DAI_LINK_NO_HOST 0x1
|
||||
#define SND_SOC_DAI_LINK_OPT_HOST 0x2
|
||||
|
||||
/*
|
||||
* Bias levels
|
||||
*
|
||||
@@ -731,7 +727,6 @@ struct snd_soc_pcm_stream {
|
||||
unsigned int channels_min; /* min channels */
|
||||
unsigned int channels_max; /* max channels */
|
||||
unsigned int sig_bits; /* number of bits of content */
|
||||
const char *aif_name; /* DAPM AIF widget name */
|
||||
};
|
||||
|
||||
/* SoC audio ops */
|
||||
@@ -838,12 +833,6 @@ struct snd_soc_dai_link {
|
||||
/* This DAI link can route to other DAI links at runtime (Frontend)*/
|
||||
unsigned int dynamic:1;
|
||||
|
||||
/*
|
||||
* This DAI can support no host IO (no pcm data is
|
||||
* copied to from host)
|
||||
*/
|
||||
unsigned int no_host_mode:2;
|
||||
|
||||
/* DPCM capture and Playback support */
|
||||
unsigned int dpcm_capture:1;
|
||||
unsigned int dpcm_playback:1;
|
||||
|
||||
@@ -2060,8 +2060,6 @@ static int pcm_sanity_check(struct snd_pcm_substream *substream)
|
||||
struct snd_pcm_runtime *runtime;
|
||||
if (PCM_RUNTIME_CHECK(substream))
|
||||
return -ENXIO;
|
||||
if (substream->hw_no_buffer)
|
||||
snd_printd("%s: warning this PCM is host less\n", __func__);
|
||||
runtime = substream->runtime;
|
||||
if (snd_BUG_ON(!substream->ops->copy_user && !runtime->dma_area))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1322,7 +1322,6 @@ static int snd_pcm_pre_start(struct snd_pcm_substream *substream,
|
||||
if (runtime->status->state != SNDRV_PCM_STATE_PREPARED)
|
||||
return -EBADFD;
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
|
||||
!substream->hw_no_buffer &&
|
||||
!snd_pcm_playback_data(substream))
|
||||
return -EPIPE;
|
||||
runtime->trigger_tstamp_latched = false;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/pcm_params.h>
|
||||
@@ -29,27 +28,6 @@
|
||||
|
||||
#define DPCM_MAX_BE_USERS 8
|
||||
|
||||
/* ASoC no host IO hardware */
|
||||
static const struct snd_pcm_hardware no_host_hardware = {
|
||||
.info = SNDRV_PCM_INFO_MMAP |
|
||||
SNDRV_PCM_INFO_MMAP_VALID |
|
||||
SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_PAUSE |
|
||||
SNDRV_PCM_INFO_RESUME,
|
||||
.formats = SNDRV_PCM_FMTBIT_S16_LE |
|
||||
SNDRV_PCM_FMTBIT_S32_LE,
|
||||
.period_bytes_min = PAGE_SIZE >> 2,
|
||||
.period_bytes_max = PAGE_SIZE >> 1,
|
||||
.periods_min = 2,
|
||||
.periods_max = 4,
|
||||
/*
|
||||
* Increase the max buffer bytes as PAGE_SIZE bytes is
|
||||
* not enough to encompass all the scenarios sent by
|
||||
* userspapce.
|
||||
*/
|
||||
.buffer_bytes_max = PAGE_SIZE * 4,
|
||||
};
|
||||
|
||||
static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
@@ -211,8 +189,6 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
|
||||
const struct snd_pcm_hardware *hw)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
if (!runtime)
|
||||
return 0;
|
||||
runtime->hw.info = hw->info;
|
||||
runtime->hw.formats = hw->formats;
|
||||
runtime->hw.period_bytes_min = hw->period_bytes_min;
|
||||
@@ -573,9 +549,6 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
|
||||
|
||||
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
|
||||
|
||||
if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST)
|
||||
snd_soc_set_runtime_hwparams(substream, &no_host_hardware);
|
||||
|
||||
/* startup the audio subsystem */
|
||||
ret = snd_soc_dai_startup(cpu_dai, substream);
|
||||
if (ret < 0) {
|
||||
@@ -881,16 +854,6 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/* perform any hw_params fixups */
|
||||
if ((rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) &&
|
||||
rtd->dai_link->be_hw_params_fixup) {
|
||||
ret = rtd->dai_link->be_hw_params_fixup(rtd,
|
||||
params);
|
||||
if (ret < 0)
|
||||
dev_err(rtd->card->dev, "ASoC: fixup failed for %s\n",
|
||||
rtd->dai_link->name);
|
||||
}
|
||||
|
||||
if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) {
|
||||
ret = rtd->dai_link->ops->hw_params(substream, params);
|
||||
if (ret < 0) {
|
||||
@@ -977,20 +940,6 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
}
|
||||
component = NULL;
|
||||
|
||||
/* malloc a page for hostless IO */
|
||||
if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) {
|
||||
substream->dma_buffer.dev.type = SNDRV_DMA_TYPE_DEV;
|
||||
substream->dma_buffer.dev.dev = rtd->dev;
|
||||
substream->dma_buffer.dev.dev->coherent_dma_mask =
|
||||
DMA_BIT_MASK(sizeof(dma_addr_t) * 8);
|
||||
substream->dma_buffer.private_data = NULL;
|
||||
|
||||
arch_setup_dma_ops(substream->dma_buffer.dev.dev,
|
||||
0, 0, NULL, 0);
|
||||
ret = snd_pcm_lib_malloc_pages(substream, PAGE_SIZE);
|
||||
if (ret < 0)
|
||||
goto component_err;
|
||||
}
|
||||
out:
|
||||
mutex_unlock(&rtd->card->pcm_mutex);
|
||||
return ret;
|
||||
@@ -1071,8 +1020,6 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
|
||||
|
||||
snd_soc_dai_hw_free(cpu_dai, substream);
|
||||
|
||||
if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST)
|
||||
snd_pcm_lib_free_pages(substream);
|
||||
mutex_unlock(&rtd->card->pcm_mutex);
|
||||
return 0;
|
||||
}
|
||||
@@ -2941,7 +2888,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
|
||||
struct snd_soc_component *component;
|
||||
struct snd_pcm *pcm;
|
||||
struct snd_pcm_str *stream;
|
||||
char new_name[64];
|
||||
int ret = 0, playback = 0, capture = 0;
|
||||
int i;
|
||||
@@ -3030,22 +2976,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* setup any hostless PCMs - i.e. no host IO is performed */
|
||||
if (rtd->dai_link->no_host_mode) {
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
|
||||
stream = &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK];
|
||||
stream->substream->hw_no_buffer = 1;
|
||||
snd_soc_set_runtime_hwparams(stream->substream,
|
||||
&no_host_hardware);
|
||||
}
|
||||
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
|
||||
stream = &pcm->streams[SNDRV_PCM_STREAM_CAPTURE];
|
||||
stream->substream->hw_no_buffer = 1;
|
||||
snd_soc_set_runtime_hwparams(stream->substream,
|
||||
&no_host_hardware);
|
||||
}
|
||||
}
|
||||
|
||||
/* ASoC PCM operations */
|
||||
if (rtd->dai_link->dynamic) {
|
||||
rtd->ops.open = dpcm_fe_dai_open;
|
||||
|
||||
Reference in New Issue
Block a user