Skip to content

Commit c52f232

Browse files
takaswietiwai
authored andcommitted
ALSA: fireface: code refactoring to add enumeration constants for model identification
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> Link: https://lore.kernel.org/r/20200510074301.116224-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent f4588cc commit c52f232

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎sound/firewire/fireface/ff.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
189189
IEEE1394_MATCH_MODEL_ID,
190190
.vendor_id = OUI_RME,
191191
.specifier_id = OUI_RME,
192-
.version = 0x000001,
192+
.version = SND_FF_UNIT_VERSION_FF800,
193193
.model_id = 0x101800,
194194
.driver_data = (kernel_ulong_t)&spec_ff800,
195195
},
@@ -201,7 +201,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
201201
IEEE1394_MATCH_MODEL_ID,
202202
.vendor_id = OUI_RME,
203203
.specifier_id = OUI_RME,
204-
.version = 0x000002,
204+
.version = SND_FF_UNIT_VERSION_FF400,
205205
.model_id = 0x101800,
206206
.driver_data = (kernel_ulong_t)&spec_ff400,
207207
},
@@ -213,7 +213,7 @@ static const struct ieee1394_device_id snd_ff_id_table[] = {
213213
IEEE1394_MATCH_MODEL_ID,
214214
.vendor_id = OUI_RME,
215215
.specifier_id = OUI_RME,
216-
.version = 0x000004,
216+
.version = SND_FF_UNIT_VERSION_UCX,
217217
.model_id = 0x101800,
218218
.driver_data = (kernel_ulong_t)&spec_ucx,
219219
},

‎sound/firewire/fireface/ff.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
#define SND_FF_IN_MIDI_PORTS 2
3535
#define SND_FF_OUT_MIDI_PORTS 2
3636

37+
enum snd_ff_unit_version {
38+
SND_FF_UNIT_VERSION_FF800 = 0x000001,
39+
SND_FF_UNIT_VERSION_FF400 = 0x000002,
40+
SND_FF_UNIT_VERSION_UCX = 0x000004,
41+
};
42+
3743
enum snd_ff_stream_mode {
3844
SND_FF_STREAM_MODE_LOW = 0,
3945
SND_FF_STREAM_MODE_MID,

0 commit comments

Comments
 (0)