Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2680583rwi; Fri, 28 Oct 2022 09:53:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ot1rwkWwbz5wPE4+1bWeii3TJeVa4gYPou2jS366CGuxwkJnOV7/u73T5IdTmWPLfP1jT X-Received: by 2002:a05:6a00:1a47:b0:52e:6a8c:5430 with SMTP id h7-20020a056a001a4700b0052e6a8c5430mr30597pfv.48.1666975984062; Fri, 28 Oct 2022 09:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666975984; cv=none; d=google.com; s=arc-20160816; b=wohH5A50qMZj9SHtCRnxZaW5m5l3yoFa3pozrBQHgUFYJtDjGUkwy+IooPZjY/E9d0 tm/julek+PfPEJK08nIec04E7f4VIYB6czxYuqZLLxYkO6ijYTkgAjEvrX6GPif8qRsi wgbudwxntGXNihtE1Zy40yQ+W4uwSKg1uV3MYhtWQ4iRVzU4IZauG09FKL+gOR4bruTg Sd2J+EvkQgrEyUBv2qDYgEZgRnkAPTtRe5Wnkbq0KIKc4JBoQW1n69+rI0zvC7xXCtmt qD2KgahQJD0pDQWmmHjugnPoVGl84yclSVvzpvm1GjEIx+skjyvvPshDLF9lbp8sMTwM sGnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gNo/5JQlPioPgVM6bGGKsUAm2aRckgEWHiEMjJKzbGg=; b=KLZWanokPd7oPC3dOI26SFjZBSt/DivrEJQmFvrpYDoSkdAlF00uYIrDSd00oQBbv8 msH1jxaGJUj656E8D5dDv20SzR943BC/uD+WQljyw7nRqqR7XbDEUOJT5ovaccBouz9L jFUUi+ZFJDEIt2jFi/QLGf7ufGhnjOkF1jiPFdft+G/KpAxBVI7HIlK3ud5BS5GURcSo EsEMaoR5evhYUksfmXKs5W/3DF659ka16ugrneJp8pcEif9Hp8/1lKFDBwpwgNwWLNW+ WjUwUJHbmA5elkgK5Y5VVcDujiqRF5RD2AuN/PLjYHxBtVNws8vuAVmRVi5wl31JK1L8 MTMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4jN1aqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm4-20020a17090b3ec400b0020319d3bb7bsi7105313pjb.18.2022.10.28.09.52.52; Fri, 28 Oct 2022 09:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4jN1aqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230318AbiJ1QSw (ORCPT + 99 others); Fri, 28 Oct 2022 12:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiJ1QSg (ORCPT ); Fri, 28 Oct 2022 12:18:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 115EC17E03; Fri, 28 Oct 2022 09:17:50 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id BA636B82B07; Fri, 28 Oct 2022 16:17:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E5BBC433C1; Fri, 28 Oct 2022 16:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666973867; bh=MPN/lPTpCXpy+0PRxdY8GXPpytF3KfULUfkRjnBwUpE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U4jN1aqrPtVpL4VSh4NG5IKIR0V5D/7XGlmxImplMYfIF2nvv4TCI3FNBmihmGZEx V9fP0Zer515uPmI0ZDdCMLln/GOWnTRqQLKZua/VEzttslPumufiygnfvpQkIRwWcN TFV8I7d6Xb1VlRUUJUGFLovN1ITdLhP++IPi3/9/Kzb4u/eEdSZhq4pEuihKYZtYWY oSwO3C8T7BU3xoCKInl61SsWHX7yvHNbaSMiProzM44CvwTnhalM6/ts6sIf7QvvPU nFmLKoj7eJeHyGNZJqrQcw5BQOiUVpp/hiTtP1rzYhOLWD7zppUH9YgIc8Xpo08WMx HBiUwucVzAr2A== Date: Fri, 28 Oct 2022 17:17:40 +0100 From: Mark Brown To: Ajye Huang Cc: linux-kernel@vger.kernel.org, Liam Girdwood , Krzysztof Kozlowski , Rob Herring , linux-mediatek@lists.infradead.org, "chunxu . li" , Takashi Iwai , Jaroslav Kysela , Jiaxin Yu , Matthias Brugger , AngeloGioacchino Del Regno , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH v1 2/2] ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case Message-ID: References: <20221028160733.1390230-1-ajye_huang@compal.corp-partner.google.com> <20221028160733.1390230-3-ajye_huang@compal.corp-partner.google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Cw3lWstGeVw1b8Ns" Content-Disposition: inline In-Reply-To: <20221028160733.1390230-3-ajye_huang@compal.corp-partner.google.com> X-Cookie: Life -- Love It or Leave It. X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Cw3lWstGeVw1b8Ns Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 29, 2022 at 12:07:33AM +0800, Ajye Huang wrote: > +static const char * const dmic_mux_text[] = { > + "FrontMic", > + "RearMic", > +}; > + ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, > + ARRAY_SIZE(dmic_widgets)); > + if (ret) { > + dev_err(card->dev, "DMic widget addition failed: %d\n", ret); > + /* Don't need to add routes if widget addition failed */ > + return ret; > + } > + if (of_property_read_bool(pdev->dev.of_node, "dmic-gpios")) { > + mach_priv->dmic_sel = devm_gpiod_get_optional(&pdev->dev, > + "dmic", GPIOD_OUT_LOW); My prior comments about it being nicer to make the addition of the control depend on the property being there and the description of the options configurable do stand (I appreciate that the other driver might not have done this which was probably an oversight). Also do we really need the of_property_read_bool() there? I'd have expected that devm_gpiod_get_optional() would be handling that for us. --Cw3lWstGeVw1b8Ns Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmNcAKQACgkQJNaLcl1U h9Dszgf/VXVqdAt6y4Tux5PXD9zW+9i23ZFaCs1y/E0zse4AyVDDvo+BtL+IrkcL z9i6r9EqrQuX6SBUCup87nUu3s4aIwtlCvH3Li2znhZWKfY1PEN7xWA7IB6eZDrp nWBO4wPITY3ftUoLGTEpv2ZgQ3QIFm4B/rQpNEkfxbwF91kv/JPK2VzAL2Q0zbck ahvvraHhPGI+2MkDjcufrlzqUke/MteuKH+zKgZjDLYDicXFaj0gHhS/0n7s46Nw Uq2pcLsOFtU8yBm9LVBeC2CDk134qJH4h81Pen/yF/v2+7Pyz5uJD1X2PqXqVRDF Et13wKZD5oDLUdFdlZhs82B5gcdQ4g== =Qv/e -----END PGP SIGNATURE----- --Cw3lWstGeVw1b8Ns--