Commit 6d23c8f5 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Move prepared flag into struct hdac_stream

This flag seems used commonly, so deserves to be located there.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0a50575b
...@@ -390,6 +390,7 @@ struct hdac_stream { ...@@ -390,6 +390,7 @@ struct hdac_stream {
bool opened:1; bool opened:1;
bool running:1; bool running:1;
bool prepared:1;
bool no_period_wakeup:1; bool no_period_wakeup:1;
bool locked:1; bool locked:1;
......
...@@ -145,7 +145,7 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -145,7 +145,7 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream)
snd_hda_codec_cleanup(apcm->codec, hinfo, substream); snd_hda_codec_cleanup(apcm->codec, hinfo, substream);
err = chip->ops->substream_free_pages(chip, substream); err = chip->ops->substream_free_pages(chip, substream);
azx_dev->prepared = 0; azx_stream(azx_dev)->prepared = 0;
dsp_unlock(azx_dev); dsp_unlock(azx_dev);
return err; return err;
} }
...@@ -214,7 +214,7 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream) ...@@ -214,7 +214,7 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
unlock: unlock:
if (!err) if (!err)
azx_dev->prepared = 1; azx_stream(azx_dev)->prepared = 1;
dsp_unlock(azx_dev); dsp_unlock(azx_dev);
return err; return err;
} }
...@@ -240,7 +240,7 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -240,7 +240,7 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
else else
sync_reg = AZX_REG_SSYNC; sync_reg = AZX_REG_SSYNC;
if (dsp_is_locked(azx_dev) || !azx_dev->prepared) if (dsp_is_locked(azx_dev) || !hstr->prepared)
return -EPIPE; return -EPIPE;
switch (cmd) { switch (cmd) {
...@@ -843,7 +843,7 @@ int snd_hda_codec_load_dsp_prepare(struct hda_codec *codec, unsigned int format, ...@@ -843,7 +843,7 @@ int snd_hda_codec_load_dsp_prepare(struct hda_codec *codec, unsigned int format,
return err; return err;
} }
azx_dev->prepared = 0; hstr->prepared = 0;
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_load_dsp_prepare); EXPORT_SYMBOL_GPL(snd_hda_codec_load_dsp_prepare);
......
...@@ -62,7 +62,6 @@ struct azx_dev { ...@@ -62,7 +62,6 @@ struct azx_dev {
struct hdac_stream core; struct hdac_stream core;
unsigned int irq_pending:1; unsigned int irq_pending:1;
unsigned int prepared:1;
/* /*
* For VIA: * For VIA:
* A flag to ensure DMA position is 0 * A flag to ensure DMA position is 0
......
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