Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1881799ybz; Thu, 30 Apr 2020 07:09:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJpSvBTz3fGVQJ1ry3YUxDPOf209DeOCBhosS0IOb+pkrxkVNV/aqKPuZZwg7Sbb8C5mfpA X-Received: by 2002:a17:906:2503:: with SMTP id i3mr2669520ejb.293.1588255775504; Thu, 30 Apr 2020 07:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588255775; cv=none; d=google.com; s=arc-20160816; b=Lw33VQWmXbqesEAd3WXjuSVGyW/iz8hIklrXPZ2xKD6Ff2jYpAoFnnkVhVSphJiBPU PHf4ur3mBY7vGZFhjTeYpxKz9vjQ4qrb2OPVqROTYzPuz61i2CwN/ncRfUjO2npVM4yT Nt6VZdD31dDxEIKVP6xRuyHWlHviRWCU76tIC6vzDaKfdHu75/m9NhjAfUpa+0jU8bXf 6Qn4Utdfz66AkSOGBDJvygvjQXRk+ktrkJIHe3YZUVeoWMN6NP3jT3rWQLQaGhKrfSUq B49cYgFR+xmqT1mKiQCK/cToEWmQo82pwTC9qyFp/I+G1KMIENHfug7m5TGP7HWKNQIQ EXkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ckEw1ZQQIgcg50CxMRk0GsJmZuHQPgIRGC44EEEBGew=; b=ZMuCF3p4APLlKnTzobb7SOvX69ECC+OVNDJp4sP1bJdbyA6s3RKzdHG2pb5keAyjeV /nKhw7v3EQqSUiyMbo3LUXvmQ9Hn8tvK/W2POuR+NSAZZRaQeD+h8Y+Emts5jgdzXaX6 /IQ526zPNaraM3sE8uk4YghxzlHYS92msOOOaoQ0Rs3kS3EBaLdgK67vA/XTvLy5jjUq JqleE8gW0Fedm+SXYdZypLZSK33klfJ/Ai3EM5cR54bTF/uL8wUI7fAPfTq8Eg9RCwgN LQO6Gw26S7jiR6x1cHc5RD7rGfck5jYFlZwptAffk15M8Y14XTiTmwyslvvNoLOeGt0w 2DSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AvTkE/MD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si5435888edj.538.2020.04.30.07.09.09; Thu, 30 Apr 2020 07:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AvTkE/MD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728583AbgD3OHk (ORCPT + 99 others); Thu, 30 Apr 2020 10:07:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:33714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728427AbgD3Nwe (ORCPT ); Thu, 30 Apr 2020 09:52:34 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 753E2208D5; Thu, 30 Apr 2020 13:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588254753; bh=NCEMTGfWpoYFw/KeMl/To3iZwdhBGM7JjgTt34Xc6Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AvTkE/MDL/0QzFniPgbaG1hxvEK0ZmqdCDssX25pUpcZ4EQ5IW0EqSjzp5HNNHV05 GPyHhdZNnlLARmXy9MEkwTHrm7LdxxQsjl27OzBNFWMBXZdg1aX+VXWzd8JpYEhudU stdIyKRwc2AYFd2KsFXregFz9P4ZC0XflAfmUX1w= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stephan Gerhold , Srinivas Kandagatla , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 12/57] ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs Date: Thu, 30 Apr 2020 09:51:33 -0400 Message-Id: <20200430135218.20372-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430135218.20372-1-sashal@kernel.org> References: <20200430135218.20372-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephan Gerhold [ Upstream commit 0c824ec094b5cda766c80d88c2036e28c24a4cb1 ] For some reason, the MI2S DAIs do not have channels_min/max defined. This means that snd_soc_dai_stream_valid() returns false, i.e. the DAIs have neither valid playback nor capture stream. It's quite surprising that this ever worked correctly, but in 5.7-rc1 this is now failing badly: :) Commit 0e9cf4c452ad ("ASoC: pcm: check if cpu-dai supports a given stream") introduced a check for snd_soc_dai_stream_valid() before calling hw_params(), which means that the q6i2s_hw_params() function was never called, eventually resulting in: qcom-q6afe aprsvc:q6afe:4:4: no line is assigned ... even though "qcom,sd-lines" is set in the device tree. Commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") now even avoids creating PCM devices if the stream is not supported, which means that it is failing even earlier with e.g.: Primary MI2S: ASoC: no backend playback stream Avoid all that trouble by adding channels_min/max for the MI2S DAIs. Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver") Signed-off-by: Stephan Gerhold Reviewed-by: Srinivas Kandagatla Cc: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200415150050.616392-1-stephan@gerhold.net Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/qdsp6/q6afe-dai.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index c1a7624eaf175..2a5302f1db98a 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -902,6 +902,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -917,6 +919,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -931,6 +935,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -946,6 +952,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -960,6 +968,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -975,6 +985,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -989,6 +1001,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, @@ -1004,6 +1018,8 @@ static struct snd_soc_dai_driver q6afe_dais[] = { SNDRV_PCM_RATE_16000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, .rate_min = 8000, .rate_max = 48000, }, -- 2.20.1