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=unavailable 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 B36F1CA9EC9 for ; Mon, 4 Nov 2019 22:21:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71C7E204EC for ; Mon, 4 Nov 2019 22:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572906062; bh=AKGm0nPhIlqGk5+Y7MJ/YsmIrdeaeAkVQKPf85OVNhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Lf7CGC9PpFc5zjVEVzx6j27IQFVuzGOMmVN5h6OZ6pmPXpXQ6r7Ef0yBGB6r7xU13 dHbjsofnLVbO1XZTX0v2YkSHi1CVApGWHBX9nD8iKJKdjPQltFmveanrPKmQGDuNsm KuiCmKptUPF3pNG3Lk16WqPO9Z5HEvYasVRq5Z0I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730803AbfKDV6v (ORCPT ); Mon, 4 Nov 2019 16:58:51 -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: 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 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