usbmixer_maps.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Additional mixer mapping
  3. *
  4. * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. struct usbmix_name_map {
  22. int id;
  23. const char *name;
  24. int control;
  25. };
  26. struct usbmix_ctl_map {
  27. int vendor;
  28. int product;
  29. const struct usbmix_name_map *map;
  30. int ignore_ctl_error;
  31. };
  32. /*
  33. * USB control mappers for SB Exitigy
  34. */
  35. /*
  36. * Topology of SB Extigy (see on the wide screen :)
  37. USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
  38. ^ | | | |
  39. USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+ | | | +->FU[25] > Dig_OUT[26]
  40. ^ ^ | | | |
  41. Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19]
  42. | | | |
  43. Lin-IN[7] -+-->FU[8]---------+ | | +----------------------------------------> Hph_OUT[20]
  44. | | |
  45. Mic-IN[9] --+->FU[10]----------------------------+ |
  46. || |
  47. || +----------------------------------------------------+
  48. VV V
  49. ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13]
  50. */
  51. static struct usbmix_name_map extigy_map[] = {
  52. /* 1: IT pcm */
  53. { 2, "PCM Playback" }, /* FU */
  54. /* 3: IT pcm */
  55. /* 4: IT digital in */
  56. { 5, NULL }, /* DISABLED: this seems to be bogus on some firmware */
  57. { 6, "Digital In" }, /* FU */
  58. /* 7: IT line */
  59. { 8, "Line Playback" }, /* FU */
  60. /* 9: IT mic */
  61. { 10, "Mic Playback" }, /* FU */
  62. { 11, "Capture Input Source" }, /* SU */
  63. { 12, "Capture" }, /* FU */
  64. /* 13: OT pcm capture */
  65. /* 14: MU (w/o controls) */
  66. /* 15: PU (3D enh) */
  67. /* 16: MU (w/o controls) */
  68. { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
  69. { 17, "Channel Routing", 2 }, /* PU: mode select */
  70. { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
  71. { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
  72. { 18, "Master Playback" }, /* FU; others */
  73. /* 19: OT speaker */
  74. /* 20: OT headphone */
  75. { 21, NULL }, /* DISABLED: EU (for what?) */
  76. { 22, "Digital Out Playback" }, /* FU */
  77. { 23, "Digital Out1 Playback" }, /* FU */ /* FIXME: corresponds to 24 */
  78. /* 24: OT digital out */
  79. { 25, "IEC958 Optical Playback" }, /* FU */
  80. { 26, "IEC958 Optical Playback" }, /* OT */
  81. { 27, NULL }, /* DISABLED: EU (for what?) */
  82. /* 28: FU speaker (mute) */
  83. { 29, NULL }, /* Digital Input Playback Source? */
  84. { 0 } /* terminator */
  85. };
  86. /* LineX FM Transmitter entry - needed to bypass controls bug */
  87. static struct usbmix_name_map linex_map[] = {
  88. /* 1: IT pcm */
  89. /* 2: OT Speaker */
  90. { 3, "Master" }, /* FU: master volume - left / right / mute */
  91. { 0 } /* terminator */
  92. };
  93. /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk>
  94. * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK
  95. * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.)
  96. * The USB Mixer publishes a Microphone and extra Volume controls for it, but none exist on the device,
  97. * so this map removes all unwanted sliders from alsamixer
  98. */
  99. static struct usbmix_name_map justlink_map[] = {
  100. /* 1: IT pcm playback */
  101. /* 2: Not present */
  102. { 3, NULL}, /* IT mic (No mic input on device) */
  103. /* 4: Not present */
  104. /* 5: OT speacker */
  105. /* 6: OT pcm capture */
  106. { 7, "Master Playback" }, /* Mute/volume for speaker */
  107. { 8, NULL }, /* Capture Switch (No capture inputs on device) */
  108. { 9, NULL }, /* Capture Mute/volume (No capture inputs on device */
  109. /* 0xa: Not present */
  110. /* 0xb: MU (w/o controls) */
  111. { 0xc, NULL }, /* Mic feedback Mute/volume (No capture inputs on device) */
  112. { 0 } /* terminator */
  113. };
  114. /*
  115. * Control map entries
  116. */
  117. static struct usbmix_ctl_map usbmix_ctl_maps[] = {
  118. { 0x41e, 0x3000, extigy_map, 1 },
  119. { 0x8bb, 0x2702, linex_map, 1 },
  120. { 0xc45, 0x1158, justlink_map, 0 },
  121. { 0 } /* terminator */
  122. };