ASoC: fsl_ssi: Clean up set_dai_tdm_slot()
authorNicolin Chen <nicoleotsuka@gmail.com>
Mon, 12 Feb 2018 22:03:11 +0000 (14:03 -0800)
committerMark Brown <broonie@kernel.org>
Wed, 21 Feb 2018 12:30:48 +0000 (12:30 +0000)
This patch replaces the register read with ssi->i2s_net for
simplification. It also removes masking SSIEN from scr value
since it's handled later by regmap_update_bits() to set this
scr value back.

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 d4f1f0d..14046c3 100644 (file)
@@ -1055,9 +1055,7 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
        }
 
        /* The slot number should be >= 2 if using Network mode or I2S mode */
-       regmap_read(regs, REG_SSI_SCR, &val);
-       val &= SSI_SCR_I2S_MODE_MASK | SSI_SCR_NET;
-       if (val && slots < 2) {
+       if (ssi->i2s_net && slots < 2) {
                dev_err(dai->dev, "slot number should be >= 2 in I2S or NET\n");
                return -EINVAL;
        }
@@ -1067,9 +1065,8 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
        regmap_update_bits(regs, REG_SSI_SRCCR,
                           SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots));
 
-       /* Save SSIEN bit of the SCR register */
+       /* Save the SCR register value */
        regmap_read(regs, REG_SSI_SCR, &val);
-       val &= SSI_SCR_SSIEN;
        /* Temporarily enable SSI to allow SxMSKs to be configurable */
        regmap_update_bits(regs, REG_SSI_SCR, SSI_SCR_SSIEN, SSI_SCR_SSIEN);