summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <b02247@freescale.com>2014-03-07 17:32:41 +0800
committerShengjiu Wang <b02247@freescale.com>2014-03-12 14:27:24 +0800
commite489d6afe180688fbaf83dbb44c37bdec42bb8e0 (patch)
tree7381d81ce9bafe732e3ba1b2768a16ee79e9ea44
parent601a78e51afe13ea8509ceccc80e3bc63af27156 (diff)
ENGR00302531 Noise come out after change the HDMI resolution when video pause
After change the resolution, the blank state will be changed, the audio will be triggered to start. which didn't care about the audio is running or not before changing the resolution. Add hdmi_abort_state for this special case. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
-rw-r--r--drivers/mfd/mxc-hdmi-core.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c
index 2b0853c0375d..e0a07e79bb55 100644
--- a/drivers/mfd/mxc-hdmi-core.c
+++ b/drivers/mfd/mxc-hdmi-core.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2014 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,6 +65,7 @@ static unsigned int hdmi_dma_running;
static struct snd_pcm_substream *hdmi_audio_stream_playback;
static unsigned int hdmi_cable_state;
static unsigned int hdmi_blank_state;
+static unsigned int hdmi_abort_state;
static spinlock_t hdmi_audio_lock, hdmi_blank_state_lock, hdmi_cable_state_lock;
unsigned int hdmi_set_cable_state(unsigned int state)
@@ -76,8 +77,10 @@ unsigned int hdmi_set_cable_state(unsigned int state)
hdmi_cable_state = state;
spin_unlock_irqrestore(&hdmi_cable_state_lock, flags);
- if (check_hdmi_state() && substream)
+ if (check_hdmi_state() && substream && hdmi_abort_state) {
+ hdmi_abort_state = 0;
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
+ }
return 0;
}
EXPORT_SYMBOL(hdmi_set_cable_state);
@@ -91,9 +94,10 @@ unsigned int hdmi_set_blank_state(unsigned int state)
hdmi_blank_state = state;
spin_unlock_irqrestore(&hdmi_blank_state_lock, flags);
- if (check_hdmi_state() && substream)
+ if (check_hdmi_state() && substream && hdmi_abort_state) {
+ hdmi_abort_state = 0;
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
-
+ }
return 0;
}
EXPORT_SYMBOL(hdmi_set_blank_state);
@@ -104,8 +108,10 @@ static void hdmi_audio_abort_stream(struct snd_pcm_substream *substream)
snd_pcm_stream_lock_irqsave(substream, flags);
- if (snd_pcm_running(substream))
+ if (snd_pcm_running(substream)) {
+ hdmi_abort_state = 1;
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
+ }
snd_pcm_stream_unlock_irqrestore(substream, flags);
}
@@ -153,6 +159,7 @@ int mxc_hdmi_register_audio(struct snd_pcm_substream *substream)
ret = -EINVAL;
}
hdmi_audio_stream_playback = substream;
+ hdmi_abort_state = 0;
spin_unlock_irqrestore(&hdmi_audio_lock, flags1);
} else
ret = -EINVAL;
@@ -169,6 +176,7 @@ void mxc_hdmi_unregister_audio(struct snd_pcm_substream *substream)
spin_lock_irqsave(&hdmi_audio_lock, flags);
hdmi_audio_stream_playback = NULL;
+ hdmi_abort_state = 0;
spin_unlock_irqrestore(&hdmi_audio_lock, flags);
}
EXPORT_SYMBOL(mxc_hdmi_unregister_audio);
@@ -653,6 +661,7 @@ static int mxc_hdmi_core_probe(struct platform_device *pdev)
spin_lock_irqsave(&hdmi_audio_lock, flags);
hdmi_audio_stream_playback = NULL;
+ hdmi_abort_state = 0;
spin_unlock_irqrestore(&hdmi_audio_lock, flags);
isfr_clk = clk_get(&hdmi_data->pdev->dev, "hdmi_isfr");