From patchwork Tue Jan 29 21:25:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 10787253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50887922 for ; Tue, 29 Jan 2019 21:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3453F2D402 for ; Tue, 29 Jan 2019 21:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2853F2D422; Tue, 29 Jan 2019 21:25:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BB8B2D402 for ; Tue, 29 Jan 2019 21:25:19 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7D0BA2674EF; Tue, 29 Jan 2019 22:25:17 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 155F9267595; Tue, 29 Jan 2019 22:25:15 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id C8F5F2674B9 for ; Tue, 29 Jan 2019 22:25:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 13:25:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,538,1539673200"; d="scan'208";a="113705126" Received: from rdvivi-losangeles.jf.intel.com ([10.7.196.65]) by orsmga008.jf.intel.com with ESMTP; 29 Jan 2019 13:25:09 -0800 From: Rodrigo Vivi To: alsa-devel@alsa-project.org Date: Tue, 29 Jan 2019 13:25:10 -0800 Message-Id: <20190129212510.31897-1-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Takashi Iwai , Rodrigo Vivi Subject: [alsa-devel] [PATCH] ALSA: hda - Fix suspend/resume calls X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Besides the compilation issue the resume function was calling the force_suspend. Fixes: d81f8c6b6ced ("ALSA: hda - Record the current power state before suspend/resume calls") Cc: Takashi Iwai Cc: Jaroslav Kysela Signed-off-by: Rodrigo Vivi --- sound/pci/hda/hda_codec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 43bcc6f1ea8c..0b86aa2b649c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2894,6 +2894,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec) */ static void hda_call_codec_resume(struct hda_codec *codec) { + struct device *dev = hda_codec_dev(codec); + snd_hdac_enter_pm(&codec->core); if (codec->core.regmap) regcache_mark_dirty(codec->core.regmap); @@ -2955,10 +2957,16 @@ static int hda_codec_pm_suspend(struct device *dev) return pm_runtime_force_suspend(dev); } +static int hda_codec_pm_freeze(struct device *dev) +{ + dev->power.power_state = PMSG_FREEZE; + return pm_runtime_force_suspend(dev); +} + static int hda_codec_pm_resume(struct device *dev) { dev->power.power_state = PMSG_RESUME; - return pm_runtime_force_suspend(dev); + return pm_runtime_force_resume(dev); } static int hda_codec_pm_thaw(struct device *dev)