From patchwork Fri Apr 25 13:45:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 4063291 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 372AFBFF02 for ; Fri, 25 Apr 2014 14:18:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 653E42035C for ; Fri, 25 Apr 2014 14:18:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0F04D20268 for ; Fri, 25 Apr 2014 14:18:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 20B082657FC; Fri, 25 Apr 2014 16:18:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B48532654E7; Fri, 25 Apr 2014 16:00:33 +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 541C92654E5; Fri, 25 Apr 2014 16:00:31 +0200 (CEST) Received: from smtp310.phy.lolipop.jp (smtp310.phy.lolipop.jp [210.157.22.78]) by alsa0.perex.cz (Postfix) with ESMTP id 418702654EC for ; Fri, 25 Apr 2014 15:46:23 +0200 (CEST) Received: from smtp310.phy.lolipop.lan (HELO smtp310.phy.lolipop.jp) (172.17.1.10) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp310.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Fri, 25 Apr 2014 22:46:22 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp310.phy.lolipop.jp (LOLIPOP-Fsecure); Fri, 25 Apr 2014 22:45:31 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de, perex@perex.cz Date: Fri, 25 Apr 2014 22:45:03 +0900 Message-Id: <1398433530-13136-23-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398433530-13136-1-git-send-email-o-takashi@sakamocchi.jp> References: <1398433530-13136-1-git-send-email-o-takashi@sakamocchi.jp> Cc: alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net, ffado-devel@lists.sf.net Subject: [alsa-devel] [PATCH 22/49] fireworks/firewire-lib: Add a quirk for empty packet with TAG0 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 X-Virus-Scanned: ClamAV using ClamSMTP Fireworks has a quirk to transmit empty packets with TAG0. This commit adds handling this quirk for full duplex stream synchronization. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp.c | 9 ++++++--- sound/firewire/amdtp.h | 2 ++ sound/firewire/fireworks/fireworks_stream.c | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 5b88461..dce4c6d 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c @@ -815,7 +815,7 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) }; unsigned int header_size; enum dma_data_direction dir; - int type, err; + int type, tag, err; mutex_lock(&s->mutex); @@ -869,9 +869,12 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) } while (s->packet_index > 0); /* NOTE: TAG1 matches CIP. This just affects in stream. */ + tag = FW_ISO_CONTEXT_MATCH_TAG1; + if (s->flags & CIP_EMPTY_WITH_TAG0) + tag |= FW_ISO_CONTEXT_MATCH_TAG0; + s->callbacked = false; - err = fw_iso_context_start(s->context, -1, 0, - FW_ISO_CONTEXT_MATCH_TAG1); + err = fw_iso_context_start(s->context, -1, 0, tag); if (err < 0) goto err_context; diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h index 3de3463..96b96ec 100644 --- a/sound/firewire/amdtp.h +++ b/sound/firewire/amdtp.h @@ -18,11 +18,13 @@ * the overall sample rate comes out right. * @CIP_SYNC_TO_DEVICE: In sync to device mode, time stamp in out packets is * generated by in packets. Defaultly this driver generates timestamp. + * @CIP_EMPTY_WITH_TAG0: Only for in-stream. Empty in-packets have TAG0. */ enum cip_flags { CIP_NONBLOCKING = 0x00, CIP_BLOCKING = 0x01, CIP_SYNC_TO_DEVICE = 0x02, + CIP_EMPTY_WITH_TAG0 = 0x04, }; /** diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index ec62aa6..360e871 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c @@ -194,6 +194,8 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw) err = init_stream(efw, &efw->tx_stream); if (err < 0) goto end; + /* Fireworks transmits NODATA packets with TAG0. */ + efw->tx_stream.flags |= CIP_EMPTY_WITH_TAG0; err = init_stream(efw, &efw->rx_stream); if (err < 0) {