OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../linux24/88-multiple-soundcard-fix.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2003 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. --- linux-2.4.17/drivers/sound/sound_core.c.orig Sun Jan 6 17:31:30 2002
  18. +++ linux/drivers/sound/sound_core.c Sun Jan 6 17:39:43 2002
  19. @@ -17,7 +17,7 @@
  20. * plug into this. The fact they dont all go via OSS doesn't mean
  21. * they don't have to implement the OSS API. There is a lot of logic
  22. * to keeping much of the OSS weight out of the code in a compatibility
  23. - * module, but its up to the driver to rember to load it...
  24. + * module, but it's up to the driver to remember to load it...
  25. *
  26. * The code provides a set of functions for registration of devices
  27. * by type. This is done rather than providing a single call so that
  28. @@ -173,10 +173,10 @@
  29. return r;
  30. }
  31. - if (r == low)
  32. + if ( r < SOUND_STEP )
  33. sprintf (name_buf, "%s", name);
  34. else
  35. - sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP);
  36. + sprintf (name_buf, "%s%d", name, (r / SOUND_STEP));
  37. s->de = devfs_register (devfs_handle, name_buf,
  38. DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
  39. S_IFCHR | mode, fops, NULL);
  40. @@ -231,17 +231,20 @@
  41. int register_sound_special(struct file_operations *fops, int unit)
  42. {
  43. - char *name;
  44. + const int chain = (unit & 0x0F);
  45. + int max_unit = chain + 128;
  46. + const char *name;
  47. - switch (unit) {
  48. + switch (chain) {
  49. case 0:
  50. name = "mixer";
  51. break;
  52. case 1:
  53. name = "sequencer";
  54. + max_unit = unit + 1;
  55. break;
  56. case 2:
  57. - name = "midi00";
  58. + name = "midi";
  59. break;
  60. case 3:
  61. name = "dsp";
  62. @@ -260,6 +263,7 @@
  63. break;
  64. case 8:
  65. name = "sequencer2";
  66. + max_unit = unit + 1;
  67. break;
  68. case 9:
  69. name = "dmmidi";
  70. @@ -280,10 +284,10 @@
  71. name = "admmidi";
  72. break;
  73. default:
  74. - name = "unknown";
  75. + name = "unknownX";
  76. break;
  77. }
  78. - return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1,
  79. + return sound_insert_unit(&chains[chain], fops, -1, unit, max_unit,
  80. name, S_IRUSR | S_IWUSR);
  81. }