From mboxrd@z Thu Jan 1 00:00:00 1970 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 7D5AEC4167B for ; Tue, 28 Nov 2023 12:17:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F3375847; Tue, 28 Nov 2023 13:16:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F3375847 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1701173818; bh=7wlfTkVA9T4sl4yTRAFwFkuqKuwz/x+zFV6VkHQubcM=; h=Date:Subject:From:To:Cc:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Psq2WBlywoLCCb1ZKTwFG2WbvON5UM8ST7AeYPWbXVn6iGhG/GpGf6ZAWstZTXGk6 STHu3apXKVxcWICBrNtrdNRcKIpDUkpWaQAcRmsuyk0J3xDMbK03fhMyImKQIQGXrU KSw2da/Xk8uDUa+TmK4Dhq1HaTgnBqUZqyOQn1VU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 88565F80579; Tue, 28 Nov 2023 13:16:26 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2ECE5F80588; Tue, 28 Nov 2023 13:16:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75870F8016E; Tue, 28 Nov 2023 13:16:22 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 820D7F80104 for ; Tue, 28 Nov 2023 13:16:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 820D7F80104 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A3bq3rTR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701173779; x=1732709779; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=7wlfTkVA9T4sl4yTRAFwFkuqKuwz/x+zFV6VkHQubcM=; b=A3bq3rTRuTeZFM8PQ9qv+NvKnSu1rtezmSwBNWfDI/6j2OrtzB0xCj0Q 90rMQSdHMglR7EQfDub6eMB2IpNVdqY01DgIUe11JQbpRxBJ0zuXWntFp RYhSrPlcWEDCnUqPAuIrx5QWPwzmsep0O/ODSGZpWulfS1sOrMTLAFekh zVEJJOnrE/1w2sbco11/9JEKUcTUGiHLDmw+7Zf5PeTesS+Q/w68EsQI6 o4LzjS1x/Abd3t63xvI5e66X28MJ1X1xjqR7mIQFNbHSdR6PJHNyCLDYB F9R3oGVrO3RlMBIgfWTbaxb/E+p5bPE5AeANjWAkFmN9r8sjS71ytA0nj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="390065363" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="390065363" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 04:15:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="941901099" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="941901099" Received: from anikafix-mobl.ger.corp.intel.com (HELO [10.251.221.103]) ([10.251.221.103]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 04:15:54 -0800 Message-ID: <30f05de0-f431-4972-9315-6b377cf43cf4@linux.intel.com> Date: Tue, 28 Nov 2023 14:16:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] ALSA: hda/hdmi: Add helper function to check if a device is HDMI codec Content-Language: en-US From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= To: Takashi Iwai Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, kai.vehmanen@linux.intel.com, ranjani.sridharan@linux.intel.com References: <20231127130245.24295-1-peter.ujfalusi@linux.intel.com> <20231127130245.24295-2-peter.ujfalusi@linux.intel.com> <87jzq3pc6r.wl-tiwai@suse.de> <87cyvvp8t6.wl-tiwai@suse.de> <8ede931b-8c9c-4b95-83e5-5f0db9819e8e@linux.intel.com> <878r6jp6jd.wl-tiwai@suse.de> <875y1np5g2.wl-tiwai@suse.de> <87y1eimd23.wl-tiwai@suse.de> <87ttp6mc04.wl-tiwai@suse.de> <96d334c1-9c6b-415b-bfb8-1fab29b1d223@linux.intel.com> <87plzum9w4.wl-tiwai@suse.de> <6710fd66-2a70-4948-aafb-2fcf3d6d2b25@linux.intel.com> In-Reply-To: <6710fd66-2a70-4948-aafb-2fcf3d6d2b25@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: CHRBJZDP52MI55FIH4ICMMPZSMEXYBLC X-Message-ID-Hash: CHRBJZDP52MI55FIH4ICMMPZSMEXYBLC X-MailFrom: peter.ujfalusi@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 28/11/2023 13:58, Péter Ujfalusi wrote: > > > On 28/11/2023 12:48, Takashi Iwai wrote: >>> Well, it is a bit more 'interesting' from that angle. >>> for patch two we needed: >>> https://lore.kernel.org/linux-sound/20231124124015.15878-1-peter.ujfalusi@linux.intel.com/ >> >> Ouch, this kind of information has to be mentioned in the patch >> description. Otherwise one would take only this series and face a >> problem easily. I can imagine such a problem on the stable tree. > > OK, I will update the commit message > >>> I would rather not risk to move the hdac_hda as Intel only using address >>> 2 as HDMI indication - which I'm still not sure if it is Intel only or >>> generic HDA convention. >> >> Sure, it doesn't sound right, either. >> >> Can we then add DAPM widgets and routes later conditionally instead of >> having it in component driver definition? > > The issue is with the DAIs. If I remove the dai registering from > hdac_hda_dev_probe() to be done in hdac_hda_codec_probe() then the probe > will not happen since we do not have the needed components/DAIs to probe > the card. > > If we don't have HDMI then the machine driver will substitute it with > dummy-dai, but if we have HDMI then we are not going to probe at all. > > It is a sort of chicken and egg situation, right? I think I have found a workaround without the need to export a function, it is going to be a single patch and should be OK for non Intel platforms in the future. struct hdac_hda_priv *hda_pvt = dev_get_drvdata(&hdev->dev); .. if (hda_pvt->need_display_power) /* HDMI/DP */ else /* Non HDMI */ -- Péter