summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorb02247 <b02247@freescale.com>2012-10-31 14:16:10 +0800
committerb02247 <b02247@freescale.com>2012-10-31 16:00:43 +0800
commit4dced91782ec45fb8af3c8c3235fdb105eb9c5e2 (patch)
tree4915caf8cd9c5eb4d90027e2ff47176f68be2a76
parentfbb6d62e15a05b4c006b63ea8cd9f9e175fde70d (diff)
ENGR00230381 when unplug HDMI, the audio will be pending for a while
Revert "ENGR00224245 HDMI AUDIO: stop/start PCM while unplug,blank/plug,unblank" This reverts commit f8dd4f6fea093e46a30d5e438baa33702f626372. This patch is for pulse audio. which is not fit for Android. Signed-off-by: b02247 <b02247@freescale.com>
-rw-r--r--drivers/mfd/mxc-hdmi-core.c12
-rw-r--r--include/linux/mfd/mxc-hdmi-core.h1
-rw-r--r--sound/soc/imx/imx-hdmi-dma.c2
3 files changed, 2 insertions, 13 deletions
diff --git a/drivers/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c
index a07db1b0c070..e9322477ff6d 100644
--- a/drivers/mfd/mxc-hdmi-core.c
+++ b/drivers/mfd/mxc-hdmi-core.c
@@ -41,7 +41,6 @@
#include <linux/mfd/mxc-hdmi-core.h>
#include <linux/fsl_devices.h>
#include <mach/hardware.h>
-#include <linux/mfd/mxc-hdmi-core.h>
struct mxc_hdmi_data {
struct platform_device *pdev;
@@ -73,29 +72,22 @@ static spinlock_t hdmi_audio_lock, hdmi_blank_state_lock, hdmi_cable_state_lock;
unsigned int hdmi_set_cable_state(unsigned int state)
{
unsigned long flags;
- struct snd_pcm_substream *substream = hdmi_audio_stream_playback;
spin_lock_irqsave(&hdmi_cable_state_lock, flags);
hdmi_cable_state = state;
spin_unlock_irqrestore(&hdmi_cable_state_lock, flags);
- if (check_hdmi_state() && substream)
- substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
return 0;
}
unsigned int hdmi_set_blank_state(unsigned int state)
{
unsigned long flags;
- struct snd_pcm_substream *substream = hdmi_audio_stream_playback;
spin_lock_irqsave(&hdmi_blank_state_lock, flags);
hdmi_blank_state = state;
spin_unlock_irqrestore(&hdmi_blank_state_lock, flags);
- if (check_hdmi_state() && substream)
- substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
-
return 0;
}
@@ -106,7 +98,7 @@ static void hdmi_audio_abort_stream(struct snd_pcm_substream *substream)
snd_pcm_stream_lock_irqsave(substream, flags);
if (snd_pcm_running(substream))
- substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
+ snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
snd_pcm_stream_unlock_irqrestore(substream, flags);
}
@@ -122,7 +114,7 @@ int mxc_hdmi_abort_stream(void)
return 0;
}
-int check_hdmi_state(void)
+static int check_hdmi_state(void)
{
unsigned long flags1, flags2;
unsigned int ret;
diff --git a/include/linux/mfd/mxc-hdmi-core.h b/include/linux/mfd/mxc-hdmi-core.h
index 26fa47d09abf..f16b11cb5cf4 100644
--- a/include/linux/mfd/mxc-hdmi-core.h
+++ b/include/linux/mfd/mxc-hdmi-core.h
@@ -60,6 +60,5 @@ int mxc_hdmi_register_audio(struct snd_pcm_substream *substream);
void mxc_hdmi_unregister_audio(struct snd_pcm_substream *substream);
unsigned int hdmi_set_cable_state(unsigned int state);
unsigned int hdmi_set_blank_state(unsigned int state);
-int check_hdmi_state(void);
#endif
diff --git a/sound/soc/imx/imx-hdmi-dma.c b/sound/soc/imx/imx-hdmi-dma.c
index 342f9c85f481..8ada80e0cc74 100644
--- a/sound/soc/imx/imx-hdmi-dma.c
+++ b/sound/soc/imx/imx-hdmi-dma.c
@@ -1116,8 +1116,6 @@ static int hdmi_dma_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (!check_hdmi_state())
- return 0;
rtd->frame_idx = 0;
if (runtime->access == SNDRV_PCM_ACCESS_MMAP_INTERLEAVED) {
appl_bytes = frames_to_bytes(runtime,