summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-sii902x.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-06-19 18:36:50 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:11 +0800
commit1a88b02e51696210d8019a341eb2f7ea09e826b7 (patch)
tree2c2f89cab760ad000e7ca3001b9666c2cdc2f20a /sound/soc/fsl/imx-sii902x.c
parent8d4d4530c4c9598f1c9cc796e9d8552801a3b9ca (diff)
MLK-15104: ASoC: imx-sii902: add constraint for channels
The maximum channel supported by sii902 is 2, but machine driver use dummy codec, and there is no constraint list from codec, so add constraint directly in machine driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 037051e60f3b29fb09aae6f2c97a3532482dfc2a)
Diffstat (limited to 'sound/soc/fsl/imx-sii902x.c')
-rw-r--r--sound/soc/fsl/imx-sii902x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-sii902x.c b/sound/soc/fsl/imx-sii902x.c
index f66ecf59c016..b9059920415f 100644
--- a/sound/soc/fsl/imx-sii902x.c
+++ b/sound/soc/fsl/imx-sii902x.c
@@ -65,6 +65,11 @@ static int imx_sii902x_startup(struct snd_pcm_substream *substream)
if (ret)
return ret;
+ ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS,
+ 1, 2);
+ if (ret)
+ return ret;
+
return 0;
}