From nobody Fri Dec 19 07:18:03 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6023EC07E9D for ; Mon, 26 Sep 2022 10:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235160AbiIZKUF (ORCPT ); Mon, 26 Sep 2022 06:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234855AbiIZKSL (ORCPT ); Mon, 26 Sep 2022 06:18:11 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82CDA48C94; Mon, 26 Sep 2022 03:15:22 -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 sin.source.kernel.org (Postfix) with ESMTPS id 8DFB2CE10E3; Mon, 26 Sep 2022 10:15:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 878BAC433D7; Mon, 26 Sep 2022 10:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187318; bh=xokKu9snRjxxFHJhz8hYHhAd2PJFlqHZWJWOI+98vzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtPlI7zF+YPIR9/j0ofOJ22QcNQ4fPiRJLrP9TnLWAQ+KXdyPlI2PzopaIa2R0WFk dJzNTjU2rNvsxkiE7C519GPT/ioWWFOFueKJ2APdh6EvStJteTFSfxsiAxL7kemVjm v9sM0B2fcOLULnf4WZMyJOfUfsgswd/4lwmLmq+M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 4.14 10/40] ALSA: hda/sigmatel: Keep power up while beep is enabled Date: Mon, 26 Sep 2022 12:11:38 +0200 Message-Id: <20220926100738.605261859@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100738.148626940@linuxfoundation.org> References: <20220926100738.148626940@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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=3D1200544 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 f7896a9ae3d6..73ce5c83e7e3 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -222,6 +222,7 @@ struct sigmatel_spec { =20 /* beep widgets */ hda_nid_t anabeep_nid; + bool beep_power_on; =20 /* 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 =3D codec->spec; + int ret =3D snd_hda_gen_check_power_status(codec, nid); + +#ifdef CONFIG_SND_HDA_INPUT_BEEP + if (nid =3D=3D spec->gen.beep_nid && codec->beep) { + if (codec->beep->enabled !=3D spec->beep_power_on) { + spec->beep_power_on =3D codec->beep->enabled; + if (spec->beep_power_on) + snd_hda_power_up_pm(codec); + else + snd_hda_power_down_pm(codec); + } + ret |=3D 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 =3D { .unsol_event =3D snd_hda_jack_unsol_event, #ifdef CONFIG_PM .suspend =3D stac_suspend, + .check_power_status =3D stac_check_power_status, #endif .reboot_notify =3D stac_shutup, }; --=20 2.35.1