From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26F3DC32750 for ; Wed, 14 Aug 2019 02:32:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF24520665 for ; Wed, 14 Aug 2019 02:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565749935; bh=ch4sW9kFKIQNeLNsVYgUacK+Hl+BFLM+LXX19iKx7e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xEuCIELS7Z2sOV64GIPhdSfxGeZIneJX74wg9VAT0H5IQF71URPnh4WihZtpHbCot PGRBsY7nO+X/62b8fVruVxqLMNG2pgBmV/wAO95WQudR4oO5LMwcCW/DPPc9ljcXY4 Juc9W2mhzwakf9xbguaVfZGYGkqlRXGr72VodLbw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729280AbfHNCcN (ORCPT ); Tue, 13 Aug 2019 22:32:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:47878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729022AbfHNCQX (ORCPT ); Tue, 13 Aug 2019 22:16:23 -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 E295D20874; Wed, 14 Aug 2019 02:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565748982; bh=ch4sW9kFKIQNeLNsVYgUacK+Hl+BFLM+LXX19iKx7e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hUjggKwhoZZkNBUtyf6G+TrYDfRkDxAOmZlKPUBR1gm2s+iX8uB2plXv5iAnyDY8Z Tw+Hgr6QHZpFEafHMLUJgzRqMOhXQ1L3NK04U3ix3nAHd9lZ/r4DX68lKcmp4SYBrC IgQ3L0eZelhdKXXBhi8W1wLi0WavU8qSyIYcZ3SA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Cheng-Yi Chiang , Mark Brown , Sasha Levin , linux-rockchip@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 19/68] ASoC: rockchip: Fix mono capture Date: Tue, 13 Aug 2019 22:14:57 -0400 Message-Id: <20190814021548.16001-19-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190814021548.16001-1-sashal@kernel.org> References: <20190814021548.16001-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: Cheng-Yi Chiang [ Upstream commit 789e162a6255325325bd321ab0cd51dc7e285054 ] This reverts commit db51707b9c9aeedd310ebce60f15d5bb006567e0. Revert "ASoC: rockchip: i2s: Support mono capture" Previous discussion in https://patchwork.kernel.org/patch/10147153/ explains the issue of the patch. While device is configured as 1-ch, hardware is still generating a 2-ch stream. When user space reads the data and assumes it is a 1-ch stream, the rate will be slower by 2x. Revert the change so 1-ch is not supported. User space can selectively take one channel data out of two channel if 1-ch is preferred. Currently, both channels record identical data. Signed-off-by: Cheng-Yi Chiang Link: https://lore.kernel.org/r/20190726044202.26866-1-cychiang@chromium.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/rockchip/rockchip_i2s.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 60d43d53a8f5e..11399f81c92f9 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -329,7 +329,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, val |= I2S_CHN_4; break; case 2: - case 1: val |= I2S_CHN_2; break; default: @@ -462,7 +461,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { }, .capture = { .stream_name = "Capture", - .channels_min = 1, + .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_8000_192000, .formats = (SNDRV_PCM_FMTBIT_S8 | @@ -662,7 +661,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) } if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) { - if (val >= 1 && val <= 8) + if (val >= 2 && val <= 8) soc_dai->capture.channels_max = val; } -- 2.20.1