From patchwork Sat Oct 3 14:19:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11815257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03524112E for ; Sat, 3 Oct 2020 14:20:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3D63206B6 for ; Sat, 3 Oct 2020 14:20:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a9VFZWxo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kMAqJeFU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3D63206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=l4JbTQzaWxIugD1Uk033QqT8NmuKXCz7t70yGE5AqBc=; b=a9VFZWxoXGDRQ2+x+BQY+rAb+ Vp5HgFcAj0/+pStmLtbZKaTa8e5MWYB03ZQAgO2Em6yLV9XCsNbUsh+fXNW6zA9/rGsK+GwCwAuqh eb+S8Dttoyg9b12Z0VtskY+QcOb/HqF/AJD/v7CogTMdDeMUPI1ATSXMpR1EwTGBj7G7QMptvZOnq 4HFI7cvZ47BJ+f7i16HszkDUyjz2bFeG0D8QdpKmQbZaNMWuEfAJ2bRv4ERo703ZwPjUn1s/UX1yI 7YTvJ+CX5iIxcmQNIwLoirFSkrMrpKLowS9Rg3BEAgnzQ3igjgb34kRYO8AB9MiwFdM0FEuIzsw7x Oh/3Hs7ig==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOiOj-0002vG-Pu; Sat, 03 Oct 2020 14:20:29 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOiOM-0002j0-9L for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2020 14:20:07 +0000 Received: by mail-wr1-x443.google.com with SMTP id t10so4872101wrv.1 for ; Sat, 03 Oct 2020 07:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c3QS3j+CeqKrt27pTi8NL7yFtwOG0PZkLe82cU+0pxA=; b=kMAqJeFUdJ0bC8iwfYBMz7Yvlg882gYnH+oOugICVuxhuJhRGCEC9We1CMO04vqn9W cNFBbl5DDkx9EXhfpdJufMQVmwehk/QBSSyZ0mssQ/1hNNyiMVAwjvhXX86wV0tItZ2/ fBicXWVALqgSLDAboeHCE/nrQ55coP8oTIAigInk331ndEUzyhmui3QKK/2dSL8HJI66 TqolQqQUk1pTXmwqYM7ITtfaO/oGFj4aqTN5dNyJg4kwsa548z+hxHUsZ2MUpGNJ8Eg+ N8Y+KGddoq7qLfhQbkJdhOIqv44qz5VLVoHrAGn8xUWOa0faLMpK4RquykDRe4fL3w3L yfhg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=c3QS3j+CeqKrt27pTi8NL7yFtwOG0PZkLe82cU+0pxA=; b=lpxTtfoa6/SEEBVuwXqOGOVEePPipQzmQ2nVZz28YulOyV0jw1dznxRGCfcfmJy0wq TEchUHf2FQEflfU2OY72RoA/uXleau7egCTt9A/TmGOh9+A6UMiCQxHO3zxKRkTeNATI es45TykTIFfushmPkoQxGIerRG6Gjs6F2tULP8sIeoUmFUE7DKMT46go/z5S57jI40CK 89joVwlhZZFy1TbOx+wTAxsb8E+7Fzp251V0nM47jTW5TVh82lMDlM1jbtlINHPzWTvS bzovwT9+Zojoq3U8pOzABvYPwk1nCPjnfCErXNILWcIg1rnic792Fqvd+W699i3uHrET 6WgQ== X-Gm-Message-State: AOAM5318M8cYSC6lgkuLPkxDIsx9TIapWz60AlMkEP69ctbbQlYcxW0E bALdOVXt5YwrLui9lEXVS3k= X-Google-Smtp-Source: ABdhPJwKkHNl8pWb6gTzIH1iTPyzjAW/z57oJrJ3Kbl5rA5SmPgDK5L4bHXq7zHEgvEvGOKi4oM19w== X-Received: by 2002:a5d:6547:: with SMTP id z7mr8402679wrv.322.1601734805100; Sat, 03 Oct 2020 07:20:05 -0700 (PDT) Received: from clement-Latitude-7490.numericable.fr (213-245-241-245.rev.numericable.fr. [213.245.241.245]) by smtp.gmail.com with ESMTPSA id d18sm5417473wrm.10.2020.10.03.07.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 07:20:04 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Subject: [PATCH v6 05/14] ASoc: sun4i-i2s: Add 20 and 24 bit support Date: Sat, 3 Oct 2020 16:19:41 +0200 Message-Id: <20201003141950.455829-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201003141950.455829-1-peron.clem@gmail.com> References: <20201003141950.455829-1-peron.clem@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201003_102006_499566_D4333302 X-CRM114-Status: GOOD ( 15.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [peron.clem[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jernej Skrabec , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Jaroslav Kysela , Marcus Cooper , linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marcus Cooper Extend the functionality of the driver to include support of 20 and 24 bits per sample. Signed-off-by: Marcus Cooper Acked-by: Maxime Ripard Reviewed-by: Chen-Yu Tsai Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 73103673643a..ba7514849b73 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -592,6 +592,9 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, case 16: width = DMA_SLAVE_BUSWIDTH_2_BYTES; break; + case 32: + width = DMA_SLAVE_BUSWIDTH_4_BYTES; + break; default: dev_err(dai->dev, "Unsupported physical sample width: %d\n", params_physical_width(params)); @@ -1073,6 +1076,10 @@ static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai) return 0; } +#define SUN4I_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_LE | \ + SNDRV_PCM_FMTBIT_S24_LE) + static struct snd_soc_dai_driver sun4i_i2s_dai = { .probe = sun4i_i2s_dai_probe, .capture = { @@ -1080,14 +1087,14 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = { .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN4I_FORMATS, }, .playback = { .stream_name = "Playback", .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN4I_FORMATS, }, .ops = &sun4i_i2s_dai_ops, .symmetric_rates = 1,