Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp812611rwb; Mon, 26 Sep 2022 06:14:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yfXeMjknZ512Vs3s8+UTP+X06vPq/B5GU5mlG0+qaaXj3n77LwxGZqsaueh/jjvqrQOJr X-Received: by 2002:a17:90b:4b90:b0:202:65da:d658 with SMTP id lr16-20020a17090b4b9000b0020265dad658mr24810453pjb.130.1664198092060; Mon, 26 Sep 2022 06:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198092; cv=none; d=google.com; s=arc-20160816; b=eP3gSWzyOacbEVztkeJFUAx4PQjlFt6HqShpgtrHUWz44uZ7kCrQkcPq8QXghAsZ76 YQZt2dbXO4AG3rLoUtB313kROM6r2PHiMrL9lhhys2Vy/10B0Tk1beOBzE22tdPYjkfC GEuFKYcF6ConKUXa0A9HerNuDT9Pjpj41mUV8WsYmjrVerqHleCsH+ParJj6OgoktfoG QhYrHrhBWwRWUL2OUmzSJfQOtzazzhqXadlm3ISJWXQCtaRBQX1lv3Tza+UMzmpG3Vsh ogQ1DgLsL5cQNktcn38AOFJob3jGmXWNoKwysb+L+7oU9N6uJB4aN38bT4ue2JbmtKFI 5bgg== 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=iVNWpmchNjhr7ebpAnrigy3eygoRQEohSHk4EMdS5aY=; b=gbADVzxJLjrBIUZ7XPtQTA1bimSIFJ/SIHV5CmzFQW83vFT/SKopH7ddZwbiBYEHuW N8K/39+kNBFoLtnbqSOxOBUzEgUrzBxCoM/TvM0jUPE6LUUfjkhIqENSJ0RsIu3bMJkx mON1aFasMYvSGH+6u025Lf2K/G0rXxt+nIIg9TXa7ra0SRNBCM4AGPzCNItx9X+nVpEj L1rJYRgoIwaZLaUIJOdDWiz8beNIPfuFpzsTYLR4TC+v2LJ4ddoms7lK0UrMMN7b3RC8 QSNRkvHH8fmQL1gXSVFUTsC2gcKlxioJGQf+SqibQk4ZsSA9urMt628LadB4CX9qZSMm OhpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SZVcrOFO; 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 ga22-20020a17090b039600b001f561cba131si11145153pjb.179.2022.09.26.06.14.39; Mon, 26 Sep 2022 06:14:52 -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=SZVcrOFO; 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 S235926AbiIZKgj (ORCPT + 99 others); Mon, 26 Sep 2022 06:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236105AbiIZKeI (ORCPT ); Mon, 26 Sep 2022 06:34:08 -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 BB5B05071F; Mon, 26 Sep 2022 03:21:06 -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 68E6360B60; Mon, 26 Sep 2022 10:21:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7629FC433D6; Mon, 26 Sep 2022 10:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187664; bh=vc2SaGyRnaZR4m3lZSMRuuhRvo3SBJwINntZoyb+sSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZVcrOFO9I2tWZ1e6OsplpDTeqi+FyMEDcy92cTc09VjeGtN8z5FRkNqayZABr/+N 4ZcbXMRiTnhMcrmw2cyWKe7bymn3fzOH40QpTqOPevbkZfY9R1W1Yftm84qTJp5a7g UIVpVwQYGwucsLb7FMQ9ih40AP7ny7SwSlqh/hVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 5.4 020/120] ALSA: hda/sigmatel: Keep power up while beep is enabled Date: Mon, 26 Sep 2022 12:10:53 +0200 Message-Id: <20220926100751.347617758@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@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 bfd3fe5eff31..7a8ecc21b347 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; @@ -4441,6 +4442,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 */ @@ -4453,6 +4474,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