From patchwork Fri May 7 07:39:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 1475377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fc2RM73R7z9sxS; Fri, 7 May 2021 17:40:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lev5p-0006Hl-02; Fri, 07 May 2021 07:40:12 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lev5m-0006Gx-L7 for kernel-team@lists.ubuntu.com; Fri, 07 May 2021 07:40:10 +0000 Received: from [123.112.70.57] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lev5l-0001Nm-Kx for kernel-team@lists.ubuntu.com; Fri, 07 May 2021 07:40:10 +0000 From: Hui Wang To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH 1/1] UBUNTU: SAUCE: ASoC: SOF: Intel: hda: move the probe_bus ahead of creation of mach device Date: Fri, 7 May 2021 15:39:53 +0800 Message-Id: <20210507073953.15588-2-hui.wang@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210507073953.15588-1-hui.wang@canonical.com> References: <20210507073953.15588-1-hui.wang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1927672 We backported many patches to enable the sof audio driver in the focal kernel, the driver worked well on cml and cfl machines if they have both analog codec and HDMI/DP codec. On some machines they only have analog codec, the current sof driver can't work on them, we already backported related patches like "allow operation without i915 gfx" and "drop HDA codec upon probe failure", but we still miss one important patch: commit 285880a23d10 ("ASoC: SOF: Make creation of machine device from SOF core optional") The patch is big, it is prone to introduce regression if applying such a big patch, here I only picked a small part which is helpful to enable sof driver without HDMI/DP codec. After the change, The probe_bus() will probe the codec first and set the codec_mask according to the probing result, then the driver create mach device according to codec_mask. Referred-To: commit 285880a23d10 ("ASoC: SOF: Make creation of machine device from SOF core optional") Signed-off-by: Hui Wang Acked-by: Tim Gardner --- sound/soc/sof/intel/hda.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index d743e27f063f..ef6a1113b178 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -387,6 +387,9 @@ static int hda_init_caps(struct snd_sof_dev *sdev) if (bus->mlcap) snd_hdac_ext_bus_get_ml_capabilities(bus); + /* create codec instances */ + hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi); + /* codec detection */ if (!bus->codec_mask) { dev_info(bus->dev, "no hda codecs found!\n"); @@ -480,9 +483,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev) mach_params->dmic_num = dmic_num; } - /* create codec instances */ - hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi); - if (!HDA_IDISP_CODEC(bus->codec_mask)) hda_codec_i915_put(sdev);