All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net
Subject: [PATCH 1/8] ALSA: fireface: share some registers for status of clock synchronization
Date: Tue, 11 Dec 2018 19:17:28 +0900	[thread overview]
Message-ID: <20181211101735.13735-2-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20181211101735.13735-1-o-takashi@sakamocchi.jp>

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 <o-takashi@sakamocchi.jp>
---
 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, &reg, sizeof(reg), 0);
+				 SND_FF_REG_CLOCK_CONFIG, &reg, 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, &reg, sizeof(reg), 0);
+				 SND_FF_REG_SYNC_STATUS, &reg, 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, &reg, sizeof(reg), 0);
+				 SND_FF_REG_CLOCK_CONFIG, &reg, 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;
-- 
2.19.1

  reply	other threads:[~2018-12-11 10:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 10:17 [PATCH 0/8] ALSA: fireface: add support for Fireface 800 with MIDI functionality only Takashi Sakamoto
2018-12-11 10:17 ` Takashi Sakamoto [this message]
2018-12-11 10:17 ` [PATCH 2/8] ALSA: fireface: share status and configuration dump Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 3/8] ALSA: fireface: share helper function to get current sampling rate and clock source Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 4/8] ALSA: fireface: add support for second optical interface for ADAT stream Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 5/8] ALSA: fireface: share register for async transaction of MIDI messages Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 6/8] ALSA: fireface: add driver data for register for MIDI high address Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 7/8] ALSA: fireface: localize a handler for MIDI messages on tx transaction Takashi Sakamoto
2018-12-11 10:17 ` [PATCH 8/8] ALSA: fireface: add support for Fireface 800 with MIDI functionality only Takashi Sakamoto
2018-12-11 13:59 ` [PATCH 0/8] " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181211101735.13735-2-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sourceforge.net \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.