From patchwork Wed May 20 03:47:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6442001 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 2041AC0433 for ; Wed, 20 May 2015 03:47:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51482202EC for ; Wed, 20 May 2015 03:47:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 647A620394 for ; Wed, 20 May 2015 03:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbbETDrJ (ORCPT ); Tue, 19 May 2015 23:47:09 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:31791 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750994AbbETDrI (ORCPT ); Tue, 19 May 2015 23:47:08 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 20 May 2015 12:47:07 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 23E544968C; Wed, 20 May 2015 12:47:07 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 0CFE82806F; Wed, 20 May 2015 12:47:07 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 072152806E; Wed, 20 May 2015 12:47:07 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id NAA16322; Wed, 20 May 2015 12:47:07 +0900 X-IronPort-AV: E=Sophos;i="5.13,462,1427727600"; d="scan'208";a="187726451" Received: from mail-sg1lp0086.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.86]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2015 12:47:05 +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 SINPR06MB315.apcprd06.prod.outlook.com (10.141.115.153) with Microsoft SMTP Server (TLS) id 15.1.160.19; Wed, 20 May 2015 03:47:03 +0000 Message-ID: <87y4kj3oab.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/4] ASoC: rsnd: add rsnd_dai_stream_quit() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 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: <87382r52x2.wl%kuninori.morimoto.gx@renesas.com> References: <87382r52x2.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 20 May 2015 03:47:03 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR06CA0013.apcprd06.prod.outlook.com (25.164.91.23) To SINPR06MB315.apcprd06.prod.outlook.com (10.141.115.153) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB315; 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:SINPR06MB315; BCL:0; PCL:0; RULEID:; SRVR:SINPR06MB315; X-Forefront-PRVS: 0582641F53 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(87976001)(66066001)(47776003)(64706001)(50986999)(76176999)(50466002)(86362001)(101416001)(54356999)(105586002)(53416004)(68736005)(81156007)(77096005)(4001350100001)(46102003)(97736004)(92566002)(62966003)(77156002)(4001540100001)(40100003)(122386002)(2950100001)(106356001)(46406003)(23726002)(189998001)(5001830100001)(5001860100001)(5001960100002)(5001920100001)(42186005)(5001770100001)(33646002)(229853001)(69596002)(36756003)(83506001)(19580395003)(19580405001); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB315; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2015 03:47:03.2013 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB315 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 --- 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;