From patchwork Mon Oct 23 09:43:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 116658 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp2658203edm; Mon, 23 Oct 2017 02:43:49 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sby6aJJTsvsIFFmB2OOK+Ka0HqU4tGTR7StTZ/oXceb+MX3e4n0kQ5ZNv8uTCjgRgLqCET X-Received: by 10.223.156.203 with SMTP id h11mr10829344wre.188.1508751829792; Mon, 23 Oct 2017 02:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508751829; cv=none; d=google.com; s=arc-20160816; b=et2sYHRDNo74++fDacBweOznnEEfZrZO2zGEGC/7TpKCGuHk7ISyz0VaKN6DZgWemT Q+bT5cwhbkaUuoB0xSsM/tflgXrUi0AGo4+Xtxl/CNYh85xD99YhneoZfDTdnJm05/hY wS/1QuHOlPtShglo5BboUfUwHtDso/49z1pOVseluaZ7NMr7QJV3xN7YUX43CvnHr/Aa TOJqA37Hk08YgniCm7D5YEqvTJOUp7uDMGm2mQky5anBDAGmV8p02wG8CaDEw9TW25yV pmi5vLMKCfqI8GlLlWcFthNftBUEvbY+aJVyUPRZYq85Y+gTFTeAjjJRsI8GBnzhlJtX uTww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=G3N7baKTY0Z2rchIe0EgfagGgKPY+xUN5+sEqndXgBw=; b=IvRBbyEOUsCpaNEIrrHSpMrXILCpWFKvHG7XRv8eKLoZdbj1/1iWp+IkeAw4D0B9dk I50xw+NKYLsJUHfUa7EV+QyotCGg301JnFgWg+yGTMN7l9/c6k0faAJxs/t1gUnhKxz0 6posgrHAvQoHtgIjr2PLSjDJakRX01pM2KRk+CEWRrkK7CnQiVBvL6RIF3bn9ea6oWCo wIYKVEroGqkM924aN0OrrSvM5Oa9V8GCHhJq9s5XFWG+LUFNxnOq6QO1drdaJNIFza5T 87Zdmp/VMxzZqvrfxAlypJV7SZESl2lugCb28bHNJSGCeMWD7GZIfthsMl3ejas+5cDs 51Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=pumV253r; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 188si3192351wmh.124.2017.10.23.02.43.49; Mon, 23 Oct 2017 02:43:49 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=pumV253r; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D61DE267070; Mon, 23 Oct 2017 11:43:21 +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 0A87126701D; Mon, 23 Oct 2017 11:43:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 84F65266FFE for ; Mon, 23 Oct 2017 11:43:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=6Ar0/qka0rFpKCsxP2tCcSd3hxqdCOA0oS+A+B+QOSA=; b=pumV253rCJqL YwdyTwrzBtiJtzUIKnkeRHoTdEaLPMbQQfmzIjnyrWcmVDV3M7GXBuOElES48CtPUHVEkG47LQDba RCRF+NCZN4GdlV6oemg9ro/Qx3IkRi3b1WznLkkjluIA3rwzX01/0v4N6wT91m+t0VcObB3LFqVL5 jeocE=; Received: from [62.168.35.105] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1e6ZGP-00067B-DJ; Mon, 23 Oct 2017 09:43:17 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 35C6C440058; Mon, 23 Oct 2017 10:43:17 +0100 (BST) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87r2vrm1ka.wl%kuninori.morimoto.gx@renesas.com> Message-Id: <20171023094317.35C6C440058@finisterre.ee.mobilebroadband> Date: Mon, 23 Oct 2017 10:43:17 +0100 (BST) Cc: alsa-devel@alsa-project.org, Mark Brown , Lars-Peter Subject: [alsa-devel] Applied "ASoC: snd_soc_component_driver has pmdown_time" to the asoc tree 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 The patch ASoC: snd_soc_component_driver has pmdown_time has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From fbb16563c6c2b7fc4944adc49f93c1dc6fe25770 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 11 Oct 2017 01:38:08 +0000 Subject: [PATCH] ASoC: snd_soc_component_driver has pmdown_time Current snd_soc_runtime_ignore_pmdown_time() tallys all Codec and CPU's "ignore_pmdown_time". Now, CPU (= via compoent) ignore_pmdown_time is fixed as "true". Codec's one is copied from Codec driver. This means Codec side default is "false". Current all Codec driver will be replaced into Component, thus, we can use for_each_rtdcom() for this totalization. This patch adds new "pmdown_time" on Component driver. Its inverted value will be used for this "ignore" totalizaton. Of course all existing Component driver doesn't have its settings now, thus, all existing "pmdown_time" is "false". This means all Components will ignore pmdown time. This is current CPU behavior. To keep compatibility, snd_soc_runtime_ignore_pmdown_time() totalize Component's inverted "pmdown_time" (= total will be true) and Codec's "ignore_pmdown_time" (= depends on Codec driver settings). Because It is using AND operation, its result is based on Codec driver settings only. This means this operation can keep compatibility and doesn't have nonconformity. When we replace Codec to Component, the driver which has ".ignore_pmdown_time = true" will be just removed, and the driver which doesn't have it will have new ".pmdown_time = true". Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/soc.h b/include/sound/soc.h index ae0a27fdc016..44fab951b686 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -836,6 +836,7 @@ struct snd_soc_component_driver { /* bits */ unsigned int idle_bias_on:1; unsigned int suspend_bias_off:1; + unsigned int pmdown_time:1; /* care pmdown_time at stop */ }; struct snd_soc_component { diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index daaa670ee9b7..8075856668c2 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -133,16 +133,25 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream) */ bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) { + struct snd_soc_rtdcom_list *rtdcom; + struct snd_soc_component *component; int i; bool ignore = true; if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) return true; + for_each_rtdcom(rtd, rtdcom) { + component = rtdcom->component; + + ignore &= !component->driver->pmdown_time; + } + + /* this will be removed */ for (i = 0; i < rtd->num_codecs; i++) ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time; - return rtd->cpu_dai->component->ignore_pmdown_time && ignore; + return ignore; } /**