From patchwork Wed Nov 8 21:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 118340 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5860401qgn; Wed, 8 Nov 2017 14:43:47 -0800 (PST) X-Google-Smtp-Source: ABhQp+RCy26qxd4B5WhbHqrbtyRDo9f37qrn2MBrgWBpYdyfD45WWR+uQ5IrP5WtFpJHMUjFZQAp X-Received: by 10.28.71.67 with SMTP id u64mr1476080wma.48.1510181027129; Wed, 08 Nov 2017 14:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510181027; cv=none; d=google.com; s=arc-20160816; b=EMN0IyPgN0lk4lHe/NGmlRbgHNmGByCIN9B1Z52q1EdGxuHvgx4sW9eFVgZY34mZ6h 75m4zj5afcX4xd5rcDUwxPxT+/6TImnwMw0Nm41ybHFkSs+MkmJmC2XSXOkTiT0Uz8UV L+Lyi9gq7ihRjT+9v/gZWDV5+9DK9w/vgZI+cGM7y/irezEWNtjijUfF+u8BuyT59WEo CypOTCxYogsqNjDziUI9CKEDSzXdmJiVmA0H7fNzIUd9TKB1dNsWXAwCOPQrUDpdeKVc dzEE6/tRpO+FB6+R3hl3M0MZWI4ELq9Df9b0ei35KkNZgB5zXaZWp/xGLiGcPPDasYDM BMjw== 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=kJwEKfcKA+2WneQU32cTiDBFZnX23jydkbf6mmA2Kuc=; b=Fstl2bZ7bU8en+Vr4vXAntr31fYsPRaTAe1OXQWT52cIbcDYxzbf+2QWKDe/TFM8g4 jTFdcD7sX/AvIV2KKr6vt6Tp1AV5/h/dIP+voK8IIR2YlnJfEafswaxitKqXszTuHOXL eY8HlHsw4NTVuYabzUUoV2Wq9v12m+m5TyW4JR61dL+Grf2bMNUh4lFuAd29+wfPGcbE 2dT5sVPghgV+TpGGfkYjf7CiXQkjdLTq451+YTp1Pm2kyfmY/3ZNOKRolB2a+CiVrN1t aQn6tp2xXm4Aff/WGm/nr6KjP1VLozxs2Yqi8kmvxv5asyidGTscfuUhIwPL3DuWpsH3 A0nQ== 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=TfA1rk5u; 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 i88si4353140wmh.137.2017.11.08.14.36.19; Wed, 08 Nov 2017 14:43:47 -0800 (PST) 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=TfA1rk5u; 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 D08B5267790; Wed, 8 Nov 2017 23:29:18 +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 A16A6267673; Wed, 8 Nov 2017 22:33:49 +0100 (CET) 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, 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 D46F026767A for ; Wed, 8 Nov 2017 22:30:59 +0100 (CET) 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=rc5EL7pcgGSz/L0DS/ceZqg/2WZLlmDktweLFF67C2w=; b=TfA1rk5uwR4b Zb+3s+a7FSzXmHVjG2ilQ8p8k5kwMotYtbW5wZkJdsUoRO9DQQgRqqY5HF0wi9ZiDbxZGOxv4vCGz 3QFAEwNp1gazs0lNrSWDx1kfTY/jy9Ky9+/z/UKLZMteoMXow2bPAOoHu3PBcee2h0x6jq82eWfN8 lfOIs=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eCXvo-0003ef-VS; Wed, 08 Nov 2017 21:30:45 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eCXvo-0005B1-21; Wed, 08 Nov 2017 21:30:44 +0000 From: Mark Brown To: oder_chiou@realtek.com In-Reply-To: <1510124662-5065-2-git-send-email-oder_chiou@realtek.com> Message-Id: Date: Wed, 08 Nov 2017 21:30:44 +0000 Cc: Oder Chiou , jack.yu@realtek.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, broonie@kernel.org, shumingf@realtek.com, bardliao@realtek.com, flove@realtek.com, cychiang@chromium.org Subject: [alsa-devel] Applied "ASoC: rt5514-spi: check irq status to schedule data copy in resume function" 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: rt5514-spi: check irq status to schedule data copy in resume function has been applied to the asoc tree at https://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 e9c50aa6bd3996924b5fd87ab59289888cd5704a Mon Sep 17 00:00:00 2001 From: "oder_chiou@realtek.com" Date: Wed, 8 Nov 2017 15:04:22 +0800 Subject: [PATCH] ASoC: rt5514-spi: check irq status to schedule data copy in resume function For wake on voice use case, we need to copy data from DSP buffer to PCM stream when system wakes up by voice. However the edge triggered IRQ could be missed when system wakes up, in that case the irq function will not be called. If the substream was constructed beforce suspend, we will schedule data copy in resume function. Signed-off-by: Oder Chiou Signed-off-by: Mark Brown --- sound/soc/codecs/rt5514-spi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index d03756913dd9..36e0a58ffc87 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -473,11 +473,21 @@ static int rt5514_suspend(struct device *dev) static int rt5514_resume(struct device *dev) { + struct snd_soc_platform *platform = snd_soc_lookup_platform(dev); + struct rt5514_dsp *rt5514_dsp = + snd_soc_platform_get_drvdata(platform); int irq = to_spi_device(dev)->irq; + u8 buf[8]; if (device_may_wakeup(dev)) disable_irq_wake(irq); + if (rt5514_dsp->substream) { + rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf)); + if (buf[0] & RT5514_IRQ_STATUS_BIT) + rt5514_schedule_copy(rt5514_dsp); + } + return 0; }