Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4466512ybx; Mon, 4 Nov 2019 13:54:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxdx6ul1kN9VrR5BxVaBi5rdrKrZ8fkb6zgOjta0NYM+0JCPOspX79wk7/hX5WoTK9sRRUG X-Received: by 2002:a17:906:2654:: with SMTP id i20mr19616729ejc.163.1572904486000; Mon, 04 Nov 2019 13:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572904485; cv=none; d=google.com; s=arc-20160816; b=xLrff2nzM248g3jBIuLpdxKaA9SVboARscXam98yGeROko4qWLZ+DgaxP+2I8CTEY5 IuHf9kTGS6343lF3JsA1KCcWkJlq7liuSkQSjKyJ/N068krrRcSCrhUhpkigMTwuwHTE ew4IC4gI0mJLBsisXed7XGdvwBDD+N/O7j5OZKD/M+ynRJgoWnidJkRHZeh5G9iCtK0e UfHk52E9yyF8em9tx3FHOV2T30RrJVhgIvCuFcrPyW8ehAogfy/RLLEaeI9LvwE1w+jT kWzxNYAISlNrfX8CYkPO3ElaMFjTitPD4Kap++yPgx65jJ33VXSYWqvlnmrbprXd2TE7 jd/w== 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=nrCkwxYBKbS1OU9ptbaTAAaYdBxkiqIBGgCS4L9F47U=; b=Sxg5HMObwx99K1J8sDQkD7foMAuW3/CN2ukLJ5paBbtiVYaituM+WsVDugsAOyvBBV iAs8VjnuSO7bb/CAWkFicL2nft6uRAW5fyiY2OHA2CppwjQMhsU3QGN0J+jLIRo37gFf 3tcpoB6ZV0AX83yLvZd6R27EWMWfFuftMzrxni2949wo4iLtzd35eRJ2qPhnoLCZdek9 1gpkzKuUoLAmI33aE85y3+pf3M+u3ItfsW0CcTUUqsAt/ztu7oYffThF1RqWHwy5af3l wICGCIwsKtR+AU9WpCG357G1o6j0MTKzrmMAz7BXXJxDcMzBdK3i/Nki2rxS3t2+lMiO 7pfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0VVrwPP1; 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 g40si8268112edb.369.2019.11.04.13.54.22; Mon, 04 Nov 2019 13:54:45 -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=0VVrwPP1; 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 S1730792AbfKDVwh (ORCPT + 99 others); Mon, 4 Nov 2019 16:52:37 -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: 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 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