Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp663057ybl; Wed, 14 Aug 2019 04:09:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT7/qD2OpaT8FGyRgAwXn7M2pFEcyTo7iHaHEVvyBeI/hDO0vuc72bZ/r+WLQDhdLdGX0E X-Received: by 2002:aa7:9a5a:: with SMTP id x26mr16129301pfj.47.1565780970295; Wed, 14 Aug 2019 04:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565780970; cv=none; d=google.com; s=arc-20160816; b=Flh4R1T9U6ZcDVSH29xhIHMXWZvvfQCLiKZzAmjGMEQvsoLjjBdQxjKm50THW2mM4p 8UvYgsLJOJP8VT0oBnwBzH4+BLNzXeRUYcKppAeDPObJRPWy4jqI8drtaayyPyxmWnek EGNTF7n5dERdzbqi7UA3ooRLbBshMdd/YG+iy6FtTvc7zuBv69NaTddBA2jv5bqBR0S9 kpISQ4RMUAB9MzHHYZ2QLVQ01uC4TERjG+dPyezvjoHWMzzLG7761XkVkNMmdjpTJStG GQZDoZEos/GGm8E5ma3du+kbC8yYa0OGERXZH7WhcE5FBOVujSVkW+Y1Q7gFo945Cff5 +Z9g== 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=KwvGOULW6ov3FVAc/ci3hbqDH8HsgycwW49ODMQsmVs=; b=ugGZv7TmIcY0f+Dmq4sAlsMl7qMKHgvonaoAJ0wizAupV28+h+dgtMjD/kCP7w9mmd q5uPSW0B7mXfA2Qmy9Mk9Y0vtgnPFh6nCRZErgGlk3b1LFEvmOJpljewZIAMUS9/d41W CG9nHgtsvLfHx4sYiq7Vd2woc4Iy4mjwKnd0h3lb6WXTdF1H6442yrFL+qgWUutfIZXp xHxJKPmSoFDguM2+BchNVEwNo6cExLTzfl+uLtnyFHRLCD3SK2v9ZMuhXRz83ibyx0KK bbfTFwF8xWBPhxtEmA4BzD0A9TQylU9zbzCTE3iyvBf8VPGAelbmVHDCrVDqtRORtMbe eGZw== 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 v10si9573254plo.384.2019.08.14.04.09.14; Wed, 14 Aug 2019 04:09:30 -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 S1727425AbfHNLIj (ORCPT + 99 others); Wed, 14 Aug 2019 07:08:39 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:47179 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfHNLIi (ORCPT ); Wed, 14 Aug 2019 07:08:38 -0400 X-Originating-IP: 86.250.200.211 Received: from localhost (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 97D71E0003; Wed, 14 Aug 2019 11:08:35 +0000 (UTC) Date: Wed, 14 Aug 2019 09:09:23 +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 v5 02/15] ASoC: sun4i-i2s: Add set_tdm_slot functionality Message-ID: <20190814070923.wwkw7hybjvy3p4br@flea> References: <20190814060854.26345-1-codekipper@gmail.com> <20190814060854.26345-3-codekipper@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mpw4oztj7vyrpshs" Content-Disposition: inline In-Reply-To: <20190814060854.26345-3-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 --mpw4oztj7vyrpshs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Wed, Aug 14, 2019 at 08:08:41AM +0200, codekipper@gmail.com wrote: > From: Marcus Cooper > > Codecs without a control connection such as i2s based HDMI audio and > the Pine64 DAC require a different amount of bit clocks per frame than > 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 | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > index 8201334a059b..7c37b6291df0 100644 > --- a/sound/soc/sunxi/sun4i-i2s.c > +++ b/sound/soc/sunxi/sun4i-i2s.c > @@ -195,6 +195,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 { > @@ -346,7 +349,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai, > if (i2s->variant->has_fmt_set_lrck_period) > 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)); > > > /* Set sign extension to pad out LSB with 0 */ > regmap_field_write(i2s->field_fmt_sext, 0); > @@ -450,7 +453,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, > regmap_field_write(i2s->field_fmt_sr, sr); > > return sun4i_i2s_set_clk_rate(dai, params_rate(params), > - params_width(params)); > + i2s->tdm_slots ? > + i2s->slot_width : params_width(params)); This is slightly more complicated than that. On the H3 (and all related ones), the CHAN_CFG_TX_SLOT_NUM and _RX_SLOT_NUM fields in the CHAN_CFG register need to be set to the number of slots as well. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --mpw4oztj7vyrpshs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXVOzowAKCRDj7w1vZxhR xYQiAQDZAhUPiv1ty7F7fpZyPJeJRXOokKvsfX401+9n0UxeEwEAimWXgMxiGvqG BMajnuQhZjSi5H9ncO28lJkw9KzobwU= =2WOa -----END PGP SIGNATURE----- --mpw4oztj7vyrpshs--