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 A53D9ECAAD8 for ; Wed, 14 Sep 2022 09:08:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D9ECD18AA; Wed, 14 Sep 2022 11:07:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9ECD18AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663146502; bh=tb4tAp7Sj3S0VpVpWdMjr7EE4Pht/XijnA7UEQE7jsk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XUit9ZyvHXb0JsaBe0WI5nzMTKMweUmELHoXQlgDHmpbuYILtu6iiFOzYlHYMmk8O mZUaQwLo+xgLaVZ0eqtlNNLVnKqiqyA0wXLyvg1cFj6NyRdiasD+LPmDQ5uMszgd4D fagtcNdVbpGgA2zrvjmn7nDAV8uB2K+IYtjOkvrA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 61494F80543; Wed, 14 Sep 2022 11:05:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 100BAF8057F; Wed, 14 Sep 2022 11:05:32 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1D91BF8054A for ; Wed, 14 Sep 2022 11:05:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1D91BF8054A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dXmjhzuy" 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 dfw.source.kernel.org (Postfix) with ESMTPS id F1705619EB; Wed, 14 Sep 2022 09:05:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD98DC433B5; Wed, 14 Sep 2022 09:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663146324; bh=tb4tAp7Sj3S0VpVpWdMjr7EE4Pht/XijnA7UEQE7jsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dXmjhzuyOOOk53Sga+O8ISsp/ypxYRTSSC8AyqMNzm1EyoLYqBaQOGC3jR98y4Qa/ ayYD2BdI5qfpD9PMUnI9j+bB3paoGCTD1ZCXPMWm/iMICfp46kOiCJWNNsyiqxyOEU yz325gNq3KGSix+EvQ27ki0LWs1E7nJnPiU9/ctpwRT7CEivg3RbitiiOESQSCOqUg cYjwIc6HP/jnHhwizy8H7CkACc+sEmrj7U4E6ZWCdL/eOGo3qCvv0z7Iteaki0/0jV s8+dg/pFgROyAsfZCHDV/PgVBTxtFJDYgLOJdKYOqbrVbHf15tQYhDlzJEtpDnE0pE 9V8l95X053Edg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 3/8] ALSA: hda/sigmatel: Keep power up while beep is enabled Date: Wed, 14 Sep 2022 05:05:07 -0400 Message-Id: <20220914090514.471614-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220914090514.471614-1-sashal@kernel.org> References: <20220914090514.471614-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Takashi Iwai [ Upstream commit 414d38ba871092aeac4ed097ac4ced89486646f7 ] It seems that the beep playback doesn't work well on IDT codec devices when the codec auto-pm is enabled. Keep the power on while the beep switch is enabled. Link: https://bugzilla.suse.com/show_bug.cgi?id=1200544 Link: https://lore.kernel.org/r/20220904072750.26164-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_sigmatel.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index f7896a9ae3d65..73ce5c83e7e38 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -222,6 +222,7 @@ struct sigmatel_spec { /* beep widgets */ hda_nid_t anabeep_nid; + bool beep_power_on; /* SPDIF-out mux */ const char * const *spdif_labels; @@ -4481,6 +4482,26 @@ static int stac_suspend(struct hda_codec *codec) stac_shutup(codec); return 0; } + +static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid) +{ + struct sigmatel_spec *spec = codec->spec; + int ret = snd_hda_gen_check_power_status(codec, nid); + +#ifdef CONFIG_SND_HDA_INPUT_BEEP + if (nid == spec->gen.beep_nid && codec->beep) { + if (codec->beep->enabled != spec->beep_power_on) { + spec->beep_power_on = codec->beep->enabled; + if (spec->beep_power_on) + snd_hda_power_up_pm(codec); + else + snd_hda_power_down_pm(codec); + } + ret |= spec->beep_power_on; + } +#endif + return ret; +} #else #define stac_suspend NULL #endif /* CONFIG_PM */ @@ -4493,6 +4514,7 @@ static const struct hda_codec_ops stac_patch_ops = { .unsol_event = snd_hda_jack_unsol_event, #ifdef CONFIG_PM .suspend = stac_suspend, + .check_power_status = stac_check_power_status, #endif .reboot_notify = stac_shutup, }; -- 2.35.1