Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4474831ybx; Mon, 4 Nov 2019 14:03:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxevm2Ob1HDpIBST4bFTUElnpWIm08tRLK6h0uusdUQLm0/L8qw3kdp3DbP6rSNG/t7kkec X-Received: by 2002:aa7:c842:: with SMTP id g2mr470842edt.132.1572904986180; Mon, 04 Nov 2019 14:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572904986; cv=none; d=google.com; s=arc-20160816; b=szR2VWxFmmug04K7jGw4jZVLzU8ZeYclWRj4qRA3av9/Dx8Y7OWFDxMek4BkRBon1L hbKPimxnR4fB+3CBSPIaCB7vwgkXKV9D30C1GGGUulhDKYlVwDzNAWKMzJ1ivZ+uFA0D zt5CY1VFnblc1L4AeC/Kvykk5x3Dy8oCr5XQsPPmGYPiLfVMnz9SYj4bna/W9LhdVtht T+D8Owmxvygavlrhl/pVOYpGQtbbF1DbjP2YzFwIuTIUmi5AnyWDWiVL/Vnj22nWHDn0 pHVBJ7zsEFAflbF6PGrLKFYfSmfsaXVLIE0g7b82Sn1s7SgKDgZlE72DTQ99FAEfai6C 3uuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rghvFRtZL+ujZSkuAuOwMKn+638lLvDOHGdAqDeqsmc=; b=xMi64Ju+gJeo/QDJ5Li1LGCNM1MWC+hVUmy7IE6MxXoUS+qahG0sZuxOy6Fr2aq0dc PiCiYodVebOYXvoowll/B1SBWVSZ/faPhIsFnpma11B50UwOjqoyImNXZveVeNPWvBvX MU+r3Kdgi+k11Vb3KNBHHNXCb0/mhKPdr7OEULr2DWPGn6Y09jXgKCN/uzXxqwHTtZ9Q mVJyQe5fsdtq1nDlwwV4/bDBKs6bR0TrsUEe/xK+tfIUez6mpGj4BGwswYvJeyDwyAHC A+QGEQPpbw5w9HYsyLokSnYy7f3e76HFfYIkCfJvrn2m+DqIBgzl8wQyPAVJXt26YTCh MGUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="C6th9/jI"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si10494017ejz.252.2019.11.04.14.02.42; Mon, 04 Nov 2019 14:03:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="C6th9/jI"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730895AbfKDV7A (ORCPT + 99 others); Mon, 4 Nov 2019 16:59:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:55900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730782AbfKDV6u (ORCPT ); Mon, 4 Nov 2019 16:58:50 -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 63ABD217F4; Mon, 4 Nov 2019 21:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904730; bh=AKGm0nPhIlqGk5+Y7MJ/YsmIrdeaeAkVQKPf85OVNhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6th9/jIubeij5c5QxaJOWeyeCcO0fwqcONj+n2aP7NZ4HKTmj9MRilUvU1cXoIwm hBPNDEMyCmLjD6bgGAb4u7twWKZYXYD3apbY54AdT7lf5yE4Vn8k6iC5RlDrLBS1Xn oBhV0KlmdxKCjVog4kvybkJfk09OX0Ru01ymJcS8= 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 050/149] ALSA: hda/realtek - Apply ALC294 hp init also for S4 resume Date: Mon, 4 Nov 2019 22:44:03 +0100 Message-Id: <20191104212139.627500139@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212126.090054740@linuxfoundation.org> References: <20191104212126.090054740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 dd46354270d0d..7480218f32ba7 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3458,7 +3458,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