Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp568290ybl; Wed, 14 Aug 2019 02:31:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqynU9FYBA5UqtpDDpRLKM7Z6lal12CLh4OjiE/jVUgQ1N9/UC/CjcSoVsW+07BciJx8bXWN X-Received: by 2002:a65:684c:: with SMTP id q12mr35662527pgt.405.1565775103592; Wed, 14 Aug 2019 02:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565775103; cv=none; d=google.com; s=arc-20160816; b=I3I+qQdKMwDqL9Doze+Yt4/ZP+/osdr8wkPbPRqvGl2tNUWldlfU/irzUIEtfa1Nmq nqYbi+bafbDep9PbUxlxgreNxNkkluVLOefS8Tk3/I7x3jiuzMGqDYztJJtNT8HiD7V+ y6IIPdPCztFziAyB6tz2fQLGDAM87mNwMG0dNAit5Ke4oyC9D8Iht9IqmCNEo5VWA3hW 8YwiAncOl/06M1X9QDyl/9kGa32+KwXZQkJ+UX8aTcSKadDnDriZoykK43FEqwQDL+SV 41+cpbVt89p8rW69tAA92v6RZ33X2GPdwV/8NiLQBZ2Nl+T/AC4NUpF4J7+FQPv4tva+ Tz7g== 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=v9qswxVy3dhs4GBr5jsRkUeG6VCbad8w9toRrnKPrhA=; b=CjW+31g5uS793bmBREODjJhI8cStXkT3z4jimw/fndw/baAIW8+gNeU+JMvfqsJGfL kTsllsP/QloO0A+I6D6Kdwql1ju70dbDgLwUcgqUYVBwEY+XpSBW5xslK71+atGtcE5g 5F9dx/9loFqI6NzhHBs2QF+jrWxARi3+rGCJK5HWO8MLuP9cxdxPVms72df9/l4c59cG gizUejdxpUG3bsJMrYyFswICi6mT4nAbvYuliZcBNzVq3ca8s3xpsPmOhJJLiVeAhFvm vv373VbwQAIEIj6nI6V5b7yc/RrdkH3khH1seB/a4gb0MoZwn0g9WzM+J0kOpu/iWxAe NB8A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si18546730pgb.566.2019.08.14.02.31.26; Wed, 14 Aug 2019 02:31:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbfHNJaP (ORCPT + 99 others); Wed, 14 Aug 2019 05:30:15 -0400 Received: from mail-ed1-f100.google.com ([209.85.208.100]:34834 "EHLO mail-ed1-f100.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfHNJaO (ORCPT ); Wed, 14 Aug 2019 05:30:14 -0400 Received: by mail-ed1-f100.google.com with SMTP id w20so109299898edd.2 for ; Wed, 14 Aug 2019 02:30:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=v9qswxVy3dhs4GBr5jsRkUeG6VCbad8w9toRrnKPrhA=; b=kokv2WiVL2NeJT1tr7XNMK3EHxZ2WFprEyfv+HiM5sEf00n2jLyDPjw0to+7/CmWwD ZdzhQASYVqJN5NtArFlJ1TNLL9rBQqStE+7QiRCKwjaW0/XAuFQMqWPbznWe4smEdpJM bVetpaMCHOOge3QfkDwJ0AK92Ydj83jliU37spLO3Sa7s5B9A1nNgcNwl5/tsZN6KJ1/ DS9UTjKVKPeA+gvcaxJUe9dgmMo6yH2LAE1TJ2TrGC+gy3vNoN6cYBHUYM9VZw6bhrJS t8tgyh5r4x0XlY3gbWPhwgcV85ev97X/C3AovRc73L4E/a1bIV30OMh2dg/EO2oOOuRG B/6w== X-Gm-Message-State: APjAAAXEuLOdCT9Ts873Nj9Tl23ue1Q0hbICk2XKi6d+QkQlkOOWNaO/ gmV2fFgbccuHvUz1SBE9pJCdYbRdNA+Er925SK51hGzqABee4lJlvhla00DbJhA7cA== X-Received: by 2002:a50:eb8f:: with SMTP id y15mr46657373edr.31.1565775012649; Wed, 14 Aug 2019 02:30:12 -0700 (PDT) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk. [2a01:7e01::f03c:91ff:fed4:a3b6]) by smtp-relay.gmail.com with ESMTPS id dd24sm47927ejb.47.2019.08.14.02.30.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 02:30:12 -0700 (PDT) X-Relaying-Domain: sirena.org.uk Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hxpbg-0004iH-3X; Wed, 14 Aug 2019 09:30:12 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 3A9C92742B4F; Wed, 14 Aug 2019 10:30:11 +0100 (BST) Date: Wed, 14 Aug 2019 10:30:11 +0100 From: Mark Brown To: codekipper@gmail.com Cc: maxime.ripard@free-electrons.com, wens@csie.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, lgirdwood@gmail.com, 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: <20190814093011.GD4640@sirena.co.uk> References: <20190814060854.26345-1-codekipper@gmail.com> <20190814060854.26345-3-codekipper@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/3yNEOqWowh/8j+e" Content-Disposition: inline In-Reply-To: <20190814060854.26345-3-codekipper@gmail.com> X-Cookie: Bridge ahead. Pay troll. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --/3yNEOqWowh/8j+e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 14, 2019 at 08:08:41AM +0200, codekipper@gmail.com wrote: > From: Marcus Cooper >=20 > 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 This isn't a universal property of CODECs without a control, and it's something that CODECs with control can require too. > return sun4i_i2s_set_clk_rate(dai, params_rate(params), > - params_width(params)); > + i2s->tdm_slots ? > + i2s->slot_width : params_width(params)); Please write normal conditional statements unless there's a strong reason to do otherwise, it makes things more legible. > +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) > +{ > + struct sun4i_i2s *i2s =3D snd_soc_dai_get_drvdata(dai); > + > + i2s->tdm_slots =3D slots; > + > + i2s->slot_width =3D width; > + > + return 0; > +} No validation of the parameters here? --/3yNEOqWowh/8j+e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1T1KIACgkQJNaLcl1U h9CHugf6AjRO807eogpoF+xMNPWXjrK1Id3f+lBIjI+eQIHyysNsaOoU2cQm/xpC oDixIET5TAwZtKrSpkmHPVk9ZdJFE8nzoUiZMauPOO+HKM9gxv73e4YXXimy08Id KWmW6ajMPF2vgbrlU9j4HyPF/PxSxlDeqz4gzzhQ0SITqZa4TVFCdgM5xGuoAOLT FVoipx99YfkemyMLeUmW+WS9z+cgq9EHznThZa/kKkdCxJLErL4JPuhOQ2s7o5JH fB9HoFqiF8YFLE3tkcUf7qhIwq5913DuC2PH3bX4GPleK1PfH41JvD0+QBj1Aw00 BLuoNb+o7HReyWJhvgG0NOHxFgnQgw== =bgB5 -----END PGP SIGNATURE----- --/3yNEOqWowh/8j+e--