Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3031873rwb; Mon, 15 Aug 2022 16:31:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR6x+WYFDgxI8+7qaegZG+TWj4/u3XKROqrESxOLlXBjVqoEG+8hj3+WnRYVTk9V6Wnk9y5W X-Received: by 2002:a05:6402:424e:b0:43d:9d9f:38f9 with SMTP id g14-20020a056402424e00b0043d9d9f38f9mr16264831edb.411.1660605840981; Mon, 15 Aug 2022 16:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605840; cv=none; d=google.com; s=arc-20160816; b=xw0REpm5GJu2GEpE+jAx8A0GJoZEROseZmVExpUq+7EcmvZHs1UKd6I+D+AVi+YfGB tGqLOtnrNBIBQi5JoiPIvcqmg3tF/swAOWaFxy4qH89cJOHnqx5U4srwc0l0mFV8X/Uw DLVtENwUIG3A1qGd2hJ2ic7LHQtAYW6r7JnqRWjQVPI0yYg5j8QY3vYyZkH9kFe/YxbU 3mkcoGxjuFn58gdbKv5TFRwYWq3tSoMSAli+2nwKr7oO3qQnFnOyp0GhNwloKejk+iq1 9DE+29dq8NtP8UUL08VuqpE903S7PLLyGXNqk7PAgiUSmB4Sg9sA6978BF7wE4LXTEpP ZX8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=njH6nBjF26df8WcMXkIHdmHFxM6XLoNyDhQq8IFgudE=; b=OmYXwNCZPpZXnLLxWJIOEGYCCnzjDK7b4iigDQM4uxlghtiSmMMvEg6H+VGGTCIeWw PdVgtYwhZ6CnXRFCKwgHfKtuWhcb3/ybmkZZiFxTp/Hc4wMl2HoQp029hYgGf6BvOhnE x9cvuB8dbcL3n9wEIB71SsylBo2W5hlCK5YFuRbcpq8og4llNjUGdbXSgcgH8GCU0tiR 47/g4gLBsHq6lkfOH/e28EnTh6UWG+SQil12hS2RYbAdzCGLIAfvgt+zOdqRToakR0Y+ xRbarH5l0Wo7Vd+d/GgSlX9GFnidwue7BvMV0z8ku235jOP4VeDhGkLbN9pVDS1noIj8 A0uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LQiGIVoO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ej17-20020a056402369100b004439b1a0921si4089883edb.630.2022.08.15.16.23.35; Mon, 15 Aug 2022 16:24:00 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LQiGIVoO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351952AbiHOWuI (ORCPT + 99 others); Mon, 15 Aug 2022 18:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352127AbiHOWry (ORCPT ); Mon, 15 Aug 2022 18:47:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25269135AEB; Mon, 15 Aug 2022 12:53:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2DB83B81142; Mon, 15 Aug 2022 19:53:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 732B8C433D7; Mon, 15 Aug 2022 19:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593205; bh=T42vtNvZmfSxu+bANyz8LMcHBQaRj4p58WGreN/apcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LQiGIVoODbvERF3HwuD1il+ULip4uAdR6ihoWydV6veR+i4WUI1d4KZIgkpU4XY0l yknOlajUhtY4A5TiyKYvxkUt9KplWN6akYkvry+k93L+zUQyPKsEfRoOCI8A9oie3F 5KDvRstWONLuWDJrfrYiJlhSssYPvalpbIeeTVl8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ranjani Sridharan , Yong Zhi , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.18 0911/1095] ASoC: Intel: sof_rt5682: Perform quirk check first in card late probe Date: Mon, 15 Aug 2022 20:05:10 +0200 Message-Id: <20220815180506.966324573@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Yong Zhi [ Upstream commit 371a3f01fc1862c23fae35cb2c98ffb2eec143f1 ] The check of sof_rt5682_quirk should not be skipped unless the HDMI handling code exits with error, fix by moving the quirk check to the front. Fixes: 94d2d0897474 ("ASoC: Intel: Boards: tgl_max98373: add dai_trigger function") Reviewed-by: Ranjani Sridharan Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220725194909.145418-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/sof_rt5682.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 7126fcb63d90..d9f83b04be87 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -435,6 +435,15 @@ static int sof_card_late_probe(struct snd_soc_card *card) int err; int i = 0; + if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) { + /* Disable Left and Right Spk pin after boot */ + snd_soc_dapm_disable_pin(dapm, "Left Spk"); + snd_soc_dapm_disable_pin(dapm, "Right Spk"); + err = snd_soc_dapm_sync(dapm); + if (err < 0) + return err; + } + /* HDMI is not supported by SOF on Baytrail/CherryTrail */ if (is_legacy_cpu || !ctx->idisp_codec) return 0; @@ -468,15 +477,6 @@ static int sof_card_late_probe(struct snd_soc_card *card) i++; } - if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) { - /* Disable Left and Right Spk pin after boot */ - snd_soc_dapm_disable_pin(dapm, "Left Spk"); - snd_soc_dapm_disable_pin(dapm, "Right Spk"); - err = snd_soc_dapm_sync(dapm); - if (err < 0) - return err; - } - return hdac_hdmi_jack_port_init(component, &card->dapm); } -- 2.35.1