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: 10147151 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 4C6F160155 for ; Fri, 5 Jan 2018 22:13:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 836B5287B9 for ; Fri, 5 Jan 2018 22:13:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77A3B287C8; Fri, 5 Jan 2018 22:13:30 +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 1B2EC287B9 for ; Fri, 5 Jan 2018 22:13:29 +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=RMcLMggsQlrtZPYmesa/kOhki4LnLIrB0wSw6wXugsU=; b=CC+ 2t7jUu5JppUln+6mr5XhEIkC048lURv9QvbzGy8gobXPeSfQijRFhtoNpYBh4LpYBGK/PEEhD3wXT zhcZAAj1hRm4msR2p2ijcREn6I21SXnU9MBQS3FUpjgjvzVGifIsAZccIcL/qH/GMJaJ9yhi/2/Ub FcSMqzAV9FopiAIDOBBEWbS5zQdWB/30NVHPAFe0mIkJ3TNbT0P6Z56FnE1PCsK8Atc0qS4Qx2BId b22d/cTt7uybs90rwU9LREylNe6/Ene2yY0sfmT+DoUpp5XiWXnkLaUoN4F63Fn9OWNhm6DtiTDDp hqY2p8z4Y2VvQduVRC6VTCawa7eVmPw==; 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 1eXaEx-0008IU-HB; Fri, 05 Jan 2018 22:13:27 +0000 Received: from mail-pg0-f66.google.com ([74.125.83.66]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXaEt-0008GU-LH for linux-arm-kernel@lists.infradead.org; Fri, 05 Jan 2018 22:13:25 +0000 Received: by mail-pg0-f66.google.com with SMTP id j4so2493236pgp.1 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=YA2bC2qE74UXW05cU0FIB2Rz94xR+HkLIJJ3SSVmbsWB5nwydao16dlpN34HaE8msJ KtliBAQwqdFueJ6k11HoJksbiO+X67nqHWuRQ5hm2hnoSKSws2weta9Ir5a4BE2BuFQQ hEr5cWet4ue6AKZNlRgiv9QRMSWsd82hK0bcOdBgpeTkbca9wVZnCBbTd/SDLQzk1TKj epVWVC3SjtH4tqhgMuXojd4xCJfoJyV/25x70LxcqWkR5oYY5UUu3enyJ5QJqPPNyEYE Gg0BFNGt9WKy+TU31dlSTLvOVDXODygHvY8xIqnYiTUCY0IHQF5F99marjmbzJlPSbPI IKMQ== X-Gm-Message-State: AKGB3mIqRMgT455ndjearLsjvUDXMA3uFZ5BGQANCi1Y9zDe/gdLeiNQ zazZT7jGLwXAmZNrf3ikVEIfxA== 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_715942_C6A1C68C X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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; }