Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp252846lqp; Tue, 11 Jun 2024 03:37:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlEi+BhVm3I9xPyN3gGKQ3YflFxfRr1geujLC5UD1vimzNoFyWvseOkr3kTsaJJV/Ki23a1P5eKiv6WR7LKehRNxfYFGN4X8t1pTyZ0w== X-Google-Smtp-Source: AGHT+IHJlNFvZGT9CsL1OFmQOZcO8ox+AztFWtVEG756J5jlMzBmYVPJ4DDDUL89uWSFp6XAryuq X-Received: by 2002:a17:906:fac4:b0:a6f:1785:d18 with SMTP id a640c23a62f3a-a6f178511c4mr359123866b.44.1718102228441; Tue, 11 Jun 2024 03:37:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718102228; cv=pass; d=google.com; s=arc-20160816; b=ThOCK2CujO8t5zB/dLTWR8OBSkeMNhORH7HIR+VEy+4uFFFyLugc0nPqUVwwEDGWQ/ hNT39yA3Ml1X1+HpdAG7mU2spR3BksWBawgwH7zuIS652dDH4V2XDSjft2dHKxcGUt2g vQ0jkJU7uulQ4dZCqrC0fwIyu5KmLEXvJMQsfdKHVluq8a4GDMvB8qtbikB+c4CmPZCC c5Fet2EcAfJarWMwYs8/BTzbx315UuX0gUjfbZPBr7iwm5QbF46jOriDrSyoOyCIp3uH eTNlkskbhKW1Y5g2IKuaimd/zCbxctemAg4gc9LiS+v169bHcTuLnuPTmistYkmvs9e3 Me/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZDk0lb+pamCbyyNoX/Aagt7elmRC0yFEZNodrKH9vxc=; fh=XdMbcAXvzfiG+maoS4L+89hsXqyYKNyaycRemLho4qo=; b=T/d15/0V4IJgXqQJdUhzQJIbo9CxkNZtyDOqFlHOvQhCDHFAbWws3dTkAAeAzsCBk5 4In/fwErSBwmmgXwkDSKh9neXoR61R7rHA5GnTJmqo2jLtjma3d+IG7gEyghzP4Q9HpQ Qx+80j4Qy+TpIb7RFv3vr4OYM0yeehatm0lS4z1SNSLp14kU6C75YS1bGP1uLimqjAZh D8VooiwwXewpTCKRohFrZB6CEe+GjKXoiLw2h2UPqoEO4F3sVy33C7wj+NRvWKJwUBiX aK7so4NihX7gXbGKjKHt9oDHdFJvxOASjjOVBQr+SdaDoszqPKaIMk661BKIHnI93MhP +Ovg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gqnSTrD7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef6ad415dsi386524666b.298.2024.06.11.03.37.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 03:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gqnSTrD7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2BE051F239B0 for ; Tue, 11 Jun 2024 10:37:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 871161791EF; Tue, 11 Jun 2024 10:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gqnSTrD7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9520217625F; Tue, 11 Jun 2024 10:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718102194; cv=none; b=qL29jm8PYE+DaV6+N2svo3DX5MngJeQy3+EDYX5vJA5MAEpPMyuab5P32FE4zT5a2u/vxJZZmqgdTI63/7Y4jio+6B9tdu9AsteBNxRbobevUwyuNk1ealGmVtrad+u6hhfjJCqrAIKC2HEUwaByjyrafPk1KJumo1it7QT8mGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718102194; c=relaxed/simple; bh=GRiJHJeBxHjjSrVuUZQEjtAnkrsyVP3YUixQ0bIDogY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=egSkc74t/cHzKV2foaGBE7sdeU73j6WaYKm6JZXcwRBnOqR+red11vkVtaLsYutbYTRvoZrGjL2ZpPE09NKZBw+QciWwz/ZUWYUvOdQ6XEiNlH92Rtyz85LgGoX+kuvs/xvkDDZZCE7RGXI+6OJKw8s7jeMR1DybqE1eEPK+Jws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gqnSTrD7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 985F7C2BD10; Tue, 11 Jun 2024 10:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718102194; bh=GRiJHJeBxHjjSrVuUZQEjtAnkrsyVP3YUixQ0bIDogY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gqnSTrD70/+vXgJD/5znDSFJoVnc7K8K6uckcQ3lWeVRuhL/70lTfzEN+6ZMRR5lU QpQDparoIxqKCPK+ccn2ON/mf/aml+H+R07RM2rKDM74OfVrDpDvb32r1jk0nCddBM bEfy3OIM2u+OlkNS0DYGtBXRG4SSa3ywLYgv06ekYWDSRayaANzBun4myW4uzyDWYw 4Mx+j0Y5GL1WQv//PFcyjnu7Mzd7jbs82fy0aK74PKm+R1B6eB+DKMasNzMylER/jO KnUJJ0KBuxv00TT2P5DjcpJSoOIepMikp0zRLYUGJ4KdtBh5MMNf+FY8B/l+0rbXFa E1M3eM9xJvUEw== Date: Tue, 11 Jun 2024 11:36:31 +0100 From: Mark Brown To: Piotr Wojtaszczyk Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vladimir Zapolskiy , Russell King , Jaroslav Kysela , Takashi Iwai , Chancel Liu , Arnd Bergmann , Michael Ellerman , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [Patch v2 1/2] ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs Message-ID: References: <[PATCH]ASoC:fsl:Addi2sandpcmdriversforLPC32xxCPUs> <20240611094810.27475-1-piotr.wojtaszczyk@timesys.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WW949k97zQLQvi69" Content-Disposition: inline In-Reply-To: <20240611094810.27475-1-piotr.wojtaszczyk@timesys.com> X-Cookie: Your love life will be... interesting. --WW949k97zQLQvi69 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2024 at 11:47:51AM +0200, Piotr Wojtaszczyk wrote: > arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 4 + > arch/arm/mach-lpc32xx/phy3250.c | 60 ++++ These architecture changes are separate and should at least be separate commits, copied to the architecture maintainers. > +FREESCALE SOC LPC32XX SOUND DRIVERS > +M: Piotr Wojtaszczyk > +L: alsa-devel@alsa-project.org (moderated for non-subscribers) > +L: linuxppc-dev@lists.ozlabs.org > +S: Orphan > +F: sound/soc/fsl/lpc3xxx-* > + It seems a bit odd to add yourself as a maintainer while also marking the driver as orphan? > +config SND_SOC_FSL_LPC3XXX > + tristate "SoC Audio for NXP LPC32XX CPUs" > + depends on ARCH_LPC32XX && SND_SOC On a quick scan I can't see any architecture dependency for build, please add an || COMPILE_TEST for improved coverage. As for all the other things enabled in this Kconfig file there is no need to explicitly depend on SND_SOC. > @@ -42,6 +43,7 @@ obj-$(CONFIG_SND_SOC_FSL_XCVR) +=3D snd-soc-fsl-xcvr.o > obj-$(CONFIG_SND_SOC_FSL_AUD2HTX) +=3D snd-soc-fsl-aud2htx.o > obj-$(CONFIG_SND_SOC_FSL_RPMSG) +=3D snd-soc-fsl-rpmsg.o > obj-$(CONFIG_SND_SOC_POWERPC_QMC_AUDIO) +=3D snd-soc-fsl-qmc-audio.o > +obj-$(CONFIG_SND_SOC_FSL_LPC3XXX) +=3D snd-soc-fsl-lpc3xxx.o > =20 Please try to keep these files sorted alphabetically (it's not 100% at the minute but no need to make it worse). > --- /dev/null > +++ b/sound/soc/fsl/lpc3xxx-i2s.c > @@ -0,0 +1,383 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Author: Kevin Wells > + * Please make the entire comment a C++ one so things look more intentional. > +static u32 absd32(u32 v1, u32 v2) > +{ > + if (v1 > v2) > + return v1 - v2; > + return v2 - v1; > +} Just use abs()? > +static int lpc3xxx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned= int fmt) > +{ > + struct lpc3xxx_i2s_info *i2s_info_p =3D snd_soc_dai_get_drvdata(cpu_dai= ); > + struct device *dev =3D i2s_info_p->dev; > + > + if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) !=3D SND_SOC_DAIFMT_I2S) { > + dev_warn(dev, "unsupported bus format %d\n", fmt); > + return -EINVAL; > + } > + return 0; > +} If we're validating for I2S we should probably validate for clock provider too. Or just remove the function, it's not really needed? > + i2s_info_p->clk =3D devm_clk_get(dev, "i2s_clk"); > + if (IS_ERR(i2s_info_p->clk)) > + return dev_err_probe(dev, PTR_ERR(i2s_info_p->clk), "Can't get clock\n= "); > + > + i2s_info_p->clkrate =3D clk_get_rate(i2s_info_p->clk); > + if (i2s_info_p->clkrate =3D=3D 0) > + return dev_err_probe(dev, -EINVAL, "Invalid returned clock rate\n"); Nothing ever enables this clock. > +static int lpc32xx_i2s_remove(struct platform_device *pdev) > +{ > + return 0; > +} Remove empty functions, if they can legitimately be empty the framework will support them being absent. > +#define _SBF(f, v) ((v) << (f)) FIELD_PREP() > +#define _BIT(n) _SBF(n, 1) BIT(). > +/* I2S controller register offsets */ > +#define I2S_DAO 0x00 > +#define I2S_DAI 0x04 > +#define I2S_TX_FIFO 0x08 > +#define I2S_RX_FIFO 0x0C > +#define I2S_STAT 0x10 > +#define I2S_DMA0 0x14 > +#define I2S_DMA1 0x18 > +#define I2S_IRQ 0x1C > +#define I2S_TX_RATE 0x20 > +#define I2S_RX_RATE 0x24 Add a prefix to all these I2S_ names in case of collisions. --WW949k97zQLQvi69 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZoKKsACgkQJNaLcl1U h9DNgQf/bVmcCufP8jvhRnYGwhJ74PYfe8uGNqVDcvOPBqyxwbAHEcBkY4os9h6R GoQMz21Qh+ZtEks0KjHFDl3Lnd51Kac5YBeyl5s/WRciIBOxe+jSqmW0GpRYZwZ+ YEMXUIyS6zA8Tik8onJLOtFrl4wLHXafkWOOPulK5v8+mZXYqPypwKq87c43IkrI MviOLdW4TB0CVCKvk590+1YPY+ZBBAELM6eO/D9du/AyvN+BkUnZLO/VOwQ4enRQ r2xnb2uSXMbDtKZKr4PbNw+9NbNaw9axfSzHbwXCu1Z0y+eOEKS1Vu2613VY9Al0 VKMHNg0tTYcWMk0XTzihz60mgPSf0A== =srbB -----END PGP SIGNATURE----- --WW949k97zQLQvi69--