Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp278163ybt; Thu, 9 Jul 2020 22:46:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5XJ98Sj3KzV2fV5bdaxFbQgv5zdp8feM6xvz2l6WcHwyWdZ/PLzV8zkdaFOMzX4leOs5w X-Received: by 2002:a17:906:3e13:: with SMTP id k19mr58358832eji.476.1594359975077; Thu, 09 Jul 2020 22:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594359975; cv=none; d=google.com; s=arc-20160816; b=qCTXE78gykzdtVs5Dl8K4VAy9XyCfnt6e35bewVaembjx/fH4BxFaAeGO3H6TIfp9a Z/lJkMz3S7aTRbnxECZIUIBeIIyLbLdnOUg2R9/1CyPE52mUoQUQnAMXtTGFtU5PdPuk u+2u4ALB2wP+2vh+RDl06ShrYoVPJI88Afk6eMyDxKzKeBdVgsIzEo2s5UGgbMOqUijD PIvsr93YwL+uDDvHqHr7a/YyhncxIEjHKYJRg7nmCcdqA5xKZZZYnQ3oBEMS2ycZv52j e9mBR4Pf6nCEx0Fgs9YzYfcVWKr3/A/bB69veE71WCHoqqCl5HZ2/l5i+dNcUWme2PU/ Q0Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature :dkim-signature; bh=Xgums4BgP7kONJ1S1G2iTtD3H/SLu3oMYgn5fIT0t8Y=; b=d1rFjTaSRb2/NY7+C5bDmByEu/GoGlijdCme0bAawKXkaGnbKHMYJftD/09h21WUVX mkMCjL6zvl01wV3SGkrOuycipFnxp6k9kRS2XH1Uu6Xix+axbmQ/h4a/dMZ+hVs9HCyS Kb0zyQ6anbFNSVPmjvxleSIhEiqyLHkGjH7BorkvS6S3Cbi77Bu7URs8ggkLT+BQTC7c CJx5I+Hw3Zr7KRF4KwhEirDRugAYIsylv9tYv9N2FfIzuf+/zbhspdAjo5DIZFCUZUuj M0Yp+eDJ0khyuq+Vn6j08cRC0DY2zto3EFDfKJxbakHnyg0me/rLofMRlu7e8KQvrE4t tGFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b="gMySc//R"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Dt7SnWbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si3246290ejy.603.2020.07.09.22.45.52; Thu, 09 Jul 2020 22:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b="gMySc//R"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Dt7SnWbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgGJFo4 (ORCPT + 99 others); Fri, 10 Jul 2020 01:44:56 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:53119 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbgGJFoy (ORCPT ); Fri, 10 Jul 2020 01:44:54 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 037D7E41; Fri, 10 Jul 2020 01:44:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 10 Jul 2020 01:44:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:subject:to:cc:references:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=X gums4BgP7kONJ1S1G2iTtD3H/SLu3oMYgn5fIT0t8Y=; b=gMySc//RQl62/uV2b tNAyPm9nv27hERlYJ4GPJAipW8w1xkOTSTMau9/ekzGB38bKsvfTrPrguF8Tz2DL lGmwPUCqHhU/opnzVKwY6wtChzQm5l2F167ZijDKl2mGRl9yPmGSsmD14hr/anMH WEBVkVlSrgaQ6XwjjIt1bR2vkxYoQc7hg0QWxaJvpbLWJWeGyyv+cU8Yj3cPO1Lj 6GHtJ/SrhuglIK7zOE3v8NKqMZi0uEl3jEX6nZDU3G5n7MquKP+UAFz4J45R5hgc lKfF21M+b8mW7c5t4dVJjJcfuusNaB03gmolYP2MU89SRuuk98IYajcQGqpxBOBC tn1zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Xgums4BgP7kONJ1S1G2iTtD3H/SLu3oMYgn5fIT0t 8Y=; b=Dt7SnWbKtkNRZ0bhd+mHFU8P3YiA8MQf8ElenZvr33lILqcYrIKj+v9+Z tcyKmIZt7WRJ30LXt+We9PE1bn70Tf9/FJwrJ26rbhaX3ctFRnefnXeHcuLhCdyN +o5ebA2YZkdRjXPD4s8b2tz00101qyyCY4nMcwNXhN6HzCDPMUPOV94b6+yB696K Laqi5qBDT1YaDl3o3PS4kAt/KzH+01sQDSA0W5mNSc6oY0wTBajC2p5HK7RByweb DyZP4/F0aYJc6sQ6hp2PUJLdqS2Jf6PQHnwb2l9O2p2IkpXWdpdj8tf6Ww35d0RR BjDsL4r8ORm1P3tEqWkDcLAcMWqfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvddtgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffuvfhfkffffgggjggtgfesthekredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepvedvffegtdeiheefledtkeeljeevtddvfeeuheeuiefhvdejgfek fedugeejjedtnecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgr nhgurdhorhhg X-ME-Proxy: Received: from [192.168.50.169] (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id E50C5328005D; Fri, 10 Jul 2020 01:44:51 -0400 (EDT) From: Samuel Holland Subject: Re: [linux-sunxi] [PATCH 05/16] ASoc: sun4i-i2s: Add 20 and 24 bit support To: peron.clem@gmail.com, Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com References: <20200704113902.336911-1-peron.clem@gmail.com> <20200704113902.336911-6-peron.clem@gmail.com> Message-ID: <1e320dfd-9388-54b2-dba9-7def0bf4bbad@sholland.org> Date: Fri, 10 Jul 2020 00:44:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200704113902.336911-6-peron.clem@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/4/20 6:38 AM, Clément Péron wrote: > From: Marcus Cooper > > Extend the functionality of the driver to include support of 20 and > 24 bits per sample. > > Signed-off-by: Marcus Cooper > 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 f78167e152ce..bc7f9343bc7a 100644 > --- a/sound/soc/sunxi/sun4i-i2s.c > +++ b/sound/soc/sunxi/sun4i-i2s.c > @@ -577,6 +577,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; This breaks the sun4i variants, because sun4i_i2s_get_wss returns 4 for a 32 bit width, but it needs to return 3. As a side note, I wonder why we use the physical width (the spacing between samples in RAM) to drive the slot width. S24_LE takes up 4 bytes per sample in RAM, which we need for DMA. But I don't see why we would want to transmit the padding over the wire. I would expect it to be transmitted the same as S24_3LE (which has no padding). It did not matter before, because the only supported format had no padding. Regards, Samuel > default: > dev_err(dai->dev, "Unsupported physical sample width: %d\n", > params_physical_width(params)); > @@ -1063,6 +1066,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 = { > @@ -1070,14 +1077,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, >