From patchwork Sun Jun 2 07:12:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10971629 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 59F1F1398 for ; Sun, 2 Jun 2019 07:19:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F1BA287DA for ; Sun, 2 Jun 2019 07:19:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC7F28948; Sun, 2 Jun 2019 07:19:49 +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 72137287DA for ; Sun, 2 Jun 2019 07:19:48 +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 BCE9616AA; Sun, 2 Jun 2019 09:18:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BCE9616AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1559459986; bh=iA9r+sGyluJIp98/DyErHPOqMIP4nENaO8HTputZtjU=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FY3395SO1jayC3eh+HvWWPqAAGjY8RrKUpWG2gbrI7hB+n6O745KRmYmkr36cObod dAxkypKs4RXg8PqZekPizrGfrLDmcAkBxkkoVJ9vTYbQ+d/P9ReL74ArXZw19I6HpB kLFLOLhyjUe1ppnCkaZCgrNS5tJ7MmqQIF+IXc80= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97884F89754; Sun, 2 Jun 2019 09:13:29 +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 1DD26F8973C; Sun, 2 Jun 2019 09:13:21 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B9DFF89735 for ; Sun, 2 Jun 2019 09:13:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B9DFF89735 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="cmpEVGvb"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pirblrEy" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 519BC20D56; Sun, 2 Jun 2019 03:13:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 02 Jun 2019 03:13:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=vpTMg26qRCKSA SpEMfFFxe/bbvp9lzG4qbDcxjzzzOs=; b=cmpEVGvb+HSREMv2/tjitSIkoa1AG ZBECEoQHm5SEGMZRH09mMhYL5935UvViDx6QFO8cTWvAWYl1JvFWExTQcUBHsAJ+ 8GllV+x9iLAMQPZUSenqw6ZEzq1wiOzr+L91BHDvaQVU60U3nN9lMiNBF6iHcZdF qC2ru3HDt+lQKfEP/2wHRw/76o17w1o53MXiO30Do/Pp8dvWYIVs2N/KDzLGGea+ hwznnFLlfxJMcrqyXzKXspvrNRJhBPshhhPyiDBkJC6JxirrRcVTYlfhqF9mcPhT /lwKpjM4rfdHgxxvwDr74mdi5RAuBcN1RFpy3/xW1aZOxxc+MOsUV0pRw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=vpTMg26qRCKSASpEMfFFxe/bbvp9lzG4qbDcxjzzzOs=; b=pirblrEy LBap2snddotFcIbsDQmgdhcKVMEzrUDEGWkb2ytfZe9Ltjoy0fA9QtwlOpyUl8l1 p8EZN3CdhKzGOQmjyiBZzVBNejArpDtegA47kjXHq19zCF7yAgUivaXHzfztUTst ny+XE7yBnK2QPiu84rqiX++MeTM1tNw55NayicbbJUhNqEcdyVI+Cai8lp1zcNif lohUCB2IRE04B65O6QbbKizBMpCatt6Qq6EnEjRLkgveu+jMqrjQccfnIWD0vOye Uctt5oECnO/4upLmjWjLUudKzzCo8EylGMrUcm0sd1hirskXxtscLjYb+Yg+DnST bv2YZaP/adNVcg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefgedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id DD38880059; Sun, 2 Jun 2019 03:13:15 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 2 Jun 2019 16:12:52 +0900 Message-Id: <20190602071259.21622-9-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190602071259.21622-1-o-takashi@sakamocchi.jp> References: <20190602071259.21622-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 08/15] ALSA: fireface: add protocol-specific operation to allocate isochronous resources 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. In ALSA fireface driver, the allocation of isochronous resources is programmed in each implementation of protocol. This commit adds protocol-specific operation for the allocation separated from the operation to begin session. Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff-stream.c | 4 ++++ sound/firewire/fireface/ff.h | 1 + 2 files changed, 5 insertions(+) diff --git a/sound/firewire/fireface/ff-stream.c b/sound/firewire/fireface/ff-stream.c index a8a90f1ae09e..740963e4e1c9 100644 --- a/sound/firewire/fireface/ff-stream.c +++ b/sound/firewire/fireface/ff-stream.c @@ -156,6 +156,10 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) if (err < 0) return err; + err = ff->spec->protocol->allocate_resources(ff, rate); + if (err < 0) + goto error; + err = ff->spec->protocol->begin_session(ff, rate); if (err < 0) goto error; diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index ed8fea0ff5e1..c478103388a2 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -113,6 +113,7 @@ struct snd_ff_protocol { int (*get_clock)(struct snd_ff *ff, unsigned int *rate, enum snd_ff_clock_src *src); int (*switch_fetching_mode)(struct snd_ff *ff, bool enable); + int (*allocate_resources)(struct snd_ff *ff, unsigned int rate); int (*begin_session)(struct snd_ff *ff, unsigned int rate); void (*finish_session)(struct snd_ff *ff); void (*dump_status)(struct snd_ff *ff, struct snd_info_buffer *buffer);