From 1a88b02e51696210d8019a341eb2f7ea09e826b7 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 19 Jun 2017 18:36:50 +0800 Subject: 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 (cherry picked from commit 037051e60f3b29fb09aae6f2c97a3532482dfc2a) --- sound/soc/fsl/imx-sii902x.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sound/soc/fsl/imx-sii902x.c') 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; } -- cgit v1.2.3