From patchwork Tue Dec 11 10:17:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10723653 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 47DA81751 for ; Tue, 11 Dec 2018 11:12:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 364BD2A3FC for ; Tue, 11 Dec 2018 11:12:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B0FB2A3FE; Tue, 11 Dec 2018 11:12:52 +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,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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43AF42A43D for ; Tue, 11 Dec 2018 11:12:51 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AF146267B97; Tue, 11 Dec 2018 11:18:02 +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 BD36C267B9C; Tue, 11 Dec 2018 11:17:56 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by alsa0.perex.cz (Postfix) with ESMTP id C17F1267B8B for ; Tue, 11 Dec 2018 11:17:53 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id n2so6431714pgm.3 for ; Tue, 11 Dec 2018 02:17:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v8B1d3rgpB/pImRJ9FaEoTXLfhjnJDUcx6pcauEFkTE=; b=dH2BAiUeYkUooB6L7z4hofIYtqO0sPhq8vg10QENDcgf0qNjbjSSubZurTPMrRh6jS boFXYBPiMX4B/L5/GcwsnwBaiqbWUDZtvrv1FGLh/fbhxtr9zLhb9AKH7BJGScX8dARY 0GV1VMJoHrXCXIG8PWDAkR16Iz55HZvI4ya5kPcDUTXMLy5hr5j0Cw4Hdq4qXJJBiXBR Xr/oYylnAJ3L0I1Jpu7r/cFQUjCA5fxw75lPz/342xs5LmKdZq3oCEEg5KZIrslmODba 2Esec9tilXkoR3u0UV70Erf7UMOROuo1V7I5PzIEXnSvSDhh8VqU42d+6i3V0YkDhlLF QXnw== X-Gm-Message-State: AA+aEWYA9ltNWLeBJYYrF6Vpn+LZv3vSNj8l49TNrIkqtiOPp9S3xeo0 XYxiJ0UAZomBzBK5FApv+cQ= X-Google-Smtp-Source: AFSGD/XhubOZJ9ReDCkoztnRbr+yigi/lPE3IKQieUlW0JaITr59gkN22LbewhCzWpQXZ1dbZ0gRWA== X-Received: by 2002:a62:399b:: with SMTP id u27mr16342809pfj.181.1544523472983; Tue, 11 Dec 2018 02:17:52 -0800 (PST) Received: from localhost.localdomain ([2405:6580:9660:3200:cd5e:68f4:869b:f15d]) by smtp.gmail.com with ESMTPSA id l3sm23867316pga.92.2018.12.11.02.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 02:17:52 -0800 (PST) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 11 Dec 2018 19:17:32 +0900 Message-Id: <20181211101735.13735-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181211101735.13735-1-o-takashi@sakamocchi.jp> References: <20181211101735.13735-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net Subject: [alsa-devel] [PATCH 5/8] ALSA: fireface: share register for async transaction of MIDI messages 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP As long as investigating packet dumps from Fireface 400/800, a register to receive asynchronous transactions for MIDI messages is the same. For Fireface 800, minor register is used. This commit declares macros for the transactions and obsoletes model-specific parameters. Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff-protocol-ff400.c | 4 ---- sound/firewire/fireface/ff-transaction.c | 7 +++++-- sound/firewire/fireface/ff.h | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/firewire/fireface/ff-protocol-ff400.c b/sound/firewire/fireface/ff-protocol-ff400.c index d2fbb0382223..5cbaff9d6a40 100644 --- a/sound/firewire/fireface/ff-protocol-ff400.c +++ b/sound/firewire/fireface/ff-protocol-ff400.c @@ -16,8 +16,6 @@ #define FF400_ISOC_COMM_STOP 0x000080100510ull #define FF400_MIDI_HIGH_ADDR 0x0000801003f4ull -#define FF400_MIDI_RX_PORT_0 0x000080180000ull -#define FF400_MIDI_RX_PORT_1 0x000080190000ull static int ff400_begin_session(struct snd_ff *ff, unsigned int rate) { @@ -115,6 +113,4 @@ const struct snd_ff_protocol snd_ff_protocol_ff400 = { .switch_fetching_mode = ff400_switch_fetching_mode, .midi_high_addr_reg = FF400_MIDI_HIGH_ADDR, - .midi_rx_port_0_reg = FF400_MIDI_RX_PORT_0, - .midi_rx_port_1_reg = FF400_MIDI_RX_PORT_1, }; diff --git a/sound/firewire/fireface/ff-transaction.c b/sound/firewire/fireface/ff-transaction.c index 751662b62389..fa0bc956696f 100644 --- a/sound/firewire/fireface/ff-transaction.c +++ b/sound/firewire/fireface/ff-transaction.c @@ -8,6 +8,9 @@ #include "ff.h" +#define SND_FF_REG_MIDI_RX_PORT_0 0x000080180000ull +#define SND_FF_REG_MIDI_RX_PORT_1 0x000080190000ull + int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate, enum snd_ff_clock_src *src) { @@ -153,10 +156,10 @@ static void transmit_midi_msg(struct snd_ff *ff, unsigned int port) fill_midi_buf(ff, port, i, buf[i]); if (port == 0) { - addr = ff->spec->protocol->midi_rx_port_0_reg; + addr = SND_FF_REG_MIDI_RX_PORT_0; callback = finish_transmit_midi0_msg; } else { - addr = ff->spec->protocol->midi_rx_port_1_reg; + addr = SND_FF_REG_MIDI_RX_PORT_1; callback = finish_transmit_midi1_msg; } diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index 95cf90b4b533..ea905285beab 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -107,8 +107,6 @@ struct snd_ff_protocol { int (*switch_fetching_mode)(struct snd_ff *ff, bool enable); u64 midi_high_addr_reg; - u64 midi_rx_port_0_reg; - u64 midi_rx_port_1_reg; }; extern const struct snd_ff_protocol snd_ff_protocol_ff400;