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 22E99ECAAD3 for ; Wed, 14 Sep 2022 09:05:25 +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 5FAE5185B; Wed, 14 Sep 2022 11:04:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5FAE5185B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663146323; bh=RmkqBW00/cYLa9v7I1fXss+ve2+A/t7XWxHr3HzL58w=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cMgISrXXOIAmGk6iKuGCO0AEnnyvYnDgq4eZPb5hjIz9inLJg0s9lnTkF7FzEv+S7 O2Q0SYLPWznL8o3RFwG3uehnB91s7SyFb4P+9Iq9AEI5FmPmVkm0T/BRpFdpF+gEo3 yfiOoRwQrMzBlrWuer8OlJd0Zhn42omidYXJ+m3M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2EC19F80538; Wed, 14 Sep 2022 11:03:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 295EDF800C0; Wed, 14 Sep 2022 11:03:51 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 26F75F800FE for ; Wed, 14 Sep 2022 11:03:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26F75F800FE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u114B3PO" 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 D67106190D; Wed, 14 Sep 2022 09:03:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41EF5C433D7; Wed, 14 Sep 2022 09:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663146219; bh=RmkqBW00/cYLa9v7I1fXss+ve2+A/t7XWxHr3HzL58w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u114B3PONQfawD/2inktx1gi1je9FR0CI6DvApZJVSWU6J6E1JRrl/q4RhMTiC1hE W4TQBgEr3KJfGEUb21UzIUt8M4u9gqiFQUBGH4k1YaU6Xl7Xy4YZ2ERWymeJl9ocXM gjjnE7jS/XUJuCal62cICkl6mETQ0rG+VtMBT4HV+cXakB0NGiJQyQ+vtCgQWlc3gN HZTxlxyQcJNZc5+li4xyB8FfCcZpatSPj6dDsOA9KqjI8vmm5hCNw9EaYyziWFgwS7 fytSSA0vyl+AqyXQ4fuWOT2lc4RrtCPTwtmvz1BPxwpLDGbNs6j3RnflC2fuWo5/lq D2P9a9000OZGw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 06/13] ALSA: hda/sigmatel: Keep power up while beep is enabled Date: Wed, 14 Sep 2022 05:03:08 -0400 Message-Id: <20220914090317.471116-6-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220914090317.471116-1-sashal@kernel.org> References: <20220914090317.471116-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 c662431bf13a5..e9d0b0a30b99d 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -209,6 +209,7 @@ struct sigmatel_spec { /* beep widgets */ hda_nid_t anabeep_nid; + bool beep_power_on; /* SPDIF-out mux */ const char * const *spdif_labels; @@ -4447,6 +4448,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 */ @@ -4459,6 +4480,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