asoc: es755: add delay b/w route setup & teardown
Srinivas Anne [Sat, 12 Mar 2016 00:42:57 +0000 (16:42 -0800)]
change Summary:
Audience FW requires atleast 30 msec to setup the PT_VP route properly.
Added 30msec sec delay before stopping the PT_VP route. This should
prevent the Audience FW going into a bad state during fast
plug-in/plug-out

Bug 1734659
Bug 1730416

Change-Id: Ic555c33863565765010afa6b477beca9625a9331
Signed-off-by: Srinivas Anne <sanne@nvidia.com>
Reviewed-on: http://git-master/r/1030309
Reviewed-on: http://git-master/r/1031228
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

sound/soc/codecs/audience/es-d300.c

index 8a11a27..f758366 100644 (file)
@@ -306,6 +306,12 @@ int _es_stop_route(struct escore_priv *escore, u8 stream_type)
 
 
                if (escore->base_route_setup) {
+
+                       /* Atleast requires 30ms for any route to get stable
+                        * before it stopping it to avoid loud noise.
+                        * More details:  BAS-3839 */
+                       msleep(30);
+
                        ret = escore_cmd(escore, stop_route_cmd, &resp);
                        if (ret) {
                                pr_err("%s: Route stop failed, ret = %d\n",
@@ -526,7 +532,7 @@ static int convert_output_mux_to_cmd(struct escore_priv *escore, int reg)
        port = (msg[0] >> 9) & 0x1f;
 
        /* For BAS-3205, in case of PT_VP route and PCM0 port and 16bits,
-        * set channel number to 0 for PassIN1 and 2 for PassIN2 */
+        * set channel number to 0 and 2 for PCM0 port for capture */
        if (PCM0 == port && PASSTHRU_VP == algo_type &&
            (SNDRV_PCM_FORMAT_S16_LE == escore->pcm_format ||
             SNDRV_PCM_FORMAT_S16_BE == escore->pcm_format)) {