patch-2.3.99-pre1 linux/drivers/sound/sound_core.c

Next file: linux/drivers/sound/sound_firmware.c
Previous file: linux/drivers/sound/sb_card.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.51/linux/drivers/sound/sound_core.c linux/drivers/sound/sound_core.c
@@ -217,6 +217,16 @@
 
 static struct sound_unit *chains[16];
 
+/**
+ *	register_sound_special
+ *	@fops: File operations for the driver
+ *	@unit: Unit number to allocate
+ *
+ *	Allocate a special sound device by minor number from the sound
+ *	subsystem. The allocated number is returned on succes. On failure
+ *	a negative error code is returned.
+ */
+ 
 int register_sound_special(struct file_operations *fops, int unit)
 {
 	char *name;
@@ -240,8 +250,8 @@
 	    case 5:
 		name = "unknown5";
 		break;
-	    case 6:
-		name = "sndstat";
+	    case 6:		/* Was once sndstat */
+		name = "unknown6";
 		break;
 	    case 7:
 		name = "unknown7";
@@ -272,23 +282,43 @@
 		break;
 	}
 	return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1,
-				 name, S_IRUGO | S_IWUGO);
+				 name, S_IRUSR | S_IWUSR);
 }
  
 EXPORT_SYMBOL(register_sound_special);
 
+/**
+ *	register_sound_mixer
+ *	@fops: File operations for the driver
+ *	@dev: Unit number to allocate
+ *
+ *	Allocate a mixer device. Unit is the number of the mixer requested.
+ *	Pass -1 to request the next free mixer unit. On success the allocated
+ *	number is returned, on failure a negative error code is returned.
+ */
+
 int register_sound_mixer(struct file_operations *fops, int dev)
 {
 	return sound_insert_unit(&chains[0], fops, dev, 0, 128,
-				 "mixer", S_IRUGO | S_IWUGO);
+				 "mixer", S_IRUSR | S_IWUSR);
 }
 
 EXPORT_SYMBOL(register_sound_mixer);
 
+/**
+ *	register_sound_midi
+ *	@fops: File operations for the driver
+ *	@dev: Unit number to allocate
+ *
+ *	Allocate a midi device. Unit is the number of the midi device requested.
+ *	Pass -1 to request the next free midi unit. On success the allocated
+ *	number is returned, on failure a negative error code is returned.
+ */
+
 int register_sound_midi(struct file_operations *fops, int dev)
 {
 	return sound_insert_unit(&chains[2], fops, dev, 2, 130,
-				 "midi", S_IRUGO | S_IWUGO);
+				 "midi", S_IRUSR | S_IWUSR);
 }
 
 EXPORT_SYMBOL(register_sound_midi);
@@ -298,22 +328,55 @@
  *	in open - see below.
  */
  
+/**
+ *	register_sound_dsp
+ *	@fops: File operations for the driver
+ *	@dev: Unit number to allocate
+ *
+ *	Allocate a DSP device. Unit is the number of the DSP requested.
+ *	Pass -1 to request the next free DSP unit. On success the allocated
+ *	number is returned, on failure a negative error code is returned.
+ *
+ *	This function allocates both the audio and dsp device entries together
+ *	and will always allocate them as a matching pair - eg dsp3/audio3
+ */
+
 int register_sound_dsp(struct file_operations *fops, int dev)
 {
 	return sound_insert_unit(&chains[3], fops, dev, 3, 131,
-				 "dsp", S_IWUGO | S_IRUSR | S_IRGRP);
+				 "dsp", S_IWUSR | S_IRUSR);
 }
 
 EXPORT_SYMBOL(register_sound_dsp);
 
+/**
+ *	register_sound_synth
+ *	@fops: File operations for the driver
+ *	@dev: Unit number to allocate
+ *
+ *	Allocate a synth device. Unit is the number of the synth device requested.
+ *	Pass -1 to request the next free synth unit. On success the allocated
+ *	number is returned, on failure a negative error code is returned.
+ */
+
+
 int register_sound_synth(struct file_operations *fops, int dev)
 {
 	return sound_insert_unit(&chains[9], fops, dev, 9, 137,
-				 "synth", S_IRUGO | S_IWUGO);
+				 "synth", S_IRUSR | S_IWUSR);
 }
 
 EXPORT_SYMBOL(register_sound_synth);
 
+/**
+ *	unregister_sound_special
+ *	@unit: Unit number to allocate
+ *
+ *	Release a sound device that was allocated with register_sound_special.
+ *	The unit passed is the return value from the register function.
+ */
+
+
 void unregister_sound_special(int unit)
 {
 	sound_remove_unit(&chains[unit&15], unit);
@@ -321,6 +384,14 @@
  
 EXPORT_SYMBOL(unregister_sound_special);
 
+/**
+ *	unregister_sound_mixer
+ *	@unit: Unit number to allocate
+ *
+ *	Release a sound device that was allocated with register_sound_mixer.
+ *	The unit passed is the return value from the register function.
+ */
+
 void unregister_sound_mixer(int unit)
 {
 	sound_remove_unit(&chains[0], unit);
@@ -328,6 +399,14 @@
 
 EXPORT_SYMBOL(unregister_sound_mixer);
 
+/**
+ *	unregister_sound_midi
+ *	@unit: Unit number to allocate
+ *
+ *	Release a sound device that was allocated with register_sound_midi.
+ *	The unit passed is the return value from the register function.
+ */
+
 void unregister_sound_midi(int unit)
 {
 	return sound_remove_unit(&chains[2], unit);
@@ -335,12 +414,31 @@
 
 EXPORT_SYMBOL(unregister_sound_midi);
 
+/**
+ *	unregister_sound_dsp
+ *	@unit: Unit number to allocate
+ *
+ *	Release a sound device that was allocated with register_sound_dsp.
+ *	The unit passed is the return value from the register function.
+ *
+ *	Both of the allocated units are released together automatically.
+ */
+
 void unregister_sound_dsp(int unit)
 {
 	return sound_remove_unit(&chains[3], unit);
 }
 
+
 EXPORT_SYMBOL(unregister_sound_dsp);
+
+/**
+ *	unregister_sound_synth
+ *	@unit: Unit number to allocate
+ *
+ *	Release a sound device that was allocated with register_sound_synth.
+ *	The unit passed is the return value from the register function.
+ */
 
 void unregister_sound_synth(int unit)
 {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)