diff options
author | Viorel Suman <viorel.suman@nxp.com> | 2018-06-27 15:05:58 +0300 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 3d0ccbb3a01d893600536d4ded4cecdecee89aae (patch) | |
tree | 0b552f96b7b671408ff4c4f3579dc09f633e3579 /sound | |
parent | c242e9fbe580fc37aa196b427461e335df62e43e (diff) |
MLK-18682-6: ASoC: imx-ak4497: refine 1:1 bclk:mclk ratio support
Use a specific compatible string for 850D in order to limit DSD MCLK
frequency for platforms newer than 850D.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/imx-ak4497.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-ak4497.c b/sound/soc/fsl/imx-ak4497.c index 2d098dc0cddf..9acfa84bf3d1 100644 --- a/sound/soc/fsl/imx-ak4497.c +++ b/sound/soc/fsl/imx-ak4497.c @@ -25,6 +25,7 @@ struct imx_ak4497_data { struct snd_soc_card card; + bool one2one_ratio; }; static struct snd_soc_dapm_widget imx_ak4497_dapm_widgets[] = { @@ -88,6 +89,7 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_card *card = rtd->card; struct device *dev = card->dev; + struct imx_ak4497_data *priv = snd_soc_card_get_drvdata(card); unsigned int channels = params_channels(params); unsigned int fmt = SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; unsigned long freq = imx_ak4497_compute_freq(substream, params); @@ -96,6 +98,9 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream, fmt |= (is_dsd ? SND_SOC_DAIFMT_PDM : SND_SOC_DAIFMT_I2S); + if (is_dsd && freq > 22579200 && priv->one2one_ratio) + freq = 22579200; + ret = snd_soc_dai_set_sysclk(cpu_dai, FSL_SAI_CLK_MAST1, freq, SND_SOC_CLOCK_OUT); if (ret < 0) { @@ -212,6 +217,8 @@ static int imx_ak4497_probe(struct platform_device *pdev) priv->card.owner = THIS_MODULE; priv->card.dapm_widgets = imx_ak4497_dapm_widgets; priv->card.num_dapm_widgets = ARRAY_SIZE(imx_ak4497_dapm_widgets); + priv->one2one_ratio = !of_device_is_compatible(pdev->dev.of_node, + "fsl,imx-audio-ak4497-mq"); ret = snd_soc_of_parse_card_name(&priv->card, "model"); if (ret) @@ -237,6 +244,7 @@ fail: static const struct of_device_id imx_ak4497_dt_ids[] = { { .compatible = "fsl,imx-audio-ak4497", }, + { .compatible = "fsl,imx-audio-ak4497-mq", }, { }, }; MODULE_DEVICE_TABLE(of, imx_ak4497_dt_ids); |