Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp806606rwb; Mon, 26 Sep 2022 06:11:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zDLMbEkxSo1hdT3lfK0NTWqEs7yHwnnVKKdhD/hUhN6ycExS/aLdK7F5K3VP/9Gbk7ntU X-Received: by 2002:a17:90b:1918:b0:200:ab1a:f47 with SMTP id mp24-20020a17090b191800b00200ab1a0f47mr24450469pjb.33.1664197869308; Mon, 26 Sep 2022 06:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197869; cv=none; d=google.com; s=arc-20160816; b=bBwp1zzQaJurCuwu06em8/oZnHHrqGC6TvD74gi1DMJfvTT/c4EWeL4os1wp3x+Tkh 3Ab8nf26wVYSq9QzNpR3ng9RjzeeC525B92ZBWRcwikwtaJAtqvwUwWOSbG/Yn+QdbJB XGZTiL4Z3zrgHwCbFI0oIxlCrNTyv6oDwGiHdSAWGU1sy92Wljup2Pbg08jF2hrIm0D7 ebKSSZdifOA3A5aCbFMo7q0PaxvyFv5uODrzthtnb5GSTymAE9oXHapbkA97Uk0CTD9c w3m2U2y4/VhdQtIU8uYHue+Weo1C97xrjcBmxvl69Q0JnmpJ/t/gCMK8jMeJFXGTwDDI YLQg== 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=ZETA6hkh4wxCVTf3lsGLBOOdCdXwr+xU65J4LHlPNks=; b=ooAb9ZEMwKoLylO/hzcCN6KaAsdLZMHA04jN5T4SVVWsmTIMyyIIKO7K5gXiIC2mUv PeiI3ckVUD395HB7P5lHs6TR1el9Kx5OWoxQiJEeQsm1CC38E3CHrs9qNJ40ZFnLhybd tfymg/cebfDF4OoAhOf4D6/1mrxYDVIbfV2m/pNw6DDfx5snXV/ouWJCXnXZEn4mDDm1 I6MmjAVYThfR01DTLy10QdwVn2RM1vTlWTcmoUZFUetfWIrgLDFliBkGt2OjG7KA/xOi YzhzOch2kYR7P7YNx/g4O56dlhEhtjsHM+PuhZH2SpoYBZDQcHl93FDUwChjIW1HhePe zOOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yeNjtZn+; 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 h71-20020a63834a000000b0043c87ece306si1361493pge.534.2022.09.26.06.10.57; Mon, 26 Sep 2022 06:11:09 -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=yeNjtZn+; 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 S235468AbiIZK1J (ORCPT + 99 others); Mon, 26 Sep 2022 06:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235598AbiIZKYW (ORCPT ); Mon, 26 Sep 2022 06:24:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 785854D4F2; Mon, 26 Sep 2022 03:17:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 182EA60B7E; Mon, 26 Sep 2022 10:17:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CB43C433D6; Mon, 26 Sep 2022 10:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187454; bh=6AUgvhBWZ4qO//g19Nt+ah5iKNNnDXtGxjr6VosGyaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yeNjtZn+0G48XGu/nvVto/1IQZFU8fGZSZduf9SxKw+qDdgSvgSaZj3UVC7kEJn14 3Gkhnm7wAuZMFjpqFLVHHG34diD5zgmVzMS0ZmyFYDXIsQRaS9gMYHE09z82/X6GFr XTCr5/bpboHZmFXG0dd1rfdDCJaTHDLFcn07msD0= 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.19 13/58] ALSA: hda/sigmatel: Keep power up while beep is enabled Date: Mon, 26 Sep 2022 12:11:32 +0200 Message-Id: <20220926100741.895021418@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100741.430882406@linuxfoundation.org> References: <20220926100741.430882406@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.2 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 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: 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 85c33f528d7b..2f6e4e3afd8f 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; @@ -4463,6 +4464,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 */ @@ -4475,6 +4496,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