From mboxrd@z Thu Jan 1 00:00:00 1970 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,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 CF4ECCA9EC9 for ; Mon, 4 Nov 2019 21:59:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 992BE20659 for ; Mon, 4 Nov 2019 21:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904742; bh=AKGm0nPhIlqGk5+Y7MJ/YsmIrdeaeAkVQKPf85OVNhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UrlLmiRMtseIsqlIVa4/CkG0250lju64EZmPaOIBmK3rjPWqO5Dv+P9Olj3gsspHO IJJObbOCppcL+9ANY4MS0a54Ij+MzVym4PntC6HcGOA6NHz4oyoPNKmgLmQJgtyXfK PpvVlfGJK+YMo0OResqkxDdHc6/zxsAS6zUD9yE4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730908AbfKDV7B (ORCPT ); Mon, 4 Nov 2019 16:59:01 -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