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: 10147149 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 D070D60155 for ; Fri, 5 Jan 2018 22:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13682287C8 for ; Fri, 5 Jan 2018 22:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07FCF2892D; Fri, 5 Jan 2018 22:13:24 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5690287C8 for ; Fri, 5 Jan 2018 22:13:22 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 69DDE267AE0; Fri, 5 Jan 2018 23:13:20 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 47F59267AE6; Fri, 5 Jan 2018 23:13:18 +0100 (CET) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by alsa0.perex.cz (Postfix) with ESMTP id E86BC267AA9 for ; Fri, 5 Jan 2018 23:13:14 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id q12so2485183pgt.7 for ; Fri, 05 Jan 2018 14:13:14 -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=iMhUe6fQJyzYlGtKtgDT/AR689CC35PNaxUppMZ0K5KRCBeIYmIRU6Lbe1O95sODCX Oq5vAVB+mzzdxTM2WGim/kvjUrf2S/fZVbnzciicn4Mmw7/zdSLH5MNl7uSHRIAYemwz oAP+YEuDtaxtXwULvAS6e5CF8Ongv4fIAT1hSEpmZXwAah/0Ln1A4xLGUCgOrF+lXYdJ cgZYAbM5feuapTcnujM4fFI3qTQjGxkLLC5na9DJ/l2ocQKEHooLBfRaHOb+ipkEsEX3 UKTUlHRu96091YdPFTqOQvmLKWbtAbpeDXJAxPVX3fEOBInXiU8YeIyxstahOmMJHWO2 5B8Q== X-Gm-Message-State: AKGB3mKivO2UKOdyP7aduzZ1qFrtlym1zId5MWtDjozICqT8u0DM4kLZ aObD14F/7vtEax12isTkJ3J9QQ== 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 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 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 Subject: [alsa-devel] [PATCH] ASoC: rockchip: i2s: Support mono capture X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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; }