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 f7e2cbd..3469ac1 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 e7f1bb9..175da87 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 c38358b..2fdaf93 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 5c5d7d3..a6be3e7 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