1
0
Fork 0

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>
5.4-rM2-2.2.x-imx-squashed
Adrian Alonso 2020-05-17 12:26:53 -05:00
parent 0622c744ed
commit 8fb5fb0a66
1 changed files with 13 additions and 2 deletions

View File

@ -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", },
{ },