Revert "ASoC: Intel/SOF: use set_stream() instead of set_tdm_slots() for HDAudio"
This reverts commit 185c141946
which is
commit 636110411ca726f19ef8e87b0be51bb9a4cdef06 upstream.
The api used here is going away as it breaks the Android kernel api and
isn't needed at this point in time. If it is needed in the future it
can come back in an abi-safe way.
Bug: 161946584
Change-Id: I6946ab6122a67c16af8ac3931633b8c57e9738df
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -46,8 +46,9 @@ static int hdac_hda_dai_hw_params(struct snd_pcm_substream *substream,
|
|||||||
struct snd_soc_dai *dai);
|
struct snd_soc_dai *dai);
|
||||||
static int hdac_hda_dai_hw_free(struct snd_pcm_substream *substream,
|
static int hdac_hda_dai_hw_free(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *dai);
|
struct snd_soc_dai *dai);
|
||||||
static int hdac_hda_dai_set_stream(struct snd_soc_dai *dai, void *stream,
|
static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
|
||||||
int direction);
|
unsigned int tx_mask, unsigned int rx_mask,
|
||||||
|
int slots, int slot_width);
|
||||||
static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt,
|
static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt,
|
||||||
struct snd_soc_dai *dai);
|
struct snd_soc_dai *dai);
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ static const struct snd_soc_dai_ops hdac_hda_dai_ops = {
|
|||||||
.prepare = hdac_hda_dai_prepare,
|
.prepare = hdac_hda_dai_prepare,
|
||||||
.hw_params = hdac_hda_dai_hw_params,
|
.hw_params = hdac_hda_dai_hw_params,
|
||||||
.hw_free = hdac_hda_dai_hw_free,
|
.hw_free = hdac_hda_dai_hw_free,
|
||||||
.set_stream = hdac_hda_dai_set_stream,
|
.set_tdm_slot = hdac_hda_dai_set_tdm_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_dai_driver hdac_hda_dais[] = {
|
static struct snd_soc_dai_driver hdac_hda_dais[] = {
|
||||||
@@ -179,22 +180,21 @@ static struct snd_soc_dai_driver hdac_hda_dais[] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int hdac_hda_dai_set_stream(struct snd_soc_dai *dai,
|
static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
|
||||||
void *stream, int direction)
|
unsigned int tx_mask, unsigned int rx_mask,
|
||||||
|
int slots, int slot_width)
|
||||||
{
|
{
|
||||||
struct snd_soc_component *component = dai->component;
|
struct snd_soc_component *component = dai->component;
|
||||||
struct hdac_hda_priv *hda_pvt;
|
struct hdac_hda_priv *hda_pvt;
|
||||||
struct hdac_hda_pcm *pcm;
|
struct hdac_hda_pcm *pcm;
|
||||||
struct hdac_stream *hstream;
|
|
||||||
|
|
||||||
if (!stream)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
hda_pvt = snd_soc_component_get_drvdata(component);
|
hda_pvt = snd_soc_component_get_drvdata(component);
|
||||||
pcm = &hda_pvt->pcm[dai->id];
|
pcm = &hda_pvt->pcm[dai->id];
|
||||||
hstream = (struct hdac_stream *)stream;
|
|
||||||
|
|
||||||
pcm->stream_tag[direction] = hstream->stream_tag;
|
if (tx_mask)
|
||||||
|
pcm->stream_tag[SNDRV_PCM_STREAM_PLAYBACK] = tx_mask;
|
||||||
|
else
|
||||||
|
pcm->stream_tag[SNDRV_PCM_STREAM_CAPTURE] = rx_mask;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -563,8 +563,11 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,
|
|||||||
|
|
||||||
stream_tag = hdac_stream(link_dev)->stream_tag;
|
stream_tag = hdac_stream(link_dev)->stream_tag;
|
||||||
|
|
||||||
/* set the hdac_stream in the codec dai */
|
/* set the stream tag in the codec dai dma params */
|
||||||
snd_soc_dai_set_stream(codec_dai, hdac_stream(link_dev), substream->stream);
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||||
|
snd_soc_dai_set_tdm_slot(codec_dai, stream_tag, 0, 0, 0);
|
||||||
|
else
|
||||||
|
snd_soc_dai_set_tdm_slot(codec_dai, 0, stream_tag, 0, 0);
|
||||||
|
|
||||||
p_params.s_fmt = snd_pcm_format_width(params_format(params));
|
p_params.s_fmt = snd_pcm_format_width(params_format(params));
|
||||||
p_params.ch = params_channels(params);
|
p_params.ch = params_channels(params);
|
||||||
|
@@ -236,8 +236,11 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,
|
|||||||
if (!link)
|
if (!link)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* set the hdac_stream in the codec dai */
|
/* set the stream tag in the codec dai dma params */
|
||||||
snd_soc_dai_set_stream(codec_dai, hdac_stream(link_dev), substream->stream);
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||||
|
snd_soc_dai_set_tdm_slot(codec_dai, stream_tag, 0, 0, 0);
|
||||||
|
else
|
||||||
|
snd_soc_dai_set_tdm_slot(codec_dai, 0, stream_tag, 0, 0);
|
||||||
|
|
||||||
p_params.s_fmt = snd_pcm_format_width(params_format(params));
|
p_params.s_fmt = snd_pcm_format_width(params_format(params));
|
||||||
p_params.ch = params_channels(params);
|
p_params.ch = params_channels(params);
|
||||||
|
Reference in New Issue
Block a user