diff options
-rw-r--r-- | Documentation/devicetree/bindings/sound/imx-audio-ak4497.txt | 2 | ||||
-rw-r--r-- | arch/arm64/boot/dts/freescale/fsl-imx8mq-evk.dts | 2 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ak4497.c | 8 |
3 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/sound/imx-audio-ak4497.txt b/Documentation/devicetree/bindings/sound/imx-audio-ak4497.txt index f93a03a26712..7eeeeeda74f5 100644 --- a/Documentation/devicetree/bindings/sound/imx-audio-ak4497.txt +++ b/Documentation/devicetree/bindings/sound/imx-audio-ak4497.txt @@ -2,7 +2,7 @@ Freescale i.MX audio complex with AK4497 DAC Required properties: -- compatible : "fsl,imx-audio-ak4497" +- compatible : "fsl,imx-audio-ak4497", "fsl,imx-audio-ak4497-mq" - model : The user-visible name of this sound complex - audio-cpu : The phandle of CPU DAI - audio-codec : The phandle of the ak4497 audio DAC diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/fsl-imx8mq-evk.dts index c63803d16fe9..dc4d4842f504 100644 --- a/arch/arm64/boot/dts/freescale/fsl-imx8mq-evk.dts +++ b/arch/arm64/boot/dts/freescale/fsl-imx8mq-evk.dts @@ -122,7 +122,7 @@ }; sound-ak4497 { - compatible = "fsl,imx-audio-ak4497"; + compatible = "fsl,imx-audio-ak4497-mq"; model = "ak4497-audio"; audio-cpu = <&sai1>; audio-codec = <&ak4497>; 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); |