ALSA: bebob: unify configurations for some models produced by Yamaha/Terratec
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 24 Aug 2016 12:42:43 +0000 (21:42 +0900)
committerTakashi Iwai <tiwai@suse.de>
Wed, 24 Aug 2016 13:35:11 +0000 (15:35 +0200)
The below models were developed with a cooperation by Yamaha and Terratec.
 - Yamaha GO 44/Terratec PHASE 24 FW
 - Yamaha GO 46/Terratec PHASE X24 FW

They have the same configurations, thus it's better to unify corresponding
codes.

This commit merges them to reduce the amount of maintained codes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob.c
sound/firewire/bebob/bebob.h
sound/firewire/bebob/bebob_terratec.c
sound/firewire/bebob/bebob_yamaha_terratec.c

index f7e2cbd2a3132b0cc52ff2ea3433477ce9a2cc04..3469ac14c89c83d635d2dadb2e52af3119b70d6a 100644 (file)
@@ -458,17 +458,17 @@ static const struct ieee1394_device_id bebob_id_table[] = {
        /* TerraTec Electronic GmbH, PHASE 88 Rack FW */
        SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000003, &phase88_rack_spec),
        /* TerraTec Electronic GmbH, PHASE 24 FW */
-       SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &phase24_series_spec),
+       SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000004, &yamaha_terratec_spec),
        /* TerraTec Electronic GmbH, Phase X24 FW */
-       SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &phase24_series_spec),
+       SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000007, &yamaha_terratec_spec),
        /* TerraTec Electronic GmbH, EWS MIC2/MIC8 */
        SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000005, &spec_normal),
        /* Terratec Electronic GmbH, Aureon 7.1 Firewire */
        SND_BEBOB_DEV_ENTRY(VEN_TERRATEC, 0x00000002, &spec_normal),
        /* Yamaha, GO44 */
-       SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_go_spec),
+       SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_terratec_spec),
        /* YAMAHA, GO46 */
-       SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_go_spec),
+       SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_terratec_spec),
        /* Focusrite, SaffirePro 26 I/O */
        SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec),
        /* Focusrite, SaffirePro 10 I/O */
index e7f1bb925b12f9e19d76a1c4e563a522473a8436..175da875162d83a298ab4dfa16c64b7847ef4ed2 100644 (file)
@@ -235,8 +235,7 @@ int snd_bebob_create_hwdep_device(struct snd_bebob *bebob);
 
 /* model specific operations */
 extern const struct snd_bebob_spec phase88_rack_spec;
-extern const struct snd_bebob_spec phase24_series_spec;
-extern const struct snd_bebob_spec yamaha_go_spec;
+extern const struct snd_bebob_spec yamaha_terratec_spec;
 extern const struct snd_bebob_spec saffirepro_26_spec;
 extern const struct snd_bebob_spec saffirepro_10_spec;
 extern const struct snd_bebob_spec saffire_le_spec;
index c38358b82ada0ac909ff9e999ee3f57761b5a632..2fdaf93e7a8d3d69d8fa28e91a611c8776b52e76 100644 (file)
@@ -36,25 +36,6 @@ end:
        return err;
 }
 
-static enum snd_bebob_clock_type phase24_series_clk_src_types[] = {
-       SND_BEBOB_CLOCK_TYPE_INTERNAL,
-       SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
-};
-static int
-phase24_series_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
-{
-       int err;
-
-       err = avc_audio_get_selector(bebob->unit, 0, 4, id);
-       if (err < 0)
-               return err;
-
-       if (*id >= ARRAY_SIZE(phase24_series_clk_src_types))
-               return -EIO;
-
-       return 0;
-}
-
 static const struct snd_bebob_rate_spec phase_series_rate_spec = {
        .get    = &snd_bebob_stream_get_rate,
        .set    = &snd_bebob_stream_set_rate,
@@ -71,15 +52,3 @@ const struct snd_bebob_spec phase88_rack_spec = {
        .rate   = &phase_series_rate_spec,
        .meter  = NULL
 };
-
-/* 'PHASE 24 FW' and 'PHASE X24 FW' */
-static const struct snd_bebob_clock_spec phase24_series_clk = {
-       .num    = ARRAY_SIZE(phase24_series_clk_src_types),
-       .types  = phase24_series_clk_src_types,
-       .get    = &phase24_series_clk_src_get,
-};
-const struct snd_bebob_spec phase24_series_spec = {
-       .clock  = &phase24_series_clk,
-       .rate   = &phase_series_rate_spec,
-       .meter  = NULL
-};
index 5c5d7d3b23974937c5a997f4b1d93691cd393319..a6be3e7138e0586cfac6c6ee2b9e67906894f4aa 100644 (file)
@@ -26,6 +26,9 @@
  * Unfortunately current 'ffado-mixer' generated many asynchronous transaction
  * to observe device's state, mainly check cmp connection and signal format. I
  * recommend users to close ffado-mixer at 192.0kHz if mixer is needless.
+ *
+ * Terratec PHASE 24 FW and PHASE X24 FW are internally the same as
+ * Yamaha GO 44 and GO 46. Yamaha and Terratec had cooperated for these models.
  */
 
 static enum snd_bebob_clock_type clk_src_types[] = {
@@ -55,7 +58,7 @@ static const struct snd_bebob_rate_spec rate_spec = {
        .get    = &snd_bebob_stream_get_rate,
        .set    = &snd_bebob_stream_set_rate,
 };
-const struct snd_bebob_spec yamaha_go_spec = {
+const struct snd_bebob_spec yamaha_terratec_spec = {
        .clock  = &clock_spec,
        .rate   = &rate_spec,
        .meter  = NULL