From patchwork Mon Feb 26 12:44:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 775960 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 AADE5C48BF6 for ; Mon, 26 Feb 2024 12:43:56 +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 BF8EBB71; Mon, 26 Feb 2024 13:43:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BF8EBB71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708951434; bh=4VIPX9egWgJRNiiGEM9wm8oDiCKsOQEHw4CxYJ7Q4bE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DiHPfp4LbgeoQV/v/9gz1l+P7FCISYXjh94Gx1mjCRxDEPTpAFnHYqXZNsgjdG0x9 9KPvtVTAEPzjtrCnFaQvXTy/9r3+CDT0GfOeC23etHWJefs05JM33TkLnhJvN3tjcD WaepEUK4KTU6YCF5sYH0HfdL1sasP86hWQvT7D9I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 98AA7F805CA; Mon, 26 Feb 2024 13:43:15 +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 17221F805C9; Mon, 26 Feb 2024 13:43:15 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3F4ABF80254; Mon, 26 Feb 2024 13:43:09 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 F242EF80212 for ; Mon, 26 Feb 2024 13:43:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F242EF80212 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=adWqKymI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708951385; x=1740487385; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4VIPX9egWgJRNiiGEM9wm8oDiCKsOQEHw4CxYJ7Q4bE=; b=adWqKymIIlkqY8DsEy77njd0tPXMB3k8KZOrPoAAWt4fBsQjShUib6ez r4qXjmOCv+o5RcJ8II/djf5jVJUQnARvCimIQbBwAU+WqElxDlpjt+vWe yN4mao618KQaCWcJ42bPwx6Kj4ks2csZnKCr3KD5EscKCfnr8nF+5ISur CUZAXsaVD0qTuMUZA/zK3hjZB/9XBW0JkCzYabSCp4Y/ZWeQ3+/qcFOL+ 6NIWxPiwCMooqc45ylv9Fu5mowhM6S3rUZryQe2ayfL7GCD597QJAJDa8 49pkDo6FOhxG6oAQgeTFDwnsU0RNi+ugcHZBbD3DGyH0YDs64aFzRAVEB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28658230" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28658230" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 04:43:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6688610" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orviesa009.jf.intel.com with ESMTP; 26 Feb 2024 04:42:57 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v3 1/5] ALSA: hda: Skip i915 initialization on CNL/LKF-based platforms Date: Mon, 26 Feb 2024 13:44:28 +0100 Message-Id: <20240226124432.1203798-2-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226124432.1203798-1-cezary.rojewski@intel.com> References: <20240226124432.1203798-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: OAET6L3H5UOCCTNKV5UL6DLZRKYBF7PK X-Message-ID-Hash: OAET6L3H5UOCCTNKV5UL6DLZRKYBF7PK X-MailFrom: cezary.rojewski@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: Commit 78f613ba1efb ("drm/i915: finish removal of CNL") and its friends removed support for i915 for all CNL-based platforms. HDAudio library, however, still treats such platforms as valid candidates for i915 binding. Update query mechanism to reflect changes made in drm tree. At the same time, i915 support for LKF-based platforms has not been provided so remove them from valid binding candidates. Link: https://lore.kernel.org/all/20210728215946.1573015-1-lucas.demarchi@intel.com/ Reviewed-by: Rodrigo Vivi Signed-off-by: Cezary Rojewski --- sound/hda/hdac_i915.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 365c36fdf205..e9425213320e 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -127,15 +127,41 @@ static int i915_component_master_match(struct device *dev, int subcomponent, /* check whether Intel graphics is present and reachable */ static int i915_gfx_present(struct pci_dev *hdac_pci) { + /* List of known platforms with no i915 support. */ + static const struct pci_device_id denylist[] = { + /* CNL */ + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a40), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a41), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a42), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a44), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a49), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a4a), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a4c), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a50), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a51), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a52), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a54), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a59), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a5a), 0x030000, 0xff0000 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a5c), 0x030000, 0xff0000 }, + /* LKF */ + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9840), 0x030000, 0xff0000 }, + {} + }; struct pci_dev *display_dev = NULL; if (!gpu_bind || (gpu_bind < 0 && video_firmware_drivers_only())) return false; for_each_pci_dev(display_dev) { - if (display_dev->vendor == PCI_VENDOR_ID_INTEL && - (display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY && - connectivity_check(display_dev, hdac_pci)) { + if (display_dev->vendor != PCI_VENDOR_ID_INTEL || + (display_dev->class >> 16) != PCI_BASE_CLASS_DISPLAY) + continue; + + if (pci_match_id(denylist, display_dev)) + continue; + + if (connectivity_check(display_dev, hdac_pci)) { pci_dev_put(display_dev); return true; } From patchwork Mon Feb 26 12:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 776541 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 A25CEC54E4A for ; Mon, 26 Feb 2024 12:44:17 +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 88511839; Mon, 26 Feb 2024 13:44:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 88511839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708951455; bh=z8lPSEjbSrtzAuUskaODEdGF5O7WHGh3H8vOdHVof2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VmVsrqHmYJTQmMguVftf8ASrIz3xwLOm6f6VtZSPghT3nNkjIiB1/f4gqDEK48fN2 8xs/SR29Z3m7JlttSNZXZ6Owx9PycCZRFsWxKM75/YLmyIwn5C5kVaA9tC1MwF5PJ0 1T5irFQN0v3Gg08pOgEJYQBUPmt+GzNxOgiAboDQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63871F805E1; Mon, 26 Feb 2024 13:43:18 +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 90EDFF805EA; Mon, 26 Feb 2024 13:43:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 547CDF8059F; Mon, 26 Feb 2024 13:43:10 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 F2147F8012B for ; Mon, 26 Feb 2024 13:43:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F2147F8012B 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=Ghbgd/Lr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708951387; x=1740487387; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z8lPSEjbSrtzAuUskaODEdGF5O7WHGh3H8vOdHVof2M=; b=Ghbgd/LrNBQr3em9JIFFouNL0azwWWvnNrJmgjxadvWsabOviv49RiKl M6+HKqxaAzXt9XTVY/T6XG9u7CtvMQMiUg9C2Q6s0Ru2iTpjycxGMF+Bl 0r1sPjIaHRp6JFtebkakDBdjDu1fjq6ljYZTjtZYv7uiUKd3M+h0q1u/F 7OiS96viBoSCQ/T4Vx0HgiIhFprh0kn7NQ1SXDnZUmI1dmXyWo7pFjZLL n+VvTqycjSQsep4KNH1syA+41FtMdvTd8ewPAKvJVS1GpqjEpcVUOZzSD vJ8pVl0JCtpw7VdjImnr0vcrW2QBqFxHTflY7iU4VpLiU3dcGz/HiqC1M Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28658243" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28658243" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 04:43:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6688613" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orviesa009.jf.intel.com with ESMTP; 26 Feb 2024 04:43:01 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v3 2/5] ASoC: codecs: hda: Skip HDMI/DP registration if i915 is missing Date: Mon, 26 Feb 2024 13:44:29 +0100 Message-Id: <20240226124432.1203798-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226124432.1203798-1-cezary.rojewski@intel.com> References: <20240226124432.1203798-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: K353MPQBAU5T5HEWSCNWT44RBCOSL4LM X-Message-ID-Hash: K353MPQBAU5T5HEWSCNWT44RBCOSL4LM X-MailFrom: cezary.rojewski@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: If i915 does not support given platform but the hardware i.e.: HDAudio codec is still there, the codec-probing procedure will succeed for such device but the follow up initialization will always end up with -ENODEV. While bus could filter out address '2' which Intel's HDMI/DP codecs always enumerate on, more robust approach is to check for i915 presence before registering display codecs. Signed-off-by: Cezary Rojewski --- sound/soc/codecs/hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/codecs/hda.c b/sound/soc/codecs/hda.c index d2117e36ddd1..7c6bedeceaa2 100644 --- a/sound/soc/codecs/hda.c +++ b/sound/soc/codecs/hda.c @@ -350,6 +350,11 @@ static int hda_hdev_attach(struct hdac_device *hdev) struct hda_codec *codec = dev_to_hda_codec(&hdev->dev); struct snd_soc_component_driver *comp_drv; + if (hda_codec_is_display(codec) && !hdev->bus->audio_component) { + dev_dbg(&hdev->dev, "no i915, skip registration for 0x%08x\n", hdev->vendor_id); + return -ENODEV; + } + comp_drv = devm_kzalloc(&hdev->dev, sizeof(*comp_drv), GFP_KERNEL); if (!comp_drv) return -ENOMEM; From patchwork Mon Feb 26 12:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 775959 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 E0A45C48BF6 for ; Mon, 26 Feb 2024 12:44:42 +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 C2B0B1DA; Mon, 26 Feb 2024 13:44:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C2B0B1DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708951475; bh=oTHR95JWcz0ap604v+zFjYvXKhk2SC2e8b03VMGFeXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gixzuCWaICxCnUv379jAXeFvHw7XceVkRJC/VdCUq41B4nnegPvWHR3y+12e/9u5V QXuLQjDRUDaY/+FwJBN6YKrGiqJqOoctiwjcJASp/sFVib/gUQ7jn2k94jEe0UNim/ lZqMiy2WAhY1Gxp2sQbp5PokVen8F9DTdEM65TAE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 46D36F80622; Mon, 26 Feb 2024 13:43:20 +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 62D73F80600; Mon, 26 Feb 2024 13:43:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1CEF6F80587; Mon, 26 Feb 2024 13:43:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 109DEF80246 for ; Mon, 26 Feb 2024 13:43:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 109DEF80246 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=Jt9M5tQq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708951389; x=1740487389; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oTHR95JWcz0ap604v+zFjYvXKhk2SC2e8b03VMGFeXk=; b=Jt9M5tQq6gYCoG4yovCQeBC+YSV9iFNYZz60CezWiLXGFD2goph6AYmx qkOMTavYXpvOpNhzIvnJojPiSYgV8P6IvqLVgvxDQ9VI9Ay4KOIcHZddw J8qeRgsoxkds0HDjPaDce8CuRT/y/bfUibYREKNR7EMbc1AnwUw0/b5Gf IZo8Vv6tmNuNBGhorAnY6MulEhDKJEEtMQonbmX4XRrziR6sOM3p89GON JtTx7zz49m9h5VZm0+6arBSCGojIkZrzMqizUi+QKaqxJlenj3SLLy1Id xZJTlsuJIhRqEf/V3qs7kR0yel1TehDwHvF8h7xILRfsSvhb3uYv5RjzP Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28658253" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28658253" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 04:43:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6688616" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orviesa009.jf.intel.com with ESMTP; 26 Feb 2024 04:43:04 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v3 3/5] ASoC: Intel: avs: Ignore codecs with no suppoting driver Date: Mon, 26 Feb 2024 13:44:30 +0100 Message-Id: <20240226124432.1203798-4-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226124432.1203798-1-cezary.rojewski@intel.com> References: <20240226124432.1203798-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: VUCQK2A3XY5N5CROJ7QAKHFJLOZFFMUE X-Message-ID-Hash: VUCQK2A3XY5N5CROJ7QAKHFJLOZFFMUE X-MailFrom: cezary.rojewski@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: HDMI codecs which are present and functional from audio perspective lack i915 support on drm side what results in -ENODEV during the probing sequence. There is no reason to perform recovery procedure e.g.: reset the HDAudio controller if this is the case. Signed-off-by: Cezary Rojewski Acked-by: Mark Brown --- sound/soc/intel/avs/core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index b3e5a5012167..a61ce42b426c 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -150,7 +150,7 @@ static int probe_codec(struct hdac_bus *bus, int addr) /* configure effectively creates new ASoC component */ ret = snd_hda_codec_configure(codec); if (ret < 0) { - dev_err(bus->dev, "failed to config codec %d\n", ret); + dev_warn(bus->dev, "failed to config codec #%d: %d\n", addr, ret); return ret; } @@ -159,15 +159,16 @@ static int probe_codec(struct hdac_bus *bus, int addr) static void avs_hdac_bus_probe_codecs(struct hdac_bus *bus) { - int c; + int ret, c; /* First try to probe all given codec slots */ for (c = 0; c < HDA_MAX_CODECS; c++) { if (!(bus->codec_mask & BIT(c))) continue; - if (!probe_codec(bus, c)) - /* success, continue probing */ + ret = probe_codec(bus, c); + /* Ignore codecs with no supporting driver. */ + if (!ret || ret == -ENODEV) continue; /* From patchwork Mon Feb 26 12:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 776540 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 5B325C54E49 for ; Mon, 26 Feb 2024 12:44:55 +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 BB4DBDF6; Mon, 26 Feb 2024 13:44:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB4DBDF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708951493; bh=HNPW3gZaSH6fjCMtquzM1dI/vEaBhFuoLxGDia1XD9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=b/V8pnt9tvJSlr+gOIHe6fSAvIA4SjIj94+ubUqHfhZYUfnXpnX364SprSf4KRQ0i qFSJlpxl88itHk2wE7S9fjm/eLsvpXJ0U+XyccCzbAOKG5HfWnKp33GmsMzCEKhwTW mCPCTAb0UbvNkMZaZUbgSVsH6pAU+uw1kH3AH7Ac= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0FFEF8063E; Mon, 26 Feb 2024 13:43:25 +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 BB683F8064F; Mon, 26 Feb 2024 13:43:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B16CFF805EB; Mon, 26 Feb 2024 13:43:18 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 6AEE2F805AE for ; Mon, 26 Feb 2024 13:43:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6AEE2F805AE 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=BArNKX+X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708951394; x=1740487394; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HNPW3gZaSH6fjCMtquzM1dI/vEaBhFuoLxGDia1XD9A=; b=BArNKX+XwSr+cw8yXaLfMDxkoMXUOqgboQcXXf/OYWmK/15aIduA19ZY oP6mw3nx8o58eLSAA7H7CKCpUiVacNMULPYLyndL8Tzy/ROIGo1u3/s5L OydfCrCXFgZiR/2mP+LT4E88B+SHb2eKWr99u7XZtmyv6XryVFBS1KQt9 isxhGgXycSEPzl036Yx2/PMrI7UyyoeQsHpSE0C2mKn4OnG/ZgvHZnrSu MC9dJnarex/6c/fHJEvjAfhrZ3G2Dz1Nc2luWtuJJkbt7QZCNwIeYvh2x kqWbBDln4FLJ1uz7cxx+5Z12c+vNGyvyzPS52D/Vx0z6K84TZqvOHMjEX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28658263" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28658263" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 04:43:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6688619" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orviesa009.jf.intel.com with ESMTP; 26 Feb 2024 04:43:07 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v3 4/5] ASoC: codecs: hda: Cleanup error messages Date: Mon, 26 Feb 2024 13:44:31 +0100 Message-Id: <20240226124432.1203798-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226124432.1203798-1-cezary.rojewski@intel.com> References: <20240226124432.1203798-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: PVM4JPAHOJPQX27SGQFVENY7HJGJ2CNU X-Message-ID-Hash: PVM4JPAHOJPQX27SGQFVENY7HJGJ2CNU X-MailFrom: cezary.rojewski@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: Be cohesive and use same pattern in each error message. Signed-off-by: Cezary Rojewski --- sound/soc/codecs/hda.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/hda.c b/sound/soc/codecs/hda.c index 7c6bedeceaa2..5a58723dc0e9 100644 --- a/sound/soc/codecs/hda.c +++ b/sound/soc/codecs/hda.c @@ -198,19 +198,19 @@ static int hda_codec_probe(struct snd_soc_component *component) ret = snd_hda_codec_device_new(codec->bus, component->card->snd_card, hdev->addr, codec, false); if (ret < 0) { - dev_err(&hdev->dev, "create hda codec failed: %d\n", ret); + dev_err(&hdev->dev, "codec create failed: %d\n", ret); goto device_new_err; } ret = snd_hda_codec_set_name(codec, codec->preset->name); if (ret < 0) { - dev_err(&hdev->dev, "name failed %s\n", codec->preset->name); + dev_err(&hdev->dev, "set name: %s failed: %d\n", codec->preset->name, ret); goto err; } ret = snd_hdac_regmap_init(&codec->core); if (ret < 0) { - dev_err(&hdev->dev, "regmap init failed\n"); + dev_err(&hdev->dev, "regmap init failed: %d\n", ret); goto err; } @@ -223,13 +223,13 @@ static int hda_codec_probe(struct snd_soc_component *component) ret = patch(codec); if (ret < 0) { - dev_err(&hdev->dev, "patch failed %d\n", ret); + dev_err(&hdev->dev, "codec init failed: %d\n", ret); goto err; } ret = snd_hda_codec_parse_pcms(codec); if (ret < 0) { - dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret); + dev_err(&hdev->dev, "unable to map pcms to dai: %d\n", ret); goto parse_pcms_err; } From patchwork Mon Feb 26 12:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 775958 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 CF284C48BF6 for ; Mon, 26 Feb 2024 12:45:10 +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 CA62D850; Mon, 26 Feb 2024 13:44:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CA62D850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708951508; bh=cewHMOUP9XE8f1iBRQp0XY/AtymJk2wyw8t26geqAWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vDEn0vDD92ua4MtOroDIiEZA3MulLYqyLVgbVBF7fzO22y3GQFShGPBPABzYarbH9 qR5zkzWtS1EXFD6rTuDjcWfoCQP0EYdGG98uAeamAV2Xnp97POb1b3s3BVBpmF9ywq 8oETVT9LWQJKLyRQef8yGcsXEPianahu/xRD8w+U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27E00F80685; Mon, 26 Feb 2024 13:43:28 +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 A5FBDF80652; Mon, 26 Feb 2024 13:43:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3C8F1F80600; Mon, 26 Feb 2024 13:43:20 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 57E86F805D8 for ; Mon, 26 Feb 2024 13:43:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57E86F805D8 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=Jg6za7fK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708951396; x=1740487396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cewHMOUP9XE8f1iBRQp0XY/AtymJk2wyw8t26geqAWQ=; b=Jg6za7fK83y8rOScQdzoAYZWhUSipTqO8zcwf3XcXIjEGRnH45UbmVBK FdpKzF/ejfBEjQHkjXjKMc8gbiZ+MPkfcNPEil7nqfu2fnIVmLsvlJut4 1n4bBLNWl9RnFSJ9XavX/pgue8EpIP6HTaFssBtcIPHuKtXK3kBkhtYgZ 9aqw4whgeIpfuyiQmgugrPgAiN3zFFCMghf4JLQIdS8GOHGfLZUOR44Hy mg3DeAdH6xxsrGSsTBOMXWclANsyWfV0YZkn3qGSWvNu2+noij4m3YLsx b+rGv8r4nPRASaBA+7DIbpirDs5w4ab4zi7gNG7A/+hzIT/7gHFW/xvtl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28658271" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28658271" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 04:43:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6688625" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orviesa009.jf.intel.com with ESMTP; 26 Feb 2024 04:43:11 -0800 From: Cezary Rojewski To: broonie@kernel.org Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, tiwai@suse.com, perex@perex.cz, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v3 5/5] ALSA: hda: Reuse for_each_pcm_streams() Date: Mon, 26 Feb 2024 13:44:32 +0100 Message-Id: <20240226124432.1203798-6-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226124432.1203798-1-cezary.rojewski@intel.com> References: <20240226124432.1203798-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: PAE7VDBYFCGS3UU3SJCQ62YTYXOWEANY X-Message-ID-Hash: PAE7VDBYFCGS3UU3SJCQ62YTYXOWEANY X-MailFrom: cezary.rojewski@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: Use the macro to improve readability. Signed-off-by: Cezary Rojewski --- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 12f02cdc9659..2cac337f5263 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -3313,7 +3313,7 @@ int snd_hda_codec_parse_pcms(struct hda_codec *codec) list_for_each_entry(cpcm, &codec->pcm_list_head, list) { int stream; - for (stream = 0; stream < 2; stream++) { + for_each_pcm_streams(stream) { struct hda_pcm_stream *info = &cpcm->stream[stream]; if (!info->substreams)