{
struct snd_intelhad *intelhaddata;
struct snd_pcm_runtime *runtime;
- struct had_stream_data *had_stream;
int retval;
intelhaddata = snd_pcm_substream_chip(substream);
- had_stream = &intelhaddata->stream_data;
runtime = substream->runtime;
intelhaddata->underrun_count = 0;
{
int retval = 0;
struct snd_intelhad *intelhaddata;
- struct had_stream_data *had_stream;
intelhaddata = snd_pcm_substream_chip(substream);
- had_stream = &intelhaddata->stream_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
break;
}
- had_stream->stream_type = HAD_RUNNING_STREAM;
+ intelhaddata->stream_info.running = true;
/* Enable Audio */
snd_intelhad_enable_audio_int(intelhaddata, true);
/* Stop reporting BUFFER_DONE/UNDERRUN to above layers */
- had_stream->stream_type = HAD_INIT;
+ intelhaddata->stream_info.running = false;
spin_unlock(&intelhaddata->had_spinlock);
/* Disable Audio */
snd_intelhad_enable_audio_int(intelhaddata, false);
u32 link_rate = 0;
struct snd_intelhad *intelhaddata;
struct snd_pcm_runtime *runtime;
- struct had_stream_data *had_stream;
intelhaddata = snd_pcm_substream_chip(substream);
runtime = substream->runtime;
- had_stream = &intelhaddata->stream_data;
if (intelhaddata->drv_status == HAD_DRV_DISCONNECTED) {
dev_dbg(intelhaddata->dev, "%s: HDMI cable plugged-out\n",
int i, intr_count = 0;
enum intel_had_aud_buf_type buff_done;
u32 buf_size, buf_addr;
- struct had_stream_data *had_stream;
-
- had_stream = &intelhaddata->stream_data;
buff_done = buf_id;
struct pcm_stream_info *stream;
struct snd_pcm_substream *substream;
u32 buf_size;
- struct had_stream_data *had_stream;
int intr_count;
unsigned long flags;
- had_stream = &intelhaddata->stream_data;
stream = &intelhaddata->stream_info;
intr_count = 1;
*/
/* Check for any intr_miss in case of active playback */
- if (had_stream->stream_type == HAD_RUNNING_STREAM) {
+ if (stream->running) {
intr_count = had_chk_intrmiss(intelhaddata, buf_id);
if (!intr_count || (intr_count > 3)) {
spin_unlock_irqrestore(&intelhaddata->had_spinlock,
intelhaddata->buf_info[buf_id].is_valid = true;
if (intelhaddata->valid_buf_cnt-1 == buf_id) {
- if (had_stream->stream_type >= HAD_RUNNING_STREAM)
+ if (stream->running)
intelhaddata->curr_buf = HAD_BUF_TYPE_A;
} else
intelhaddata->curr_buf = buf_id + 1;
{
enum intel_had_aud_buf_type buf_id;
struct pcm_stream_info *stream;
- struct had_stream_data *had_stream;
struct snd_pcm_substream *substream;
- enum had_status_stream stream_type;
unsigned long flags;
int drv_status;
- had_stream = &intelhaddata->stream_data;
stream = &intelhaddata->stream_info;
spin_lock_irqsave(&intelhaddata->had_spinlock, flags);
buf_id = intelhaddata->curr_buf;
- stream_type = had_stream->stream_type;
intelhaddata->buff_done = buf_id;
drv_status = intelhaddata->drv_status;
- if (stream_type == HAD_RUNNING_STREAM)
+ if (stream->running)
intelhaddata->curr_buf = HAD_BUF_TYPE_A;
spin_unlock_irqrestore(&intelhaddata->had_spinlock, flags);
- dev_dbg(intelhaddata->dev, "Enter:%s buf_id=%d, stream_type=%d\n",
- __func__, buf_id, stream_type);
+ dev_dbg(intelhaddata->dev, "Enter:%s buf_id=%d, stream_running=%d\n",
+ __func__, buf_id, stream->running);
snd_intelhad_handle_underrun(intelhaddata);
return 0;
}
- if (stream_type == HAD_RUNNING_STREAM) {
- /* Report UNDERRUN error to above layers */
- substream = had_substream_get(intelhaddata);
- if (substream) {
- snd_pcm_stop_xrun(substream);
- had_substream_put(intelhaddata);
- }
+ /* Report UNDERRUN error to above layers */
+ substream = had_substream_get(intelhaddata);
+ if (substream) {
+ snd_pcm_stop_xrun(substream);
+ had_substream_put(intelhaddata);
}
return 0;
{
enum intel_had_aud_buf_type buf_id;
struct snd_pcm_substream *substream;
- struct had_stream_data *had_stream;
-
- had_stream = &intelhaddata->stream_data;
spin_lock_irq(&intelhaddata->had_spinlock);
if (intelhaddata->drv_status == HAD_DRV_CONNECTED) {
static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
{
enum intel_had_aud_buf_type buf_id;
- struct had_stream_data *had_stream;
struct snd_pcm_substream *substream;
- had_stream = &intelhaddata->stream_data;
buf_id = intelhaddata->curr_buf;
substream = had_substream_get(intelhaddata);
dev_dbg(intelhaddata->dev,
"%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n",
__func__, __LINE__);
- had_stream->stream_type = HAD_INIT;
spin_unlock_irq(&intelhaddata->had_spinlock);
/* Report to above ALSA layer */
had_process_hot_plug(ctx);
/* Process mode change if stream is active */
- if (ctx->stream_data.stream_type == HAD_RUNNING_STREAM)
- hdmi_audio_mode_change(ctx);
+ hdmi_audio_mode_change(ctx);
}
mutex_unlock(&ctx->mutex);
pm_runtime_put(ctx->dev);