From patchwork Wed Jun 15 14:57:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 9178755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67623604DB for ; Wed, 15 Jun 2016 15:03:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 559F627DA4 for ; Wed, 15 Jun 2016 15:03:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49CB427F17; Wed, 15 Jun 2016 15:03:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C63D527DA4 for ; Wed, 15 Jun 2016 15:03:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5838C266D9D; Wed, 15 Jun 2016 17:03:12 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 80995266BD4; Wed, 15 Jun 2016 16:58:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 44586266BCF; Wed, 15 Jun 2016 16:58:09 +0200 (CEST) Received: from smtp-proxy004.phy.lolipop.jp (smtp-proxy004.phy.lolipop.jp [157.7.104.45]) by alsa0.perex.cz (Postfix) with ESMTP id 23F80266B46 for ; Wed, 15 Jun 2016 16:57:53 +0200 (CEST) Received: from smtp-proxy004.phy.lolipop.lan (HELO smtp-proxy004.phy.lolipop.jp) (172.19.44.45) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp-proxy004.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Wed, 15 Jun 2016 23:57:49 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp-proxy004.phy.lolipop.jp (LOLIPOP-Fsecure); Wed, 15 Jun 2016 23:57:45 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 15 Jun 2016 23:57:44 +0900 Message-Id: <1466002665-30048-9-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466002665-30048-1-git-send-email-o-takashi@sakamocchi.jp> References: <1466002665-30048-1-git-send-email-o-takashi@sakamocchi.jp> Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sf.net Subject: [alsa-devel] [PATCH 8/9] ctl: improve API documentation for threshold level operations X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In alsa-lib, threshold level operations require an array of unsigned-int members, while there's little explanation about how to fill it. To usual developers such as me, they're quite hard to understand. This commit adds a few comment for easy understanding about how to use the APIs. Signed-off-by: Takashi Sakamoto --- src/control/control.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/control/control.c b/src/control/control.c index a1d7098..d515cff 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -882,14 +882,12 @@ static int snd_ctl_tlv_do(snd_ctl_t *ctl, int op_flag, return err; } - - /** - * \brief Get CTL element TLV value - * \param ctl CTL handle - * \param id CTL element id pointer - * \param tlv TLV array pointer to store - * \param tlv_size TLV array size in bytes + * \brief Set given data to an element as threshold level. + * \param ctl A handle of backend module for control interface. + * \param id ID of an element. + * \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 */ int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, @@ -913,10 +911,11 @@ int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, } /** - * \brief Set CTL element TLV value - * \param ctl CTL handle - * \param id CTL element id pointer - * \param tlv TLV array pointer to store + * \brief Set given data to an element as threshold level. + * \param ctl A handle of backend module for control interface. + * \param id ID of an element. + * \param tlv An array with members of unsigned int type. The second member + * must represent total bytes of the rest of array. * \retval 0 on success * \retval >0 on success when value was changed * \retval <0 a negative error code @@ -929,10 +928,11 @@ int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, } /** - * \brief Process CTL element TLV command - * \param ctl CTL handle - * \param id CTL element id pointer - * \param tlv TLV array pointer to process + * \brief Set given data to an element as threshold level. + * \param ctl A handle of backend module for control interface. + * \param id ID of an element. + * \param tlv An array with members of unsigned int type. The second member + * must represent total bytes of the rest of array. * \retval 0 on success * \retval >0 on success when value was changed * \retval <0 a negative error code