From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="1rudhrvN"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="VVYXnKC7" Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A73E1BD8 for ; Tue, 28 Nov 2023 05:02:18 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C50FD1F74B; Tue, 28 Nov 2023 13:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701176536; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j+aOH1vjhftccOjryN6nHJxLvAMbv1vOstfbooADBQA=; b=1rudhrvNMqM0dM0pEoSvU7/x8Aepf94cDnjI/5sEZU3IFXpRNQSpswrTQbQQwU3M7de/k1 2tDUHsmz1pFspSnEoLXs4bNY/K9BVuW0XxKHQaAPPdjf8kEuEo8qo+r7Nvzjulwmg0T5tO w50ngI6i+gV5uW7oWhcG+23dB/GWCro= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701176536; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j+aOH1vjhftccOjryN6nHJxLvAMbv1vOstfbooADBQA=; b=VVYXnKC7Y3j5mMaTQ/lxA8WYf1/Q7648aRAhSZNoQ8WqHX0c83/JxpD/q/5+A+uSUcgK34 c5HMJkbf4+r3UlCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 75ECC13763; Tue, 28 Nov 2023 13:02:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 1FRJG9jkZWXuIQAAD6G6ig (envelope-from ); Tue, 28 Nov 2023 13:02:16 +0000 Date: Tue, 28 Nov 2023 14:02:16 +0100 Message-ID: <87il5mm3on.wl-tiwai@suse.de> From: Takashi Iwai To: =?ISO-8859-1?Q?P=E9ter?= Ujfalusi 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 Subject: Re: [PATCH 1/2] ALSA: hda/hdmi: Add helper function to check if a device is HDMI codec In-Reply-To: <30f05de0-f431-4972-9315-6b377cf43cf4@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> <30f05de0-f431-4972-9315-6b377cf43cf4@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spamd-Result: default: False [-1.74 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; REPLY(-4.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_SEVEN(0.00)[10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[34.65%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(2.36)[0.787]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[gmail.com,kernel.org,perex.cz,suse.com,alsa-project.org,vger.kernel.org,linux.intel.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -1.74 On Tue, 28 Nov 2023 13:16:29 +0100, Péter Ujfalusi wrote: > > > > 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 */ Looks like a saner approach, yeah. thanks, Takashi