From patchwork Sun Oct 11 20:22:15 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: 11831195 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 95AC7697 for ; Sun, 11 Oct 2020 20:23:13 +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 62B5B215A4 for ; Sun, 11 Oct 2020 20:23:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="exjl0k/o"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IyS1xQwe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62B5B215A4 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=8D9l9D6nOr8DLQLNE/+RGQS8s3ifm/Lv2yqdGl6JvO4=; b=exjl0k/o2XhN98NoiDya9EcNL JhaftDdFNgnF5tddmY7nJlHqg3UIY6fazP1Md3uJjhA0U63SMmhWP6RznQG9tlKPh8PUAJqJwxZoT 1DM6HaSXBHXWEgEDqxGIgrWLMj3GiHOMIUGR41h7B7a1EAyEh+ltbLLo4Dke18As0jPeyzvu8xHyP KzIGj7t5nnTbjj/FleMACLWCPMoIsQFSDHH4RfnZamW6kVABH4vaER00wIBq5HSdnO86YEAvi2WUT hMzab5mNi5S7LO6gnzJcNkxpvkORMs4XPACO1ClYiGRtyaa5vFsPopacaphrqPgAVEJlHMnJRu4bN X4z/LuVxA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRhru-0002rb-1y; Sun, 11 Oct 2020 20:22:58 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRhrk-0002on-IH for linux-arm-kernel@lists.infradead.org; Sun, 11 Oct 2020 20:22:50 +0000 Received: by mail-qv1-xf43.google.com with SMTP id b10so5261056qvf.0 for ; Sun, 11 Oct 2020 13:22:48 -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=X6foTdNByYaza+7IioC5Au+dQ6O1jD1KqRZFfbjoYWg=; b=IyS1xQweqtX7I7JqvRg2RP8mWx2QwzjtmI9o5PT8TY3EyXm5m+AhdZV8JyiEnRfj+C SQXu8zpe8zE/rjyALoawdUk2XiW070CIgVf+rojhN9sq2vbPHwPwMCFDfTkKrZxPf0pf FHnN2JVCP3rlT1ZSFjUgDXHZ3kGk7ZfgI9J70NuBV+R7H6orPbErWEGODJFUbdqnPWN5 FjFKLBsRvYbECj/5LjRVLy/7pPAi+nB0Vu1e40h9dBoc/bSke8FSLbbyQuNH3EY5vNJB 9EQjj1Tu24/533R2j0HvHo3yRw8Qka3QAM7j0MbMhWPN+8UwdZkezRz1CzXOPYBAVUva n5tg== 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=X6foTdNByYaza+7IioC5Au+dQ6O1jD1KqRZFfbjoYWg=; b=jOQMB1/d0phDYp5wzNXEIhIswqCzjI+sI5vheQ9C0Z/HdSa1jD1Z+QDeMZrIUUlxpP Ets1Sq7iM3PsPP3JYmhIAM8dYLf5SAIYej42PATd+EFF1or2FKRwGQSGM8O99mvu7QX+ 79SiOT2jJcgFXGZWEHOWQ5S9cxWD+p1EHXFSD9Li4VCuY6Bwn9z2ocquGjLTD5+Avbn4 v9qrOCwB3ObfpeAa5zt4d5rjB3hg2bTwl+Ob5bnnNJtcVnyGjFBWkp6/005cxTV1vh7L MwnsEq9fjddVlB7Q4BR4cagYl7ArLA4B9Ol4TlPDPVD5djIN0u35o3exPUTn+CEXp3ds p2Bw== X-Gm-Message-State: AOAM5331dN7ISSJJt7hhU9M2oSutNY9iP8dNg85z66NGr9AK2NYw+dqF 6ElOsDr6MiZD9uhFmaWj6jc= X-Google-Smtp-Source: ABdhPJx+NO8hs3nQcTr1w1RkQ757q0aA38ZZh4DW7nzWF80tK2zH2HXQsw2IZdsZOYXzR6xqYtxNig== X-Received: by 2002:a05:6214:153:: with SMTP id x19mr3061824qvs.50.1602447766535; Sun, 11 Oct 2020 13:22:46 -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 c72sm2987778qkg.56.2020.10.11.13.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 13:22:45 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Subject: [PATCH v7 05/14] ASoc: sun4i-i2s: Add 20 and 24 bit support Date: Sun, 11 Oct 2020 22:22:15 +0200 Message-Id: <20201011202224.47544-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201011202224.47544-1-peron.clem@gmail.com> References: <20201011202224.47544-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-20201011_162248_709069_9CEB5E6E X-CRM114-Status: GOOD ( 15.79 ) 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 [2607:f8b0:4864:20:0:0:0:f43 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 0b242f4615fe..d5eba58ff207 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,