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 3/6] ALSA: fireface: code refactoring to add enumeration constants for model identification
Date: Sun, 10 May 2020 16:42:58 +0900	[thread overview]
Message-ID: <20200510074301.116224-4-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20200510074301.116224-1-o-takashi@sakamocchi.jp>

In RME fireface series, version field of unit directory in configuration
ROM is used to distinguish each model. The value of field is known and
it's better to use enumeration constants for code representation.

This commit adds enumeration constants for model identification.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/fireface/ff.c | 6 +++---
 sound/firewire/fireface/ff.h | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/firewire/fireface/ff.c b/sound/firewire/fireface/ff.c
index b62a4fd22407..b295e40a425d 100644
--- a/sound/firewire/fireface/ff.c
+++ b/sound/firewire/fireface/ff.c
@@ -189,7 +189,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
 				  IEEE1394_MATCH_MODEL_ID,
 		.vendor_id	= OUI_RME,
 		.specifier_id	= OUI_RME,
-		.version	= 0x000001,
+		.version	= SND_FF_UNIT_VERSION_FF800,
 		.model_id	= 0x101800,
 		.driver_data	= (kernel_ulong_t)&spec_ff800,
 	},
@@ -201,7 +201,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
 				  IEEE1394_MATCH_MODEL_ID,
 		.vendor_id	= OUI_RME,
 		.specifier_id	= OUI_RME,
-		.version	= 0x000002,
+		.version	= SND_FF_UNIT_VERSION_FF400,
 		.model_id	= 0x101800,
 		.driver_data	= (kernel_ulong_t)&spec_ff400,
 	},
@@ -213,7 +213,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
 				  IEEE1394_MATCH_MODEL_ID,
 		.vendor_id	= OUI_RME,
 		.specifier_id	= OUI_RME,
-		.version	= 0x000004,
+		.version	= SND_FF_UNIT_VERSION_UCX,
 		.model_id	= 0x101800,
 		.driver_data	= (kernel_ulong_t)&spec_ucx,
 	},
diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h
index dc7a20f75983..62ad921c3706 100644
--- a/sound/firewire/fireface/ff.h
+++ b/sound/firewire/fireface/ff.h
@@ -34,6 +34,12 @@
 #define SND_FF_IN_MIDI_PORTS		2
 #define SND_FF_OUT_MIDI_PORTS		2
 
+enum snd_ff_unit_version {
+	SND_FF_UNIT_VERSION_FF800	= 0x000001,
+	SND_FF_UNIT_VERSION_FF400	= 0x000002,
+	SND_FF_UNIT_VERSION_UCX		= 0x000004,
+};
+
 enum snd_ff_stream_mode {
 	SND_FF_STREAM_MODE_LOW = 0,
 	SND_FF_STREAM_MODE_MID,
-- 
2.25.1


  parent reply	other threads:[~2020-05-10  7:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10  7:42 [PATCH 0/6] ALSA: fireface: add support for Fireface 802 and UFX Takashi Sakamoto
2020-05-10  7:42 ` [PATCH 1/6] ALSA: fireface: fix configuration error for nominal sampling transfer frequency Takashi Sakamoto
2020-05-10  7:42 ` [PATCH 2/6] ALSA: fireface: start IR context immediately Takashi Sakamoto
2020-05-10  7:42 ` Takashi Sakamoto [this message]
2020-05-10  7:42 ` [PATCH 4/6] ALSA: fireface: code refactoring to decide name of sound card Takashi Sakamoto
2020-05-10  7:43 ` [PATCH 5/6] ALSA: fireface: add support for RME FireFace 802 Takashi Sakamoto
2020-05-10  7:43 ` [PATCH 6/6] ALSA: fireface: add support for RME Fireface UFX (untested) Takashi Sakamoto
2020-05-10 10:05 ` [PATCH 0/6] ALSA: fireface: add support for Fireface 802 and UFX Takashi Iwai
2020-05-10 10:17   ` Takashi Sakamoto
2020-05-10 17:28     ` 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=20200510074301.116224-4-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 \
    --subject='Re: [PATCH 3/6] ALSA: fireface: code refactoring to add enumeration constants for model identification' \
    /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

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.