From patchwork Fri Apr 19 01:53:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 10908603 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 5F87C922 for ; Fri, 19 Apr 2019 02:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C71628710 for ; Fri, 19 Apr 2019 02:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 303EC28A3E; Fri, 19 Apr 2019 02:10:09 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C88B228710 for ; Fri, 19 Apr 2019 02:10:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C401082E; Fri, 19 Apr 2019 04:09:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C401082E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1555639804; bh=YIEIzIofPfgMz6fsMNAWU3Oie/Gvp9UBGSsypTGKBdQ=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=DE3kUiTTg4qtSsHtldCSTNmpADHdts8CLgG45CJsLMttqiP3sr+sNyXxivjDb9Qmn noZznsKvSnflKYZnJlE1cHBKt9Y4w1Qgv5qPYEKZGAhVoOCsdsEe1nn98NP2OWkCdp EJufXK+2fiJIoq61ZafTghoVBxxvZnIBD4tIPFxI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3219CF896EA; Fri, 19 Apr 2019 04:09:14 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F1992F896EC; Fri, 19 Apr 2019 04:09:12 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A6EE8F807B6 for ; Fri, 19 Apr 2019 04:09:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6EE8F807B6 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 19:09:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,368,1549958400"; d="scan'208";a="338837675" Received: from younglee-svr.sh.intel.com ([10.239.159.31]) by fmsmga006.fm.intel.com with ESMTP; 18 Apr 2019 19:09:03 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.de Date: Fri, 19 Apr 2019 09:53:12 +0800 Message-Id: <1555638792-20848-1-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 2.7.4 Cc: libin.yang@intel.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH] ASoC: pcm: save fixed-up hw_params of BE X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang Some drivers mandate setting up hw params after resuming from system sleep. Since, the hw_params ioctl is not invoked upon resuming, the fixed-up BE dai hw params should be saved so the driver can use it in its resume sequence. Signed-off-by: Libin Yang --- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index d212475..7469535 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2164,6 +2164,10 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) } } + /* copy the fixed-up hw params for BE dai */ + memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, + sizeof(struct snd_pcm_hw_params)); + /* only allow hw_params() if no connected FEs are running */ if (!snd_soc_dpcm_can_be_params(fe, be, stream)) continue;