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 E52B9C433FE for ; Tue, 15 Mar 2022 09:52:44 +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 D594017A7; Tue, 15 Mar 2022 10:51:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D594017A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1647337962; bh=LQMKDYoUGarbHyxNQgvd7Ia8sbO9uKypMiZE8FxYnC4=; h=From:To:Subject:In-Reply-To:References:Date:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tOh3A+k4EjSCtrMc9wI0mrsoHfJKtNjdRBqPPcPPs2d1rGPyVEujJKUc53g6h+yjj qrhPw0E2DCf8Tas6dCM2dF5ioW/HEI4u47Ck+lFJUho8/VDlTZol/T2k5E8BKfC1Iv E8HMP8xJiupJzV40Ewjn6YebBLyJiCLK2U+HFDd0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6A62CF8012C; Tue, 15 Mar 2022 10:51:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A3923F80162; Tue, 15 Mar 2022 10:51:50 +0100 (CET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 90538F80128 for ; Tue, 15 Mar 2022 10:51:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 90538F80128 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PrFeJbRd" Received: (Authenticated sender: gregory.clement@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6430BE0004; Tue, 15 Mar 2022 09:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1647337901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=28XMruDxI5xAXqFcoprJ5/JI/xvSWIcx4Mr3f3QhgHc=; b=PrFeJbRdbeCRnDiITSoOpE4e6OAsnYgEZzmDgu9XfXEDp9wwr/Q/waNkohjRvnX8kAmzW4 DZXAzQq3tpO91Y4cBcnBgH2YzRzBE7YC4llFA4BIEF1Sa6Bb6oruSQ8/grcFprGNqePba7 WIl44YdasFxbPLBvqfQFcyrjtV81PFEZ8I7wWz7cOI/dJY1LGw9YqAuQad13FCOtPgvHkZ 08BwxNA+VCkwBeL1Mnb1kYD7J/f137P99ZlQlOz+WkVUrTeSMi4p9cU/DER0SwtlVXG83v Hhm+ThL5CJM+6o4vOYTKDCV7UUhiX5ld0gXpNRjQ7rNc+K2kSuPSwynLlpfl5Q== From: Gregory CLEMENT To: Mark Brown Subject: Re: [PATCH] ASoC: tlv320aic3x: add dmic widget support In-Reply-To: References: <20220311100627.2181756-1-gregory.clement@bootlin.com> Date: Tue, 15 Mar 2022 10:51:35 +0100 Message-ID: <87tubzh7bs.fsf@BL-laptop> MIME-Version: 1.0 Content-Type: text/plain 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" Hello Mark, > 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. Thanks for tour feedback, I will work on a second version based on this. Gregory -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com