Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5118012ybi; Tue, 4 Jun 2019 01:21:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzL7Z/Xt/LBh6ZRnXBcpLM3wFiBBJNvNqKXKKOxFrQ44o0Ioc53vyp0HGd5tRoQOZNiaFiT X-Received: by 2002:a63:295:: with SMTP id 143mr32678237pgc.279.1559636472203; Tue, 04 Jun 2019 01:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636472; cv=none; d=google.com; s=arc-20160816; b=GqLUAgYQMdmEp+T//uqnLkok+8+ZCWyv8ZwD7cykurdWn+bm6lTu/fWNjdw9FtfxQx huUKrsgAz95anszUwGF5uNEOshr6cKJyOrWpsPF5xgJKMvOxw7JK8dRMSKvmKihLb/Jp ngE3tCq07RvCk4EEDldlyMFTtjeOp/wqbM4JHnjO88lgBhaUwYv3vrbTGdkT9gSpv5+R Vg8pOlpxv0l9ojncDjqi46k4JOE7uj/wkKL+SFrrukn4ouMEvAOL9vWg1RFMCt+AQFWN iaC6dTuTRoDKjT9ZgzQJSN4x3SwXVQojpBZ7UQ4ss1OlyfjBAohg2xYBsaNpAjD0awRt R1cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9UWtirACw+rNqV3ipCQvyl6DP0qTNeFrEN4cTGJCp4Y=; b=BajIpDSuJb4n1jHzhUUn1lIUntJ5wv23MnMygwmMkr80IXmKbcqk9K4S0fuahSyw+m HgMqYvc9HFoWh+mPUFm3aDHfqY47nQDFc7eOKN88d1zX3yF5sGWS4VnH54LEdlhETwYC Kd5GPoAUZYmXQBQViT+xGE4cuKfvUEv7P3fWjoR6rp6EX2m71F5rft3KO7kxksr0wUja lOK0L6SvmbLqLBPspjH4dN1UzH74oKl56D2BH0myN16gcfd+ieItXxwDM5+8WB8IdoOV xqhT6D7SROaN3KbjhorkrRPgkWeUQr4TIWdTewbdYQT8EIXaigEQLN843QKhkfqtbvMj rLnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si24059759pfd.64.2019.06.04.01.20.55; Tue, 04 Jun 2019 01:21:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbfFDITq (ORCPT + 99 others); Tue, 4 Jun 2019 04:19:46 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:43529 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726844AbfFDITq (ORCPT ); Tue, 4 Jun 2019 04:19:46 -0400 X-Originating-IP: 90.88.144.139 Received: from localhost (aaubervilliers-681-1-24-139.w90-88.abo.wanadoo.fr [90.88.144.139]) (Authenticated sender: maxime.ripard@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id D55676001C; Tue, 4 Jun 2019 08:19:38 +0000 (UTC) Date: Tue, 4 Jun 2019 10:19:38 +0200 From: Maxime Ripard To: codekipper@gmail.com Cc: wens@csie.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, lgirdwood@gmail.com, broonie@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, be17068@iperbole.bo.it Subject: Re: [PATCH v4 8/9] ASoc: sun4i-i2s: Add 20, 24 and 32 bit support Message-ID: <20190604081938.npye7brtjv7c7noj@flea> References: <20190603174735.21002-1-codekipper@gmail.com> <20190603174735.21002-9-codekipper@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6wxkr4ordbttpslj" Content-Disposition: inline In-Reply-To: <20190603174735.21002-9-codekipper@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6wxkr4ordbttpslj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 03, 2019 at 07:47:34PM +0200, codekipper@gmail.com wrote: > From: Marcus Cooper > > Extend the functionality of the driver to include support of 20 and > 24 bits per sample for the earlier SoCs. > > Newer SoCs can also handle 32bit samples. > > Signed-off-by: Marcus Cooper > --- > sound/soc/sunxi/sun4i-i2s.c | 34 +++++++++++++++++++++++++++++++--- > 1 file changed, 31 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > index 3549a87ed9e9..351b8021173b 100644 > --- a/sound/soc/sunxi/sun4i-i2s.c > +++ b/sound/soc/sunxi/sun4i-i2s.c > @@ -428,6 +428,11 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, > case 16: > width = DMA_SLAVE_BUSWIDTH_2_BYTES; > break; > + case 20: > + case 24: > + case 32: > + width = DMA_SLAVE_BUSWIDTH_4_BYTES; > + break; Doesn't this test the physical width? If so, then I'm not sure that 20 even exists, and that we can support 24. > default: > dev_err(dai->dev, "Unsupported physical sample width: %d\n", > params_physical_width(params)); > @@ -440,7 +445,18 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, > sr = 0; > wss = 0; > break; > - > + case 20: > + sr = 1; > + wss = 1; > + break; > + case 24: > + sr = 2; > + wss = 2; > + break; > + case 32: > + sr = 4; > + wss = 4; > + break; This doesn't really works, wss being the slot size, and you can have a different slot size and sample size. I have a patch that reworks this, I'll send it. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --6wxkr4ordbttpslj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXPYpmgAKCRDj7w1vZxhR xa21AQCOpQgoV29jgv0RoMH3aHTxjdGgvHs09RTrroaqdpxRWgEA02ukNRDWozBj j4PRdKMEMXcX9YvD//OOJzSeiWrRJwc= =ykij -----END PGP SIGNATURE----- --6wxkr4ordbttpslj--