From patchwork Mon Aug 11 11:15:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 4706601 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 80C749F38D for ; Mon, 11 Aug 2014 11:17:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBDDC2012E for ; Mon, 11 Aug 2014 11:16:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8A3A12011D for ; Mon, 11 Aug 2014 11:16:58 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 96FBA2654AE; Mon, 11 Aug 2014 13:16:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4DF49265196; Mon, 11 Aug 2014 13:15:58 +0200 (CEST) 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 3FA03261AFF; Mon, 11 Aug 2014 13:15:55 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 9BAEE261AFF for ; Mon, 11 Aug 2014 13:15:47 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 11 Aug 2014 04:15:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,840,1400050800"; d="scan'208";a="574927385" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.55]) by fmsmga001.fm.intel.com with ESMTP; 11 Aug 2014 04:15:45 -0700 From: Jarkko Nikula To: alsa-devel@alsa-project.org Date: Mon, 11 Aug 2014 14:15:37 +0300 Message-Id: <1407755738-31693-3-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1407755738-31693-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1407755738-31693-1-git-send-email-jarkko.nikula@linux.intel.com> Cc: Liam Girdwood , Mark Brown , Jarkko Nikula , Liam Girdwood Subject: [alsa-devel] [PATCH 2/3] ASoC: Intel: Wait Baytrail ADSP boot at resume_early stage 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 Remove sst_byt_pcm_dev_resume() and move waiting of firmware boot into sst_byt_pcm_dev_resume_early(). Now suspend_late and resume_early phases are in sync with each other so that we know that ADSP was put into reset and was unpowered after suspend_late and is ready to resume IO after resume_early during resume stage in sst_byt_pcm_trigger(). Signed-off-by: Jarkko Nikula Tested-by: Borun Fu --- sound/soc/intel/sst-baytrail-pcm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/sst-baytrail-pcm.c b/sound/soc/intel/sst-baytrail-pcm.c index ba7ed9720732..eb7b31e13565 100644 --- a/sound/soc/intel/sst-baytrail-pcm.c +++ b/sound/soc/intel/sst-baytrail-pcm.c @@ -423,18 +423,14 @@ static int sst_byt_pcm_dev_suspend_late(struct device *dev) static int sst_byt_pcm_dev_resume_early(struct device *dev) { struct sst_pdata *sst_pdata = dev_get_platdata(dev); + int ret; dev_dbg(dev, "resume early\n"); /* load fw and boot DSP */ - return sst_byt_dsp_boot(dev, sst_pdata); -} - -static int sst_byt_pcm_dev_resume(struct device *dev) -{ - struct sst_pdata *sst_pdata = dev_get_platdata(dev); - - dev_dbg(dev, "resume\n"); + ret = sst_byt_dsp_boot(dev, sst_pdata); + if (ret) + return ret; /* wait for FW to finish booting */ return sst_byt_dsp_wait_for_ready(dev, sst_pdata); @@ -443,7 +439,6 @@ static int sst_byt_pcm_dev_resume(struct device *dev) static const struct dev_pm_ops sst_byt_pm_ops = { .suspend_late = sst_byt_pcm_dev_suspend_late, .resume_early = sst_byt_pcm_dev_resume_early, - .resume = sst_byt_pcm_dev_resume, }; #define SST_BYT_PM_OPS (&sst_byt_pm_ops)