diff options
author | Mark Brown <broonie@kernel.org> | 2014-12-08 13:11:45 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-08 13:11:45 +0000 |
commit | 8f38411a7e24b214014db5310af8432dfbef9b18 (patch) | |
tree | 2604ce19e9bd76e277077be79474fb97af9483c5 | |
parent | dbb55ce8afc8832fac7f6cbbe55123b2b05216d5 (diff) | |
parent | 86ea522b369abbbe92b4d66a238e79319ca46ba5 (diff) |
Merge remote-tracking branch 'asoc/topic/fsl-esai' into asoc-next
-rw-r--r-- | sound/soc/fsl/fsl_esai.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index a645e296199e..ca319d59f843 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -513,10 +513,15 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, u32 width = snd_pcm_format_width(params_format(params)); u32 channels = params_channels(params); u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); + u32 slot_width = width; u32 bclk, mask, val; int ret; - bclk = params_rate(params) * esai_priv->slot_width * esai_priv->slots; + /* Override slot_width if being specifially set */ + if (esai_priv->slot_width) + slot_width = esai_priv->slot_width; + + bclk = params_rate(params) * slot_width * esai_priv->slots; ret = fsl_esai_set_bclk(dai, tx, bclk); if (ret) @@ -538,7 +543,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx), mask, val); mask = ESAI_xCR_xSWS_MASK | (tx ? ESAI_xCR_PADC : 0); - val = ESAI_xCR_xSWS(esai_priv->slot_width, width) | (tx ? ESAI_xCR_PADC : 0); + val = ESAI_xCR_xSWS(slot_width, width) | (tx ? ESAI_xCR_PADC : 0); regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx), mask, val); @@ -780,9 +785,6 @@ static int fsl_esai_probe(struct platform_device *pdev) return ret; } - /* Set a default slot size */ - esai_priv->slot_width = 32; - /* Set a default slot number */ esai_priv->slots = 2; |