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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 496F7CA9EA0 for ; Fri, 18 Oct 2019 22:08:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08706222D1 for ; Fri, 18 Oct 2019 22:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571436513; bh=XmiV9shyhIDIa3OFpD1U1MBqHaPljeOFs1xJ8axEo0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Fp3E/om8bGEYQaK8MjMDQPOltZoryaJE498Rfy0zcasd5HF49C8xV0L4PwQdqf/lI 6+QmlCYnyDeXoiHIJlburAToR8q3jIQMsZD0CWjzaZBO782/QL9NljAHBMSZcOxpG+ nTrmvdmFoq9xvn++64QkfG3RAzS1AOTYbg7JHgFU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387846AbfJRWIc (ORCPT ); Fri, 18 Oct 2019 18:08:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:40764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387691AbfJRWIV (ORCPT ); Fri, 18 Oct 2019 18:08:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAE02222C2; Fri, 18 Oct 2019 22:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571436501; bh=XmiV9shyhIDIa3OFpD1U1MBqHaPljeOFs1xJ8axEo0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cG6WNgc4YoaXQ8iIKDOgwMGbEBQc97xzbU/SppNqEs1l+/6TUIsPIrEQ0S1RlYxEB oPzTG7tx1Pu9AdyzNylgah6hpI1vJ5rvkc0o8fLErb5CoPXm9ZmZC9E3oxyBaX6IVm tM2bA+X7giJhYQiyOwgkbr2OQd4a10cj5YXv//tc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.14 14/56] ALSA: hda/realtek - Apply ALC294 hp init also for S4 resume Date: Fri, 18 Oct 2019 18:07:11 -0400 Message-Id: <20191018220753.10002-14-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191018220753.10002-1-sashal@kernel.org> References: <20191018220753.10002-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 ab7bc7ebb7215..fc935794d432d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3245,7 +3245,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