From patchwork Tue Dec 11 10:17:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10723659 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 2BFBD1751 for ; Tue, 11 Dec 2018 11:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19B2D2A349 for ; Tue, 11 Dec 2018 11:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15E1B2A418; Tue, 11 Dec 2018 11:12:53 +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 5F7842A349 for ; Tue, 11 Dec 2018 11:12:52 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CF5C3267B95; Tue, 11 Dec 2018 11:17:55 +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 9B7EB267B94; Tue, 11 Dec 2018 11:17:51 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by alsa0.perex.cz (Postfix) with ESMTP id 8B203267B8A for ; Tue, 11 Dec 2018 11:17:46 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id w6so6426010pgl.6 for ; Tue, 11 Dec 2018 02:17:46 -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=bYrSCzxUPgiJZ9Ioxw80BA7J51vlB7PWmmcXHEQrOTM=; b=qjR7vm6r9scXiVPU31cpRxgznfk4kvkWgtrmYpA799s3Lsm7y1kdOSehOQCoLWgRkL T9HyfmXYXIlOm46/2v5nBxepw/P5p/tAcSD191ZRrQSJncVd8uOoXYnD8S7Pwg89Gnm2 T4Lpi4ic42lfD5ikvZRK5fSI8QRNUPXGPyktYwSDGCJ1kEzWoYkQk5RQwncBAKXVmE/W efltFS5J31feQ0hj1o/WbkVQh6zVybHV2n43hiASBXHfM51axvLkVdrqU/2R/LanSZFn E9P3ewftllgarqX18LIYSL4jcIOjy9D9R6NjtJprJfhm4i3pWD/c2LMmR1ZcX+LEL/wu x63Q== X-Gm-Message-State: AA+aEWbnlKj23hxbqGBPRY2mhOoVOM9dz6oTeEAXy1ERu9mp3JI0wVbq WLq6Z04EyzxJU3McBE+6Xto= X-Google-Smtp-Source: AFSGD/XHUSPfus2VQuG8GVoveH0e0XsfdzDhkBfF/K6WQ+aNNGIH5Zx/MdZxh2o8pB7v7OmOlT+RrA== X-Received: by 2002:a63:e20a:: with SMTP id q10mr13688240pgh.206.1544523465428; Tue, 11 Dec 2018 02:17:45 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 02:17:44 -0800 (PST) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Tue, 11 Dec 2018 19:17:28 +0900 Message-Id: <20181211101735.13735-2-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 1/8] ALSA: fireface: share some registers for status of clock synchronization 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, status registers for clock synchronization is common. This commit moves some macros for them to header file. Signed-off-by: Takashi Sakamoto --- sound/firewire/fireface/ff-protocol-ff400.c | 11 ++++------- sound/firewire/fireface/ff.h | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/firewire/fireface/ff-protocol-ff400.c b/sound/firewire/fireface/ff-protocol-ff400.c index 654a50319198..20e0c0ec3a58 100644 --- a/sound/firewire/fireface/ff-protocol-ff400.c +++ b/sound/firewire/fireface/ff-protocol-ff400.c @@ -14,9 +14,6 @@ #define FF400_ISOC_COMM_START 0x000080100508ull #define FF400_TX_PACKET_FORMAT 0x00008010050cull #define FF400_ISOC_COMM_STOP 0x000080100510ull -#define FF400_SYNC_STATUS 0x0000801c0000ull -#define FF400_FETCH_PCM_FRAMES 0x0000801c0000ull /* For block request. */ -#define FF400_CLOCK_CONFIG 0x0000801c0004ull #define FF400_MIDI_HIGH_ADDR 0x0000801003f4ull #define FF400_MIDI_RX_PORT_0 0x000080180000ull @@ -30,7 +27,7 @@ static int ff400_get_clock(struct snd_ff *ff, unsigned int *rate, int err; err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, - FF400_CLOCK_CONFIG, ®, sizeof(reg), 0); + SND_FF_REG_CLOCK_CONFIG, ®, sizeof(reg), 0); if (err < 0) return err; data = le32_to_cpu(reg); @@ -165,7 +162,7 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable) } err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, - FF400_FETCH_PCM_FRAMES, reg, + SND_FF_REG_FETCH_PCM_FRAMES, reg, sizeof(__le32) * 18, 0); kfree(reg); return err; @@ -179,7 +176,7 @@ static void ff400_dump_sync_status(struct snd_ff *ff, int err; err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, - FF400_SYNC_STATUS, ®, sizeof(reg), 0); + SND_FF_REG_SYNC_STATUS, ®, sizeof(reg), 0); if (err < 0) return; @@ -294,7 +291,7 @@ static void ff400_dump_clock_config(struct snd_ff *ff, int err; err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, - FF400_CLOCK_CONFIG, ®, sizeof(reg), 0); + SND_FF_REG_CLOCK_CONFIG, ®, sizeof(reg), 0); if (err < 0) return; diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h index 64df44beb950..9122fb6ed8fd 100644 --- a/sound/firewire/fireface/ff.h +++ b/sound/firewire/fireface/ff.h @@ -37,6 +37,11 @@ #define SND_FF_IN_MIDI_PORTS 2 #define SND_FF_OUT_MIDI_PORTS 2 +#define SND_FF_REG_SYNC_STATUS 0x0000801c0000ull +/* For block wriet request. */ +#define SND_FF_REG_FETCH_PCM_FRAMES 0x0000801c0000ull +#define SND_FF_REG_CLOCK_CONFIG 0x0000801c0004ull + struct snd_ff_protocol; struct snd_ff_spec { const char *const name;