Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3303ECA9EC9 for ; Mon, 4 Nov 2019 21:52:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00FA421929 for ; Mon, 4 Nov 2019 21:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904358; bh=jBRD/+1zElxgqwOGIvSiuWSvuOrjlam6KwlDf5mfZdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ny6abPQTnu3KWYi7xWfDYlDs4crkAiq9sFnT6aj6qeGToBSeEZEclYcraetj6w9le LsMMxE8BDhOayL4FztBr6sGMPSAyNhsJz2tAXZtVdA+QTpATkvWzl7BxlURKWxrKAe kfMKZscOXr7UwO+bHzWJaKPDE4yfbcVVU71Z6gVc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730771AbfKDVwg (ORCPT ); Mon, 4 Nov 2019 16:52:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:46152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729730AbfKDVwg (ORCPT ); Mon, 4 Nov 2019 16:52:36 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FFB121929; Mon, 4 Nov 2019 21:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904355; bh=jBRD/+1zElxgqwOGIvSiuWSvuOrjlam6KwlDf5mfZdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0VVrwPP1Dq4ptGGCP8MuiF4fQ7f8ZEeV0AA6N3NW8og+YSixMjQuwZUJn1ENEzTjp GbTjW3g3Lb+l04fpwCyxBj6aJ1pqx/ovURjEynnoD/c5sf8QXQOIOOQ9PAbnqU4hyS fI2moy56qNiWeim/ug5IH/mIkyVNT+vpnDLPRdHY= 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 19/95] ALSA: hda/realtek - Apply ALC294 hp init also for S4 resume Date: Mon, 4 Nov 2019 22:44:17 +0100 Message-Id: <20191104212047.985825786@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212038.056365853@linuxfoundation.org> References: <20191104212038.056365853@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Takashi Iwai [ Upstream commit f6ef4e0e284251ff795c541db1129c84515ed044 ] The init sequence for ALC294 headphone stuff is needed not only for the boot up time but also for the resume from hibernation, where the device is switched from the boot kernel without sound driver to the suspended image. Since we record the PM event in the device power_state field, we can now recognize the call pattern and apply the sequence conditionally. Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_realtek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5412952557f7a..8d6c5be387362 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3246,7 +3246,9 @@ static void alc294_init(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; - if (!spec->done_hp_init) { + /* required only at boot or S4 resume time */ + if (!spec->done_hp_init || + codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { alc294_hp_init(codec); spec->done_hp_init = true; } -- 2.20.1