ASoC: mfld-compress: implement .power callback
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Thu, 30 Oct 2014 10:50:58 +0000 (16:20 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 31 Oct 2014 12:51:59 +0000 (12:51 +0000)
.power callback is required to invoked for compressed audio as well to turn
on/off sst, so invoke them

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/sst-mfld-platform-compress.c
sound/soc/intel/sst-mfld-platform.h

index 59467775c9b8bd9486544a69054ceff364fb986f..395168986462d2ef97659281ec1bf088c806b5fc 100644 (file)
@@ -67,8 +67,11 @@ static int sst_platform_compr_open(struct snd_compr_stream *cstream)
                goto out_ops;
        }
        stream->compr_ops = sst->compr_ops;
-
        stream->id = 0;
+
+       /* Turn on LPE */
+       sst->compr_ops->power(sst->dev, true);
+
        sst_set_stream_status(stream, SST_PLATFORM_INIT);
        runtime->private_data = stream;
        return 0;
@@ -83,6 +86,9 @@ static int sst_platform_compr_free(struct snd_compr_stream *cstream)
        int ret_val = 0, str_id;
 
        stream = cstream->runtime->private_data;
+       /* Turn off LPE */
+       sst->compr_ops->power(sst->dev, false);
+
        /*need to check*/
        str_id = stream->id;
        if (str_id)
index d41d1c36031a038856a160449a287d748788083a..79c8d1246a8fb396a4e703694f85e26fb378203b 100644 (file)
@@ -117,6 +117,7 @@ struct compress_sst_ops {
        int (*get_codec_caps)(struct snd_compr_codec_caps *codec);
        int (*set_metadata)(struct device *dev, unsigned int str_id,
                        struct snd_compr_metadata *mdata);
+       int (*power)(struct device *dev, bool state);
 };
 
 struct sst_ops {