[alsa-devel] [PATCH 4/4] ctl: improve documentation about TLV-related APIs

Takashi Sakamoto o-takashi at sakamocchi.jp
Sat Sep 17 16:49:28 CEST 2016


The documentation gives no hints to users about content of threshold level
information.

This commit add hints to parse the information.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 src/control/control.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/control/control.c b/src/control/control.c
index 383f401..7165222 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -918,6 +918,11 @@ static int snd_ctl_tlv_do(snd_ctl_t *ctl, int op_flag,
  * \param tlv An array with members of unsigned int type.
  * \param tlv_size The length of the array.
  * \return 0 on success otherwise a negative error code
+ *
+ * The format of an array of \a tlv argument is:
+ *   tlv[0]: Data type. One of SND_CTL_TLVT_XXX.
+ *   tlv[1]: Lengh of data in units of byte.
+ *   tlv[2..]: Data. Details are described in <sound/tlv.h>.
  */
 int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
 			  unsigned int *tlv, unsigned int tlv_size)
@@ -948,6 +953,11 @@ int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
  * \retval 0 on success
  * \retval >0 on success when value was changed
  * \retval <0 a negative error code
+ *
+ * The format of an array of \a tlv argument is:
+ *   tlv[0]: Data type. One of SND_CTL_TLVT_XXX.
+ *   tlv[1]: Lengh of data in units of byte.
+ *   tlv[2..]: Data. Details are described in <sound/tlv.h>.
  */
 int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
 			   const unsigned int *tlv)
@@ -965,6 +975,11 @@ int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
  * \retval 0 on success
  * \retval >0 on success when value was changed
  * \retval <0 a negative error code
+ *
+ * The format of an array of \a tlv argument is:
+ *   tlv[0]: Data type. One of SND_CTL_TLVT_XXX.
+ *   tlv[1]: Lengh of data in units of byte.
+ *   tlv[2..]: Data. Details are described in <sound/tlv.h>.
  */
 int snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
 			     const unsigned int *tlv)
-- 
2.7.4



More information about the Alsa-devel mailing list