From patchwork Fri Jan 5 22:12:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10147153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1EB3460155 for ; Fri, 5 Jan 2018 22:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 559AC287BD for ; Fri, 5 Jan 2018 22:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48F0E2892C; Fri, 5 Jan 2018 22:13:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EE9D8287BD for ; Fri, 5 Jan 2018 22:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=IgEYuSATXidWHI9ZitZJ4F5NVYyK+ZAP6uxQ4vPWpYI=; b=Z8R Ps68ljln5mRz+c1csKrCYvkawPBK5cXZHAjjURKs/1IkX+87U6aGNmXvEcgwnGF3+GLKxRGuWD/GA KONMbsoTdSLcEdtgHjNvXFy5TmmWe6QOe3sgQb8MbEOgCq2vG5H+G14CID1nDLdamUPNlFrGrm1Kh anHBx9Ik7F3tYJ4K7dnFoovjdq1j6AhXkNBL1csKQzIjaIWqUfKM6CsKY4x+KgT35e3lnOYmhmCP1 JPyeCdnmb0gTOYmYeAkFFbAIikqYNqh3qCBM6QhMo8TofF4rM9rYNc62x1y8MIIhw3vvk+2798IMs /gX8D4bqDzzTP7AP7i1Ud4s9RbUwKYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXaFL-00005Q-En; Fri, 05 Jan 2018 22:13:51 +0000 Received: from mail-pg0-f68.google.com ([74.125.83.68]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXaEt-0008GT-Kl for linux-rockchip@lists.infradead.org; Fri, 05 Jan 2018 22:13:25 +0000 Received: by mail-pg0-f68.google.com with SMTP id c194so1510225pga.12 for ; Fri, 05 Jan 2018 14:13:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7wTUwfH0ASnQE9SYUeOLNqlkOZWBuvoiFcvZcij6Hh4=; b=DddWKdXFT4/HkgxFyP0LHYyc7fic8f8WCeOv3S+j8O9Zkhdtu5XxHTXzPvbcpJBzNw C453VgN50GVW5q73+hslBwi4IK0OemZOV6iBmvMbtonid/nMs21G4+sPNvZ1XvdzibN/ Hyy+BMRxAltGr26+BIWXA7mLCBeD+Rrh8Db7njAsmJFYx0EAequY0tBRxVqRpr+MErid VzbiPJcSxUGYLGCrulYlqpzkWKWKlFSoM2aBOiXzUIwrvtJ6X7P0k91Z9+d4CXr/6wkK 3j2drJ0dExB0DC+fnDR47Tp85McOWENXlCIKtB/LSkFehcKm9WwJ26WRhiXCtW9x3bjf 3FKQ== X-Gm-Message-State: AKGB3mK1P5tDzjm0nePE03hhuL4xCyAwcu25STEkE1orOI1DUyLlBBxq 1HyswAwXpVG+PMYPExAzfSEzcA== X-Google-Smtp-Source: ACJfBoviX4tPARV0veLiUMBnUUQt1x+c5UwFC6rRODEVZIe0ORSsqXnwJk27C+m5YB83/d7FOvnr4w== X-Received: by 10.99.56.77 with SMTP id h13mr3713868pgn.275.1515190391968; Fri, 05 Jan 2018 14:13:11 -0800 (PST) Received: from mka.mtv.corp.google.com ([172.22.112.49]) by smtp.gmail.com with ESMTPSA id 67sm13601735pfz.171.2018.01.05.14.13.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jan 2018 14:13:11 -0800 (PST) From: Matthias Kaehlcke To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Heiko Stuebner Subject: [PATCH] ASoC: rockchip: i2s: Support mono capture Date: Fri, 5 Jan 2018 14:12:42 -0800 Message-Id: <20180105221242.22083-1-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc0.223.g4a4ac83678-goog X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180105_141323_710200_53182A68 X-CRM114-Status: UNSURE ( 8.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Brian Norris , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , Dylan Reid , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Rockchip I2S controller only allows to configure even numbers of capture channels. It is still possible to capture monophonic audio by using dual-channel mode and ignoring the 'data' from the second channel. Signed-off-by: Matthias Kaehlcke --- sound/soc/rockchip/rockchip_i2s.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 908211e1d6fc..cc22ab3d10dd 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -328,6 +328,7 @@ 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: @@ -460,7 +461,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { }, .capture = { .stream_name = "Capture", - .channels_min = 2, + .channels_min = 1, .channels_max = 2, .rates = SNDRV_PCM_RATE_8000_192000, .formats = (SNDRV_PCM_FMTBIT_S8 | @@ -654,7 +655,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) } if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) { - if (val >= 2 && val <= 8) + if (val >= 1 && val <= 8) soc_dai->capture.channels_max = val; }