From patchwork Thu May 21 03:49:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6452051 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92F68C0432 for ; Thu, 21 May 2015 03:50:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADC25203B7 for ; Thu, 21 May 2015 03:50:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B27AC203EC for ; Thu, 21 May 2015 03:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbbEUDuA (ORCPT ); Wed, 20 May 2015 23:50:00 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:12018 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753152AbbEUDt7 (ORCPT ); Wed, 20 May 2015 23:49:59 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 21 May 2015 12:49:58 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 2BA984AB6A; Thu, 21 May 2015 12:49:58 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 10A118002E; Thu, 21 May 2015 12:49:58 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 0A8218002D; Thu, 21 May 2015 12:49:58 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id NBN04727; Thu, 21 May 2015 12:49:58 +0900 X-IronPort-AV: E=Sophos;i="5.13,466,1427727600"; d="scan'208";a="186648378" Received: from mail-hk1lp0123.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.123]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 21 May 2015 12:49:56 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.132) by SIXPR06MB317.apcprd06.prod.outlook.com (10.141.125.143) with Microsoft SMTP Server (TLS) id 15.1.166.22; Thu, 21 May 2015 03:49:54 +0000 Message-ID: <874mn6twui.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/4 v2] ASoC: rsnd: add rsnd_dai_stream_quit() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Vinod Koul , Mark Brown CC: Simon , Nguyen Viet Dung , Magnus , Linux-SH , Linux-ALSA , Liam Girdwood , Laurent , Geert Uytterhoeven , Cao Minh Hiep , sakato , In-Reply-To: <878ucitwyh.wl%kuninori.morimoto.gx@renesas.com> References: <878ucitwyh.wl%kuninori.morimoto.gx@renesas.com> Date: Thu, 21 May 2015 03:49:54 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: OS1PR01CA0044.jpnprd01.prod.outlook.com (25.164.162.8) To SIXPR06MB317.apcprd06.prod.outlook.com (10.141.125.143) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB317; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SIXPR06MB317; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB317; X-Forefront-PRVS: 0583A86C08 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(66066001)(33646002)(83506001)(42186005)(101416001)(53416004)(64706001)(69596002)(47776003)(36756003)(105586002)(19580405001)(19580395003)(2950100001)(189998001)(46102003)(46406003)(106356001)(5001770100001)(5001830100001)(5001860100001)(50986999)(54356999)(76176999)(77096005)(68736005)(5001960100002)(50466002)(229853001)(86362001)(77156002)(23726002)(62966003)(4001350100001)(92566002)(40100003)(4001540100001)(81156007)(122386002)(87976001)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB317; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2015 03:49:54.3408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB317 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current Renesas R-Car sound driver calls rsnd_dai_stream_init() when start, but it didn't call paired function. This patch adds rsnd_dai_stream_quit() for it. This is prepare for interrupt error status check feature support. Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi Tested by: Cao Minh Hiep --- v1 -> v2 - no change, but added Hiep's Test-by sound/soc/sh/rcar/core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 405cacd..2b7323c 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -315,7 +315,7 @@ void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int byte) } } -static int rsnd_dai_stream_init(struct rsnd_dai_stream *io, +static void rsnd_dai_stream_init(struct rsnd_dai_stream *io, struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -327,8 +327,11 @@ static int rsnd_dai_stream_init(struct rsnd_dai_stream *io, runtime->channels * samples_to_bytes(runtime, 1); io->next_period_byte = io->byte_per_period; +} - return 0; +static void rsnd_dai_stream_quit(struct rsnd_dai_stream *io) +{ + io->substream = NULL; } static @@ -363,9 +366,7 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - ret = rsnd_dai_stream_init(io, substream); - if (ret < 0) - goto dai_trigger_end; + rsnd_dai_stream_init(io, substream); ret = rsnd_platform_call(priv, dai, start, ssi_id); if (ret < 0) @@ -391,6 +392,8 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd, ret = rsnd_platform_call(priv, dai, stop, ssi_id); if (ret < 0) goto dai_trigger_end; + + rsnd_dai_stream_quit(io); break; default: ret = -EINVAL;