Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5094131ybi; Tue, 4 Jun 2019 00:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDc7m7KTUUhgVs03al6n17yA1EYWIQO3NP+IGo7iMNTnXA4wAArG+ctoa5ANL6omDKSRKZ X-Received: by 2002:a17:902:222:: with SMTP id 31mr35729226plc.55.1559634714724; Tue, 04 Jun 2019 00:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559634714; cv=none; d=google.com; s=arc-20160816; b=H3M12W+XmMlf6wzU/IBZDG/nN2BgZ4aMDFC9omk7+ls+/prUTs4xUFZ7MCqASZJoSp P1VeP225F6ZAG4/1dzPibWaM66a4weCu+RBEBP5ZumQ6QslSxdky0HG4GwSfxOaqObae vhECPt9ThuO83lcyEY67FxOZNLLxhgzvOqfuYyLL+ekanzBptijhF//+Ur+mcQBrdOml eLXL2qdPnfriLrgCbTXHK8o4Gx9FLHY66Z4A6CM6bvwDtbxoyLRllrKYxxZWfX/cNWYA iYOwyjT7YGtbKFHj9lWDoijav/xQFzcWq90z+i0V1cT/FygqaDjTcFbAIgZaQo2MZXKD 8BUw== 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=ShiZtTqhuwDq4jDvGRdAK1Z9sWNynbUu2CsUGfRCVqU=; b=n3FoVGlTEDCMU7Q4/+abXnLeMhbXeBxwk8HKGRERNf6Q2OHB9mxpmCwu/FfYJkIcO1 Vx4+CvMzDMr5mCjtYqarG06ylBIV+1OKv9x+w0bcP+w9RgRQhim4LdN1zKmwr9Vz/b8M IJKV8QTRwPu96Wy7N+hQXs5RQ+sgilBAXWV2HyazKNU2TS4LVaJKEd8D51KuCxCGZ6Fl vsTmycStMmNh51V54IJAamI9jk2QSPD5MSMT7vxBoeouMgvilcRwhBOrJh1QOwVU+Hyr 5Uw9UGs2Lo73Hu+lRQaRMjILn3ljDIDFeiCodHDXN+LIrS0wZlrSFrHPzHRxZXHfQhwR RqbQ== 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 h190si20162015pgc.248.2019.06.04.00.51.39; Tue, 04 Jun 2019 00:51:54 -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 S1726957AbfFDHtt (ORCPT + 99 others); Tue, 4 Jun 2019 03:49:49 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:55043 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfFDHtt (ORCPT ); Tue, 4 Jun 2019 03:49:49 -0400 Received: from localhost (aaubervilliers-681-1-24-139.w90-88.abo.wanadoo.fr [90.88.144.139]) (Authenticated sender: maxime.ripard@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B8E6B10000A; Tue, 4 Jun 2019 07:49:40 +0000 (UTC) Date: Tue, 4 Jun 2019 09:49:40 +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 5/9] ASoC: sun4i-i2s: Add set_tdm_slot functionality Message-ID: <20190604074940.pwzggjluksv7xxel@flea> References: <20190603174735.21002-1-codekipper@gmail.com> <20190603174735.21002-6-codekipper@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ld4z4b6632jtjjwn" Content-Disposition: inline In-Reply-To: <20190603174735.21002-6-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 --ld4z4b6632jtjjwn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 03, 2019 at 07:47:31PM +0200, codekipper@gmail.com wrote: > From: Marcus Cooper > > Some codecs require a different amount of a bit clocks per frame than Which codec? And what are the actual requirements? > what is calculated by the sample width. Use the tdm slot bindings to > provide this mechanism. > > Signed-off-by: Marcus Cooper > --- > sound/soc/sunxi/sun4i-i2s.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > index 329883750d6f..bca73b3c0d74 100644 > --- a/sound/soc/sunxi/sun4i-i2s.c > +++ b/sound/soc/sunxi/sun4i-i2s.c > @@ -186,6 +186,9 @@ struct sun4i_i2s { > struct regmap_field *field_rxchansel; > > const struct sun4i_i2s_quirks *variant; > + > + unsigned int tdm_slots; > + unsigned int slot_width; > }; > > struct sun4i_i2s_clk_div { > @@ -337,7 +340,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai, > if (i2s->variant->is_h3_i2s_based) > regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT0_REG, > SUN8I_I2S_FMT0_LRCK_PERIOD_MASK, > - SUN8I_I2S_FMT0_LRCK_PERIOD(32)); > + SUN8I_I2S_FMT0_LRCK_PERIOD(word_size)); This is an unrelated change, it should be in a separate patch. > > /* Set sign extension to pad out LSB with 0 */ > regmap_field_write(i2s->field_fmt_sext, 0); > @@ -414,7 +417,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, > sr + i2s->variant->fmt_offset); > > return sun4i_i2s_set_clk_rate(dai, params_rate(params), > - params_width(params)); > + i2s->tdm_slots ? > + i2s->slot_width : params_width(params)); > } > > static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) > @@ -657,11 +661,25 @@ static int sun4i_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, > return 0; > } > > +static int sun4i_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai, > + unsigned int tx_mask, unsigned int rx_mask, > + int slots, int width) The alignment after the wraping should be at the opening parenthesis. > +{ > + struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai); > + > + i2s->tdm_slots = slots; > + > + i2s->slot_width = width; > + > + return 0; > +} > + > static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = { > .hw_params = sun4i_i2s_hw_params, > .set_fmt = sun4i_i2s_set_fmt, > .set_sysclk = sun4i_i2s_set_sysclk, > .trigger = sun4i_i2s_trigger, > + .set_tdm_slot = sun4i_i2s_set_dai_tdm_slot, Please sort them by alphabetical order. Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --ld4z4b6632jtjjwn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXPYilAAKCRDj7w1vZxhR xYXiAP0bXRYymU/3+ZTKYuLhieHKCw+su1ZTlL8VmZhDNotmdQD+PVY0AsWtlw/f 1o88nw8RTpP0U6hdQ3I6QSx5EAHp6Ao= =vM/5 -----END PGP SIGNATURE----- --ld4z4b6632jtjjwn--