Update of /cvsroot/alsa/alsa-kernel/pci/ac97
In directory sc8-pr-cvs1:/tmp/cvs-serv10822/pci/ac97

Modified Files:
        ac97_codec.c 
Log Message:
[PATCH: kerneldoc-comments.dif]

- added/corrected kernel-doc style comments.



Index: ac97_codec.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ac97_codec.c        7 Jan 2003 10:36:30 -0000       1.53
+++ ac97_codec.c        7 Jan 2003 12:27:46 -0000       1.54
@@ -239,6 +239,18 @@
        return 1;
 }
 
+/**
+ * snd_ac97_write - write a value on the given register
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @value: the value to set
+ *
+ * Writes a value on the given register.  This will invoke the write
+ * callback directly after the register check.
+ * This function doesn't change the register cache unlike
+ * #snd_ca97_write_cache(), so use this only when you don't want to
+ * reflect the change to the suspend/resume state.
+ */
 void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value)
 {
        if (!snd_ac97_valid_reg(ac97, reg))
@@ -246,6 +258,17 @@
        ac97->write(ac97, reg, value);
 }
 
+/**
+ * snd_ac97_read - read a value from the given register
+ * 
+ * @ac97: the ac97 instance
+ * @reg: the register to read
+ *
+ * Reads a value from the given register.  This will invoke the read
+ * callback directly after the register check.
+ *
+ * Returns the read value.
+ */
 unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)
 {
        if (!snd_ac97_valid_reg(ac97, reg))
@@ -253,6 +276,16 @@
        return ac97->read(ac97, reg);
 }
 
+/**
+ * snd_ac97_write_cache - write a value on the given register and update the cache
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @value: the value to set
+ *
+ * Writes a value on the given register and updates the register
+ * cache.  The cached values are used for the cached-read and the
+ * suspend/resume.
+ */
 void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value)
 {
        if (!snd_ac97_valid_reg(ac97, reg))
@@ -278,6 +311,18 @@
        snd_ac97_write_cache(ac97, reg, value);
 }
 
+/**
+ * snd_ac97_update - update the value on the given register
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @value: the value to set
+ *
+ * Compares the value with the register cache and updates the value
+ * only when the value is changed.
+ *
+ * Retruns 1 if the value is changed, 0 if no change, or a negative
+ * code on failure.
+ */
 int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value)
 {
        int change;
@@ -294,7 +339,7 @@
        return change;
 }
 
-int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg, unsigned short 
mask, unsigned short value)
+static int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg, unsigned 
+short mask, unsigned short value)
 {
        int change;
        unsigned short old, new;
@@ -311,6 +356,19 @@
        return change;
 }
 
+/**
+ * snd_ac97_update_bits - update the bits on the given register
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @mask: the bit-mask to change
+ * @value: the value to set
+ *
+ * Updates the masked-bits on the given register onle when the value
+ * is changed.
+ *
+ * Returns 1 if the bits are changed, 0 if no change, or a negative
+ * code on failure.
+ */
 int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, 
unsigned short value)
 {
        int change;
@@ -320,7 +378,7 @@
        return change;
 }
 
-int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short mask, 
unsigned short value)
+static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short 
+mask, unsigned short value)
 {
        int change;
        unsigned short old, new;
@@ -1693,6 +1751,32 @@
        sprintf(name + strlen(name), " (%x)", id & 0xff);
 }
 
+
+/**
+ * snd_ac97_mixer - create an AC97 codec component
+ * @card: the card instance
+ * @_ac97: the template of ac97, including index, callbacks and
+ *         the private data.
+ * @rac97: the pointer to store the new ac97 instance.
+ *
+ * Creates an AC97 codec component.  An ac97_t instance is newly
+ * allocated and initialized from the template (_ac97).  The codec
+ * is then initialized by the standard procedure.
+ *
+ * The template must include the valid callbacks (at least read and
+ * write), the codec number (num) and address (addr), and the private
+ * data (private_data).  The other callbacks, wait and reset, are not
+ * mandantory.
+ * 
+ * The clock is set to 48000.  If another clock is needed, reset
+ * ac97->clock manually afterwards.
+ *
+ * The ac97 instance is registered as a low-level device, so you don't
+ * have to release it manually.
+ *
+ * Returns zero if sucessful, or a negative error code on failure.
+ */
+
 int snd_ac97_mixer(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97)
 {
        int err;
@@ -1873,7 +1957,7 @@
 }
 
 /*
-
+ * proc interface
  */
 
 static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int 
subidx)
@@ -2149,6 +2233,23 @@
        return 0;
 }
 
+/**
+ * snd_ac97_set_rate - change the rate of the given input/output.
+ * @ac97: the ac97 instance
+ * @reg: the register to change
+ * @rate: the sample rate to set
+ *
+ * Changes the rate of the given input/output on the codec.
+ * If the codec doesn't support VAR, the rate must be 48000 (except
+ * for SPDIF).
+ *
+ * The valid registers are AC97_PMC_MIC_ADC_RATE,
+ * AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE and AC97_SPDIF.
+ * The SPDIF register is a pseudo-register to change the rate of SPDIF
+ * (only if supported).
+ *
+ * Returns zero if successful, or a negative error code on failure.
+ */
 int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate)
 {
        unsigned short mask;
@@ -2188,8 +2289,11 @@
 
 
 #ifdef CONFIG_PM
-/*
- * general suspend procedure
+/**
+ * snd_ac97_suspend - General suspend function for AC97 codec
+ * @ac97: the ac97 instance
+ *
+ * Suspends the codec, power down the chip.
  */
 void snd_ac97_suspend(ac97_t *ac97)
 {
@@ -2206,8 +2310,12 @@
        snd_ac97_write(ac97, AC97_POWERDOWN, power);
 }
 
-/*
- * general resume procedure
+/**
+ * snd_ac97_resume - General resume function for AC97 codec
+ * @ac97: the ac97 instance
+ *
+ * Do the standard resume procedure, power up and restoring the
+ * old register values.
  */
 void snd_ac97_resume(ac97_t *ac97)
 {



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to