Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3679789pxj; Tue, 15 Jun 2021 06:26:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtmXpERzeQgfvi5tNpR3hzuh9hso7PgH1rGz9ilctVJaTYe8R74tQQewl72nILxMkCjDbT X-Received: by 2002:a17:906:17c4:: with SMTP id u4mr21217463eje.481.1623763561257; Tue, 15 Jun 2021 06:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623763561; cv=none; d=google.com; s=arc-20160816; b=rohPXl1g8ZkbNvFe9rruGs0jzHIcpLV3pyIXMOeX6WKJnMDS6dLGUpEm3zQyRz1nPI NMfs0JK5ammhXxzWas03ZrLaRNTZzw8wL55Vf/Co0UQESP88vcY8laQXH9uks2h/TiTI HceAJWjXEW+0GgFfYcrW4v9kFI9dzTRwzjnV04MlyV/BZABHEnEEkDfeN5RCCyqAZXw1 jRzMF6YX2lI/E/kuccBS6R+D1/YqZqMutUVWjrwWw9QCi2tAADDFGrMZYAmjPVWlamY1 s8lBNv3k5X/Hqjtv5gUaXzorpKVpVyOFtvHFa+iuhMOqXP+9yaFQDwx27vrJDgf0Foxy KTQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=EfdncmlUHev+4Llqm2SrEEq9r1vc43R943iX7KloADw=; b=zvji4A6ErMs22tpIyo0NbDCUwOMFwRCDrhAs15vqgc2MfnOMSrn5ZRZ1rtuZ8Im8ud 55hblxhGIzZDpDOhOVZwpDWAUAmjUkzKyZp7bm4uI7NqT/lg34fU9gdtVQsgDc4slEPZ zOULxO2uqq+ppGo0MoFieZk/M00uWpRul0+6Aldl9xB66rTxs3SMNHZuffOVB6KjJSk3 mqeHQMihmkx0E/9o+l00R7unOBhMbuCfI9JTfGbwuZY8jBtpC66f99GQPqqsqq31rIMM QzrjjRDR6mE7xjfT/9bmrRH3fSUnuW/O19iXY2ypZQz3DMQpf1KGIEuZjf55F2Uv5Nsd NtJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B9/fxC+x"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 23si14249299ejn.487.2021.06.15.06.25.37; Tue, 15 Jun 2021 06:26:01 -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=@kernel.org header.s=k20201202 header.b="B9/fxC+x"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbhFONYm (ORCPT + 99 others); Tue, 15 Jun 2021 09:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:47480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbhFONYl (ORCPT ); Tue, 15 Jun 2021 09:24:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E83DE6145D; Tue, 15 Jun 2021 13:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623763357; bh=gEckdQ1fONPY0GbSS0QNPbmgrAH5DwXuznd4hNS52tE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B9/fxC+xANRpAHRXgng3cAOOBxa1PwWHSbfVjGlfAEA3M4uPI8U4B/1wxV73oyaB0 zeXyCIBUrdHFwf2j2FoGKtTvftVQYWlenq/RplHaAWbimVQ5PeD3aVKEVVnano1m2D 7fl5panuQIw00osH8J/CLKBGcTibRmv6EJoVMbkXbQwNcZo3frdCCFUGpKpDpFQc6S TsJeUXqHO/z2tcl6VTNA0BMb8gXacIxsSoZNVB7HL4PyqmQOfRQaNJwwhzCdUWsRql J3cpQGM6bXWwI8JgySNLdRj7j4b3EPjmCG2osaPHbYciASLL5TSPeshsS3tV5Smi+g g+eZK9IcZcQ5g== Date: Tue, 15 Jun 2021 14:22:07 +0100 From: Mark Brown To: Ban Tao Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, mripard@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, p.zabel@pengutronix.de, samuel@sholland.org, krzk@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 1/2] ASoC: sunxi: Add Allwinner H6 Digital MIC driver Message-ID: <20210615132207.GG5149@sirena.org.uk> References: <20210615130326.2044-1-fengzheng923@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+sHJum3is6Tsg7/J" Content-Disposition: inline In-Reply-To: <20210615130326.2044-1-fengzheng923@gmail.com> X-Cookie: See store for details. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+sHJum3is6Tsg7/J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 15, 2021 at 09:03:26PM +0800, Ban Tao wrote: Other than a few small things this looks good: > +M: Ban Tao > +L: alsa-devel@alsa-project.org (moderated for non-subscribers) > +S: Maintained > +F: Documentation/devicetree/bindings/sound/allwinner,sun50i-h6-dmic.yaml > +F: sound/soc/sunxi/sun50i-dmic.c Not the binding document? > @@ -0,0 +1,408 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * ALSA SoC DMIC Audio Layer > + * > + * Copyright 2021 Ban Tao > + * Please make the entire comment a C++ one so things look more intentional. > +static void sun50i_snd_rxctrl_enable(struct snd_pcm_substream *substream, > + struct sun50i_dmic_dev *host, bool enable) > +{ > + if (enable) { > + } else { > +static int sun50i_dmic_trigger(struct snd_pcm_substream *substream, int cmd, > + struct snd_soc_dai *dai) > +{ > + int ret = 0; > + struct sun50i_dmic_dev *host = snd_soc_dai_get_drvdata(dai); > + > + if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) > + return -EINVAL; > + > + switch (cmd) { > + case SNDRV_PCM_TRIGGER_START: > + case SNDRV_PCM_TRIGGER_RESUME: > + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: > + sun50i_snd_rxctrl_enable(substream, host, true); > + break; > + > + case SNDRV_PCM_TRIGGER_STOP: > + case SNDRV_PCM_TRIGGER_SUSPEND: > + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: > + sun50i_snd_rxctrl_enable(substream, host, false); > + break; This is the only caller of _rxctrl_enable() and _rxctrl_enable() shares no code between the two cases - just inline _rxctrl_enable() here, it's clearer what's going on. > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + base = devm_ioremap_resource(&pdev->dev, res); devm_platform_ioremap_resource() --+sHJum3is6Tsg7/J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmDIqX4ACgkQJNaLcl1U h9BFogf/Tnpp6hX2cq5N3NCHguSmWr1ckDT5UzZ3tO6YlJxdzXVMe22vxaLJDy4q Zlm/Gl8BtlPgD3JaDGanLEd/hgmKWnYa0wPL4Xiun7ETkZtDpUBn2vsn/18zj/Vi NvetwyxxDuh8SKNZi/mDlBzOWwzESHPvdsb9fYm9vNKJq39+/qlrGdjhnfzk5cSe MxHNaRf6/DuZ7aWWlKFMUa8RNg8lokH/9glCEVfo7U0mqBIdwJE3ihP9HgLGnKOx QDwWn7mdiF1BUehsZ7Q0NFd8POMl0CWFMv3x5Lg5qQ2VJ8XfvNvLQA6Rb1/tz69C TVUrQ9PedgJniopAz/WN57nQwApKng== =fxZ7 -----END PGP SIGNATURE----- --+sHJum3is6Tsg7/J--