]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: fsl_ssi: Use ssi->streams instead of reading register
authorNicolin Chen <nicoleotsuka@gmail.com>
Mon, 12 Feb 2018 22:03:25 +0000 (14:03 -0800)
committerMark Brown <broonie@kernel.org>
Wed, 21 Feb 2018 12:31:00 +0000 (12:31 +0000)
Since ssi->streams is being updated along with SCR register and
its SSIEN bit, it's simpler to use it instead.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Tested-by: Caleb Crome <caleb@crome.org>
Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Reviewed-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_ssi.c

index 5bc67ad8000f009b2a9ca5806032794fe1ed7e03..0823b08923b5ef5d0860c14807af75f899eed0ed 100644 (file)
@@ -803,11 +803,6 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
        unsigned int sample_size = params_width(hw_params);
        u32 wl = SSI_SxCCR_WL(sample_size);
        int ret;
-       u32 scr;
-       int enabled;
-
-       regmap_read(regs, REG_SSI_SCR, &scr);
-       enabled = scr & SSI_SCR_SSIEN;
 
        /*
         * SSI is properly configured if it is enabled and running in
@@ -815,7 +810,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
         * that should set separate configurations for STCCR and SRCCR
         * despite running in the synchronous mode.
         */
-       if (enabled && ssi->synchronous)
+       if (ssi->streams && ssi->synchronous)
                return 0;
 
        if (fsl_ssi_is_i2s_master(ssi)) {