]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00302531 Noise come out after change the HDMI resolution when video pause
authorShengjiu Wang <b02247@freescale.com>
Fri, 7 Mar 2014 09:32:41 +0000 (17:32 +0800)
committerShengjiu Wang <b02247@freescale.com>
Wed, 12 Mar 2014 06:27:24 +0000 (14:27 +0800)
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>
drivers/mfd/mxc-hdmi-core.c

index 2b0853c0375ddec760f55b3e3cc1523c2b895c86..e0a07e79bb556274d535d89c024b0faf9cc5d44c 100644 (file)
@@ -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");