Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 747B9C433F5 for ; Fri, 11 Mar 2022 12:35:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C645E184D; Fri, 11 Mar 2022 13:34:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C645E184D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1647002107; bh=l52G/3EL1DzyxVZx84teUiSVNYNzHgNdsdEWIqzH+nM=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JgIBhQQLpClO71/BDXUnnWp2imISTwvRSNQHJ9MuGWMA2beVWldtDpqGnQN3lzxOu 3uCy+DkSa8jZKLBzgmwO4+ICRPe0SjhpVhZZu0Yy3Csm4ISsi8RuqSgz/OPaccgk1T +ixIoovN+53FjNizrqYajI6oOgzPMKLzP/9LpqgY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4EC3AF801D8; Fri, 11 Mar 2022 13:34:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FA12F80227; Fri, 11 Mar 2022 13:34:15 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 178CEF800D2 for ; Fri, 11 Mar 2022 13:34:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 178CEF800D2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N5/bTy2r" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D82D61CFF; Fri, 11 Mar 2022 12:34:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17000C340E9; Fri, 11 Mar 2022 12:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647002049; bh=l52G/3EL1DzyxVZx84teUiSVNYNzHgNdsdEWIqzH+nM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N5/bTy2rv9QBUzQ2bRdsCm6VeUwy9CIGdIOBquIYL6I99MTvSnxzZziRTE4O+J75X SoYIA4WiYWI8NG2sLAXK1UDLDP6JJtaljYaH+mI3FGupXiuQ7n3dpJ8wuJjcOFkVnV ky5oPNsx2FQgslvSCJ2RfhBoy4k14Je36PsS5+nc/4ApnboqWb8afbDM27RhjXnLfz mmOOjBEUAKQ++HaZGTS2vxmnFlLkH3Qkjd4LrPHHXzfXG/3ksiTEuywunys3f0/F/k crT2DEhKWXvQ22HnV44eyEopUnsvdNmFQUPxhqBLki2HOtGY/a/ORTB0rxeoTsCd1M OjrqPPbu1YDsw== Date: Fri, 11 Mar 2022 12:34:04 +0000 From: Mark Brown To: Gregory CLEMENT Subject: Re: [PATCH] ASoC: tlv320aic3x: add dmic widget support Message-ID: References: <20220311100627.2181756-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0/mZOjcrntyubmya" Content-Disposition: inline In-Reply-To: <20220311100627.2181756-1-gregory.clement@bootlin.com> X-Cookie: A fool and his money are soon popular. Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" --0/mZOjcrntyubmya Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 11, 2022 at 11:06:27AM +0100, Gregory CLEMENT wrote: > +static const char * const aic3x_dmic_rates[] = { "off", "128x", "64x", "32x" }; > +static SOC_ENUM_SINGLE_DECL(aic3x_dmic_rates_enum, AIC3X_ASD_INTF_CTRLA, 0, > + aic3x_dmic_rates); > +static const struct snd_kcontrol_new aic3x_dmic_rates_controls = > + SOC_DAPM_ENUM("Route", aic3x_dmic_rates_enum); ... > + {"GPIO1 dmic modclk", NULL, "DMic Rate"}, > + {"DMic Rate", "128x", "DMIC"}, > + {"DMic Rate", "64x", "DMIC"}, > + {"DMic Rate", "32x", "DMIC"}, > + {"DMic Rate", "off", "DMIC"}, This isn't really idiomatic and won't be power efficient since we don't automatically manage the power so we'll have the DMIC clock running even when no recording is in progress. What would be better would be to have an enum equivalent of the _AUTODISABLE() controls, providing an enum with the clock rates backed by a field in the driver data and then a DAPM widget which writes the value to the hardware when the widget is enabled and sets it back to off on disable. It'd be fine to open code that in the driver for now rather than actually implementing a generic thing if that's too much hassle. --0/mZOjcrntyubmya Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmIrQbwACgkQJNaLcl1U h9C3mQf+MZ6RAdMcQME2mOpeWnIsDmZZPFSSU8cOluACvtIjnUW7yQzFcud3e5xx 02IFdEI/NLYAVRuU0cYoaNEi3/GZ1GUzsCHl602xePfPEDDbzZL4wqoA2XyjHvUp TA3V8WzYphFsFouUPg+/4Pz6dqTqgQdDqx1OcCicGEKRY7P33LgN0tzghGmcJsvM eB0Mf4ygBDmrVam2o4LSJHeL4l91/iMSjy1IOFdY8cFfzQyDX0892GE6ZZcfKD8l 1OMWsArMhMTzeDQgwDKrEgEgLuE6h7hn5FJRE2LDYYEFaX75m3p4DBkNy+eIywFx aWVMtZIyNATOcOrXWzmfJ/kfDPu2yw== =uBhC -----END PGP SIGNATURE----- --0/mZOjcrntyubmya--