Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1125365imw; Tue, 5 Jul 2022 04:19:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s65t6mpi0bwkyr1/PF/ec6Iym6er70UMVvhn1ctdHAnH1MtNcjitBvWFQFBIwLuGqSgc4I X-Received: by 2002:a05:6a00:2995:b0:525:398b:8585 with SMTP id cj21-20020a056a00299500b00525398b8585mr42193565pfb.7.1657019952618; Tue, 05 Jul 2022 04:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657019952; cv=none; d=google.com; s=arc-20160816; b=yh6mHGZhXdKSylyjbWX61Vg/mN2lAZNprGJgFmmD/UMV/pxOOXgsjUp8q+YzEi0pTX OsD7K5C4vYPASGlL9qZtzDqZXDK6F7I1PKwKz5l6rSnMZeSun3+sTCwJQShzxub4LdmJ 8LpLe8ioGk9dtaTtcswP/c4/3k/ZNlkvTNe6qXddyetXW7IPy9sn5s3wzNlplLCfTXOF AIiMdrw+5iVh6pajhUd8JRiZ11GFJ3rVJrYO475iKm3p6AIuaywqbpwVc9kLVLwmZcqn QIDj5VvQmmioppnHI89ri+AiCdf42aJReo4oSpcJQg7ni2gic8JBvrlGgkcJqvv7bJM5 ltGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=22rAUjYLlZq1GJrsuLb06JEYIlxE6bU1AMXL94g91Uw=; b=I5dTGyQwYyD/1Zf672h0JbsKo50WAtoJCEeSTyivUh4qCRg1xP0+E15H6sQtxFQ6Gf 6ZM4ns3qq1wL/sR+7ri/vBKSvbNXEv5k3uHLi31z6RD1gJ6QV6g1C3fNLASTEiyorWWe g8gXa74T/QLevrJb78yfcL9iV6BuMvKusd1QwL5tf1v6aYPp4Dtix7OG5SR+cblpOf4w 1+uqKDbk6bJpjmPddOAx/mdCH9Qbvs2UHAUnZb+HpBIQLzmfYArltXQtx/ua4xVXVsLq vKeihaRvByFC15fzXNfpyzywIsmAE/qr9ONxLv1OhRcyvvF3V+8qgsAha618SXhBp6Pu D7LA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q132-20020a632a8a000000b0040d1569b651si16274335pgq.870.2022.07.05.04.18.59; Tue, 05 Jul 2022 04:19:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbiGEKUu (ORCPT + 99 others); Tue, 5 Jul 2022 06:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiGEKUs (ORCPT ); Tue, 5 Jul 2022 06:20:48 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6572140A4 for ; Tue, 5 Jul 2022 03:20:46 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by albert.telenet-ops.be with bizsmtp id rNLf270094C55Sk06NLfeX; Tue, 05 Jul 2022 12:20:44 +0200 Received: from geert (helo=localhost) by ramsan.of.borg with local-esmtp (Exim 4.93) (envelope-from ) id 1o8ffa-0029jA-Kj; Tue, 05 Jul 2022 12:20:38 +0200 Date: Tue, 5 Jul 2022 12:20:38 +0200 (CEST) From: Geert Uytterhoeven X-X-Sender: geert@ramsan.of.borg To: Cezary Rojewski cc: alsa-devel@alsa-project.org, broonie@kernel.org, upstream@semihalf.com, kai.vehmanen@linux.intel.com, harshapriya.n@intel.com, rad@semihalf.com, pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com, cujomalainey@chromium.org, lma@semihalf.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/14] ASoC: codecs: Add HD-Audio codec driver In-Reply-To: <20220511162403.3987658-3-cezary.rojewski@intel.com> Message-ID: References: <20220511162403.3987658-1-cezary.rojewski@intel.com> <20220511162403.3987658-3-cezary.rojewski@intel.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Cezary, On Wed, 11 May 2022, Cezary Rojewski wrote: > Add generic ASoC equivalent of ALSA HD-Audio codec. This codec is > designed to follow HDA_DEV_LEGACY convention. Driver wrapps existing > hda_codec.c handlers to prevent code duplication within the newly added > code. Number of DAIs created is dependent on capabilities exposed by the > codec itself. Because of this, single solution can be applied to support > every single HD-Audio codec type. > > At the same time, through the ASoC topology, platform drivers may limit > the number of endpoints available to the userspace as codec driver > exposes BE DAIs only. > > Both hda_codec_probe() and hda_codec_remove() declare their expectations > on device's usage_count and suspended-status. This is to catch any > unexpected behavior as PM-related code for HD-Audio has been changing > quite a bit throughout the years. > > In order for codec DAI list to reflect its actual PCM capabilities, PCMs > need to be built and that can only happen once codec device is > constructed. To do that, a valid component->card->snd_card pointer is > needed. Said pointer will be provided by the framework once all card > components are accounted for and their probing can begin. Usage of > "binder" BE DAI solves the problem - codec can be listed as one of > HD-Audio card components without declaring any actual BE DAIs > statically. > > Relation with hdac_hda: > > Addition of parallel solution is motivated by behavioral differences > between hdac_hda.c and its legacy equivalent found in sound/pci/hda > e.g.: lack of dynamic, based on codec capabilities, resource allocation > and high cost of removing such differences on actively used targets. > Major goal of codec driver presented here is to follow HD-Audio legacy > behavior in 1:1 fashion by becoming a wrapper. Doing so increases code > coverage of the legacy code and reduces the maintenance cost for both > solutions. > > Signed-off-by: Cezary Rojewski Thanks for your patch, which is now commit b5df2a7dca1cc6c6 ("ASoC: codecs: Add HD-Audio codec driver") in sound-asoc/for-next. > --- a/sound/soc/codecs/Kconfig > +++ b/sound/soc/codecs/Kconfig > @@ -937,6 +937,16 @@ config SND_SOC_HDAC_HDA > tristate > select SND_HDA > > +config SND_SOC_HDA > + tristate "HD-Audio codec driver" > + select SND_HDA_EXT_CORE > + select SND_HDA I am wondering if this needs a platform dependency? Or perhaps this symbol should be made invisible, as it is selected by SND_SOC_INTEL_AVS_MACH_HDAUDIO? Are there any other users? Thanks! > + help > + This enables HD-Audio codec support in ASoC subsystem. Compared > + to SND_SOC_HDAC_HDA, driver's behavior is identical to HD-Audio > + legacy solution - including the dynamic resource allocation > + based on actual codec capabilities. > + > config SND_SOC_ICS43432 > tristate "ICS43423 and compatible i2s microphones" > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds