HDMI-Audio: Fix Spinlock-Recursion and Null-Pointer issues
BZ: 21688 37320
Change to prevent Recursive spinlock in trigger.
In middle of start trigger, if HDMI is Pluged-out, the driver
state is disconnected and unplug function calls snd_pcm_stop to
inform the upper layer about disconnection. This internally calls
snd_pcm_stop and stop trigger. Here the lock is recursively
acquired. Solution is to not call snd_pcm_stop if the
substream is active.
Change to prevent Substream NULL during programming buffer.
During successive quick plug and unplug of HDMI cable,
unplug is processed before Start trigger gets to process.
But the trigger state is saved. On unplug the Stop trigger is
called and because it is disconnected it does nothing. Once
cable is plugged in silence is played and the old saved
start trigger causes to retrieve the substream which is NULL
at this point of time. Solution is to clear Trigger state during
unplug. During Plugin inform the upper layer about the event,
if the substream is still active.
HDMI Audio code ported from R2 branch contains Dummy_playback
code. This workaround is no longer needed in R3. (ICS platform)
This patch removes dummy_playback implemtation. Some variables
are renamed for better readability.
Change-Id: I36f4b655316846f8dbf7e0f8935f6a6cff707624
Signed-off-by: Shreyas Neerebailoor <shreyasx.neerebailoor@intel.com>
Reviewed-on: http://android.intel.com:8080/52079
Reviewed-by: Babu, Ramesh <ramesh.babu@intel.com>
Reviewed-by: Agarwal, Vaibhav <vaibhav.agarwal@intel.com>
Reviewed-by: Koul, Vinod <vinod.koul@intel.com>
Reviewed-by: Gupta, ArvindX K <arvindx.k.gupta@intel.com>
Reviewed-by: Hibare, PramodX <pramodx.hibare@intel.com>
Tested-by: Hibare, PramodX <pramodx.hibare@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>