From patchwork Mon Dec 21 17:09:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 7896971 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 946539F1AF for ; Mon, 21 Dec 2015 17:10:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1BFB205DC for ; Mon, 21 Dec 2015 17:10:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A2192205D3 for ; Mon, 21 Dec 2015 17:10:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0BB922654B5; Mon, 21 Dec 2015 18:10:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8248E265185; Mon, 21 Dec 2015 18:10: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 93070265054; Mon, 21 Dec 2015 18:10:13 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id E02CB265071 for ; Mon, 21 Dec 2015 18:10:05 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 21 Dec 2015 09:10:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,460,1444719600"; d="scan'208";a="876098629" Received: from black.fi.intel.com ([10.237.72.93]) by orsmga002.jf.intel.com with ESMTP; 21 Dec 2015 09:09:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 428AEFD; Mon, 21 Dec 2015 19:09:57 +0200 (EET) From: Andy Shevchenko To: alsa-devel@alsa-project.org, Takashi Iwai Date: Mon, 21 Dec 2015 19:09:54 +0200 Message-Id: <1450717796-66115-3-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450717796-66115-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1450717796-66115-1-git-send-email-andriy.shevchenko@linux.intel.com> Cc: Andy Shevchenko Subject: [alsa-devel] [PATCH v1 3/5] ALSA: fm801: no need to suspend absent codec 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In case of tuner only card there is no need to take care of the codec which is anyway absent. Signed-off-by: Andy Shevchenko --- sound/pci/fm801.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 2761880..c7ba4f1 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -1393,12 +1393,17 @@ static int snd_fm801_suspend(struct device *dev) int i; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); - snd_pcm_suspend_all(chip->pcm); - snd_ac97_suspend(chip->ac97); - snd_ac97_suspend(chip->ac97_sec); + + if (chip->tea575x_tuner & TUNER_ONLY) { + /* FIXME: tea575x suspend */ + } else { + snd_pcm_suspend_all(chip->pcm); + snd_ac97_suspend(chip->ac97); + snd_ac97_suspend(chip->ac97_sec); + } + for (i = 0; i < ARRAY_SIZE(saved_regs); i++) chip->saved_regs[i] = fm801_ioread16(chip, saved_regs[i]); - /* FIXME: tea575x suspend */ return 0; } @@ -1414,9 +1419,10 @@ static int snd_fm801_resume(struct device *dev) reset_codec(chip); snd_fm801_chip_multichannel_init(chip); snd_fm801_chip_init(chip); + snd_ac97_resume(chip->ac97); + snd_ac97_resume(chip->ac97_sec); } - snd_ac97_resume(chip->ac97); - snd_ac97_resume(chip->ac97_sec); + for (i = 0; i < ARRAY_SIZE(saved_regs); i++) fm801_iowrite16(chip, saved_regs[i], chip->saved_regs[i]);