greybus: audio: schedule workqueue to perform codec cleanup on module removal
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Mon, 15 Feb 2016 18:57:28 +0000 (00:27 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 18 Feb 2016 00:03:40 +0000 (16:03 -0800)
commit29386f058a758f5ef6e8a522101fcbfd0ef07a19
tree9ace3a3dbaf869b729938bd0cd20fd2b255c6c22
parentb19df7b9950cd8c1212dcc775dffcdaace391db3
greybus: audio: schedule workqueue to perform codec cleanup on module removal

In response to codec module removal, user space is reported about
the event. In response to this, ALSA layer will update DAPM route
and cleanup DAPM states.
As a fallback mechanism, kernel can cleanup the DAPM state for codec
module. But, this would cause immediate playback (first trial) to fail,
since DSP is still in inconsistent state.
To avoid such situation, a workqueue is scheduled for codec cleanup
with timeout=50ms.
Thus, normally it is expected from above layers to update routes and
perform cleanup. However, fallback mechanism still holds good after
50ms.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_codec.c
drivers/staging/greybus/audio_codec.h