]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/usb/usbmixer_maps.c
ALSA: usb-mixer: factor out quirks
[mirror_ubuntu-bionic-kernel.git] / sound / usb / usbmixer_maps.c
index 3e5d66cf1f5a3ef8212afe5fca7128d01fbcfff6..d93fc89beba8aee1040164bccff3935f0a78524d 100644 (file)
  *
  */
 
+struct usbmix_dB_map {
+       u32 min;
+       u32 max;
+};
 
 struct usbmix_name_map {
        int id;
        const char *name;
        int control;
+       struct usbmix_dB_map *dB;
 };
 
 struct usbmix_selector_map {
@@ -72,7 +77,7 @@ static struct usbmix_name_map extigy_map[] = {
        { 8, "Line Playback" }, /* FU */
        /* 9: IT mic */
        { 10, "Mic Playback" }, /* FU */
-       { 11, "Capture Input Source" }, /* SU */
+       { 11, "Capture Source" }, /* SU */
        { 12, "Capture" }, /* FU */
        /* 13: OT pcm capture */
        /* 14: MU (w/o controls) */
@@ -80,8 +85,8 @@ static struct usbmix_name_map extigy_map[] = {
        /* 16: MU (w/o controls) */
        { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
        { 17, "Channel Routing", 2 },   /* PU: mode select */
-       { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
-       { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
+       { 18, "Tone Control - Bass", UAC_BASS_CONTROL }, /* FU */
+       { 18, "Tone Control - Treble", UAC_TREBLE_CONTROL }, /* FU */
        { 18, "Master Playback" }, /* FU; others */
        /* 19: OT speaker */
        /* 20: OT headphone */
@@ -102,6 +107,9 @@ static struct usbmix_name_map extigy_map[] = {
  * e.g. no Master and fake PCM volume
  *                     Pavel Mihaylov <bin@bash.info>
  */
+static struct usbmix_dB_map mp3plus_dB_1 = {-4781, 0}; /* just guess */
+static struct usbmix_dB_map mp3plus_dB_2 = {-1781, 618}; /* just guess */
+
 static struct usbmix_name_map mp3plus_map[] = {
        /* 1: IT pcm */
        /* 2: IT mic */
@@ -110,16 +118,19 @@ static struct usbmix_name_map mp3plus_map[] = {
        /* 5: OT digital out */
        /* 6: OT speaker */
        /* 7: OT pcm capture */
-       { 8, "Capture Input Source" }, /* FU, default PCM Capture Source */
+       { 8, "Capture Source" }, /* FU, default PCM Capture Source */
                /* (Mic, Input 1 = Line input, Input 2 = Optical input) */
        { 9, "Master Playback" }, /* FU, default Speaker 1 */
        /* { 10, "Mic Capture", 1 }, */ /* FU, Mic Capture */
-       /* { 10, "Mic Capture", 2 }, */ /* FU, Mic Capture */
+       { 10, /* "Mic Capture", */ NULL, 2, .dB = &mp3plus_dB_2 },
+               /* FU, Mic Capture */
        { 10, "Mic Boost", 7 }, /* FU, default Auto Gain Input */
-       { 11, "Line Capture" }, /* FU, default PCM Capture */
+       { 11, "Line Capture", .dB = &mp3plus_dB_2 },
+               /* FU, default PCM Capture */
        { 12, "Digital In Playback" }, /* FU, default PCM 1 */
-       /* { 13, "Mic Playback" }, */ /* FU, default Mic Playback */
-       { 14, "Line Playback" }, /* FU, default Speaker */
+       { 13, /* "Mic Playback", */ .dB = &mp3plus_dB_1 },
+               /* FU, default Mic Playback */
+       { 14, "Line Playback", .dB = &mp3plus_dB_1 }, /* FU, default Speaker */
        /* 15: MU */
        { 0 } /* terminator */
 };
@@ -277,6 +288,22 @@ static struct usbmix_name_map scratch_live_map[] = {
        { 0 } /* terminator */
 };
 
+/* "Gamesurround Muse Pocket LT" looks same like "Sound Blaster MP3+"
+ *  most importand difference is SU[8], it should be set to "Capture Source"
+ *  to make alsamixer and PA working properly.
+ *  FIXME: or mp3plus_map should use "Capture Source" too,
+ *  so this maps can be merget
+ */
+static struct usbmix_name_map hercules_usb51_map[] = {
+       { 8, "Capture Source" },        /* SU, default "PCM Capture Source" */
+       { 9, "Master Playback" },       /* FU, default "Speaker Playback" */
+       { 10, "Mic Boost", 7 },         /* FU, default "Auto Gain Input" */
+       { 11, "Line Capture" },         /* FU, default "PCM Capture" */
+       { 13, "Mic Bypass Playback" },  /* FU, default "Mic Playback" */
+       { 14, "Line Bypass Playback" }, /* FU, default "Line Playback" */
+       { 0 }                           /* terminator */
+};
+
 /*
  * Control map entries
  */
@@ -315,6 +342,13 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
                .id = USB_ID(0x06f8, 0xd002),
                .ignore_ctl_error = 1,
        },
+       {
+               /* Hercules Gamesurround Muse Pocket LT
+                * (USB 5.1 Channel Audio Adapter)
+                */
+               .id = USB_ID(0x06f8, 0xc000),
+               .map = hercules_usb51_map,
+       },
        {
                .id = USB_ID(0x08bb, 0x2702),
                .map = linex_map,