mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
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>
This commit is contained in:
parent
7b9d5a6277
commit
466a99ed9b
|
@ -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
|
||||
|
|
|
@ -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 @@ static int imx_ak4497_probe(struct platform_device *pdev)
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user