Commit 00b6cd95 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ALSA/ASoC: hda: ext: remove 'link' prefix for stream-related operations

We should only use 'link' in the context of multi-link
configurations. Streams are configured from a different register space
and are not dependent on link except for LOSIDV settings.

Not functionality change, just pure rename.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221019162115.185917-7-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 7f05ca9a
......@@ -100,10 +100,10 @@ int snd_hdac_ext_stream_set_dpibr(struct hdac_bus *bus,
struct hdac_ext_stream *hext_stream, u32 value);
int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *hext_stream, u32 value);
void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hext_stream);
void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hext_stream);
void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hext_stream);
int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *hext_stream, int fmt);
void snd_hdac_ext_stream_start(struct hdac_ext_stream *hext_stream);
void snd_hdac_ext_stream_clear(struct hdac_ext_stream *hext_stream);
void snd_hdac_ext_stream_reset(struct hdac_ext_stream *hext_stream);
int snd_hdac_ext_stream_setup(struct hdac_ext_stream *hext_stream, int fmt);
struct hdac_ext_link {
struct hdac_bus *bus;
......
......@@ -140,36 +140,36 @@ void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_decouple);
/**
* snd_hdac_ext_link_stream_start - start a stream
* snd_hdac_ext_stream_start - start a stream
* @hext_stream: HD-audio ext core stream to start
*/
void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hext_stream)
void snd_hdac_ext_stream_start(struct hdac_ext_stream *hext_stream)
{
snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL,
AZX_PPLCCTL_RUN, AZX_PPLCCTL_RUN);
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_start);
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_start);
/**
* snd_hdac_ext_link_stream_clear - stop a stream DMA
* snd_hdac_ext_stream_clear - stop a stream DMA
* @hext_stream: HD-audio ext core stream to stop
*/
void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hext_stream)
void snd_hdac_ext_stream_clear(struct hdac_ext_stream *hext_stream)
{
snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL, AZX_PPLCCTL_RUN, 0);
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_clear);
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_clear);
/**
* snd_hdac_ext_link_stream_reset - reset a stream
* snd_hdac_ext_stream_reset - reset a stream
* @hext_stream: HD-audio ext core stream to reset
*/
void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hext_stream)
void snd_hdac_ext_stream_reset(struct hdac_ext_stream *hext_stream)
{
unsigned char val;
int timeout;
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
snd_hdac_updatel(hext_stream->pplc_addr, AZX_REG_PPLCCTL,
AZX_PPLCCTL_STRST, AZX_PPLCCTL_STRST);
......@@ -196,20 +196,20 @@ void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hext_stream)
} while (--timeout);
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_reset);
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_reset);
/**
* snd_hdac_ext_link_stream_setup - set up the SD for streaming
* snd_hdac_ext_stream_setup - set up the SD for streaming
* @hext_stream: HD-audio ext core stream to set up
* @fmt: stream format
*/
int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *hext_stream, int fmt)
int snd_hdac_ext_stream_setup(struct hdac_ext_stream *hext_stream, int fmt)
{
struct hdac_stream *hstream = &hext_stream->hstream;
unsigned int val;
/* make sure the run bit is zero for SD */
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
/* program the stream_tag */
val = readl(hext_stream->pplc_addr + AZX_REG_PPLCCTL);
val = (val & ~AZX_PPLCCTL_STRM_MASK) |
......@@ -221,7 +221,7 @@ int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *hext_stream, int fmt)
return 0;
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_stream_setup);
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_setup);
/**
* snd_hdac_ext_link_set_stream_id - maps stream id to link output
......
......@@ -322,8 +322,8 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
runtime->sample_bits, 0);
snd_hdac_ext_stream_decouple(bus, link_stream, true);
snd_hdac_ext_link_stream_reset(link_stream);
snd_hdac_ext_link_stream_setup(link_stream, format_val);
snd_hdac_ext_stream_reset(link_stream);
snd_hdac_ext_stream_setup(link_stream, format_val);
link = snd_hdac_ext_bus_get_hlink_by_addr(bus, codec->core.addr);
if (!link)
......@@ -355,7 +355,7 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
snd_hdac_ext_link_stream_start(link_stream);
snd_hdac_ext_stream_start(link_stream);
ret = avs_path_run(data->path, AVS_TPLG_TRIGGER_AUTO);
if (ret < 0)
......@@ -368,7 +368,7 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
if (ret < 0)
dev_err(dai->dev, "pause BE path failed: %d\n", ret);
snd_hdac_ext_link_stream_clear(link_stream);
snd_hdac_ext_stream_clear(link_stream);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
ret = avs_path_reset(data->path);
......
......@@ -190,9 +190,9 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params)
dev_dbg(dev, "format_val=%d, rate=%d, ch=%d, format=%d\n",
format_val, params->s_freq, params->ch, params->format);
snd_hdac_ext_link_stream_reset(stream);
snd_hdac_ext_stream_reset(stream);
snd_hdac_ext_link_stream_setup(stream, format_val);
snd_hdac_ext_stream_setup(stream, format_val);
stream_tag = hstream->stream_tag;
if (stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) {
......@@ -612,13 +612,13 @@ static int skl_link_pcm_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
snd_hdac_ext_link_stream_start(link_dev);
snd_hdac_ext_stream_start(link_dev);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
snd_hdac_ext_link_stream_clear(link_dev);
snd_hdac_ext_stream_clear(link_dev);
if (cmd == SNDRV_PCM_TRIGGER_SUSPEND)
snd_hdac_ext_stream_decouple(bus, stream, false);
break;
......
......@@ -154,7 +154,7 @@ static int hda_link_dma_cleanup(struct snd_pcm_substream *substream,
return -EINVAL;
if (trigger_suspend_stop)
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
stream_tag = hdac_stream(hext_stream)->stream_tag;
......@@ -180,7 +180,7 @@ static int hda_link_dma_params(struct hdac_ext_stream *hext_stream,
struct hdac_ext_link *hlink;
unsigned int format_val;
snd_hdac_ext_link_stream_reset(hext_stream);
snd_hdac_ext_stream_reset(hext_stream);
format_val = snd_hdac_calc_stream_format(params->s_freq, params->ch,
params->format,
......@@ -189,7 +189,7 @@ static int hda_link_dma_params(struct hdac_ext_stream *hext_stream,
dev_dbg(bus->dev, "format_val=%d, rate=%d, ch=%d, format=%d\n",
format_val, params->s_freq, params->ch, params->format);
snd_hdac_ext_link_stream_setup(hext_stream, format_val);
snd_hdac_ext_stream_setup(hext_stream, format_val);
if (hext_stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) {
list_for_each_entry(hlink, &bus->hlink_list, list) {
......@@ -270,7 +270,7 @@ static int hda_link_dma_trigger(struct snd_pcm_substream *substream, int cmd)
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
snd_hdac_ext_link_stream_start(hext_stream);
snd_hdac_ext_stream_start(hext_stream);
break;
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
......@@ -280,7 +280,7 @@ static int hda_link_dma_trigger(struct snd_pcm_substream *substream, int cmd)
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
break;
default:
......@@ -476,7 +476,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
snd_hdac_ext_link_stream_start(hext_stream);
snd_hdac_ext_stream_start(hext_stream);
break;
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
......@@ -491,7 +491,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream,
pipeline->state = SOF_IPC4_PIPE_PAUSED;
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id,
SOF_IPC4_PIPE_RESET);
......@@ -519,7 +519,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream,
pipeline->state = SOF_IPC4_PIPE_PAUSED;
snd_hdac_ext_link_stream_clear(hext_stream);
snd_hdac_ext_stream_clear(hext_stream);
break;
}
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment