diff options
author | Adrian Alonso <adrian.alonso@nxp.com> | 2020-05-17 12:26:53 -0500 |
---|---|---|
committer | Adrian Alonso <adrian.alonso@nxp.com> | 2020-05-19 13:51:00 -0500 |
commit | 8fb5fb0a6610470113105b11935d394e5a2a23da (patch) | |
tree | 4cb8a4237ff58e83c35409c90142136210a96a84 | |
parent | 0622c744ed313460f86a3185e10e6650940e3cea (diff) |
MLK-24059: sound: soc: fsl add imx-ak5552 compatible
Add fsl,imx-audio-ak5552 to imx-ak5558 machine ASoC
driver, limit actual number of channels for ak5552
ADC support
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
-rw-r--r-- | sound/soc/fsl/imx-ak5558.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/soc/fsl/imx-ak5558.c b/sound/soc/fsl/imx-ak5558.c index f2d692282420..908b6d030dae 100644 --- a/sound/soc/fsl/imx-ak5558.c +++ b/sound/soc/fsl/imx-ak5558.c @@ -91,6 +91,10 @@ static const u32 ak5558_channels[] = { 1, 2, 4, 6, 8, }; +static const u32 ak5552_channels[] = { + 1, 2, +}; + static unsigned long ak5558_get_mclk_rate(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -314,8 +318,14 @@ static int imx_aif_startup(struct snd_pcm_substream *substream) return ret; if (!data->tdm_mode) { - constraint_channels.list = ak5558_channels; - constraint_channels.count = ARRAY_SIZE(ak5558_channels); + if (of_device_is_compatible(card->dev->of_node, + "fsl,imx-audio-ak5552")) { + constraint_channels.list = ak5552_channels; + constraint_channels.count = ARRAY_SIZE(ak5552_channels); + } else { + constraint_channels.list = ak5558_channels; + constraint_channels.count = ARRAY_SIZE(ak5558_channels); + } ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &constraint_channels); @@ -526,6 +536,7 @@ fail: } static const struct of_device_id imx_ak5558_dt_ids[] = { + { .compatible = "fsl,imx-audio-ak5552", }, { .compatible = "fsl,imx-audio-ak5558", }, { .compatible = "fsl,imx-audio-ak5558-mq", }, { }, |