summaryrefslogtreecommitdiffstats
path: root/include/sound/tlv.h
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: control: cage TLV_DB_RANGE_HEAD in kernel land because it was obsoletedTakashi Sakamoto2016-09-251-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit bf1d1c9b6179 ("ALSA: tlv: add DECLARE_TLV_DB_RANGE()"), the new macro was added so that "dB range information can be specified without having to count the items manually for TLV_DB_RANGE_HEAD()". In short, TLV_DB_RANGE_HEAD macro was obsoleted. In commit 46e860f76804 ("ALSA: rename TLV-related macros so that they're friendly to user applications"), TLV-related macros are exposed for applications in user land to get content of data structured by Type/Length/Value shape. The commit managed to expose TLV-related macros as many as possible, while obsoleted TLV_DB_RANGE_HEAD() was included to the list of exposed macros. This situation brings some confusions to application developers because they might think all exposed macros have their own purpose and useful for applications. For the reason, this commit moves TLV_DB_RANGE_HEAD macro from UAPI header to a header for kernel land, again. The above commit is done within the same development period for kernel 4.9, thus not published yet. This commit might certainly brings no confusions to user land. Reference: commit bf1d1c9b6179 ("ALSA: tlv: add DECLARE_TLV_DB_RANGE()") Reference: commit 46e860f76804 ("ALSA: rename TLV-related macros so that they're friendly to user applications") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: rename TLV-related macros so that they're friendly to user applicationsTakashi Sakamoto2016-09-151-0/+26
| | | | | | | | | | | | | In a previous commit, some macros newly appeared to UAPI header for TLV packet. These macros have short names and they easily bring name conflist to applications. The conflict can be avoided to rename them with a proper prefix. For this purpose, this commit renames these macros with prefix 'SNDRV_CTL_TLVD_'. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: control: move layout of TLV payload to UAPI headerTakashi Sakamoto2016-09-151-61/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ALSA control interface, each element set can have threshold level information. This information is transferred between drivers/applications, in a shape of tlv packet. The layout of this packet is defined in 'uapi/sound/asound.h' (struct snd_ctl_tlv): struct snd_ctl_tlv { unsigned int numid; unsigned int length; unsigned int tlv[0]; }; Data in the payload (struct snd_ctl_tlv.tlv) is expected to be filled according to our own protocol. This protocol is described in 'include/sound/tlv.h'. A layout of the payload is expected as: struct snd_ctl_tlv.tlv[0]: one of SNDRV_CTL_TLVT_XXX struct snd_ctl_tlv.tlv[1]: Length of data struct snd_ctl_tlv.tlv[2...]: data Unfortunately, the macro is not exported to user land yet, thus applications cannot get to know the protocol. Additionally, ALSA control core has a feature called as 'user-defined' element set. This allows applications to add/remove arbitrary element sets with elements to control devices. Elements in the element set can be operated by the same way as the ones added by in-kernel implementation. For threshold level information of 'user-defined' element set, applications need to register the information to an element set. However, as described above, layout of the payload is closed in kernel land. This is quite inconvenient, too. This commit moves the protocol to UAPI header for TLV. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: topology: Export ID types for TLV controls.Liam Girdwood2015-06-041-14/+1
| | | | | | | | | Make sure userspace can define TLV controls for topology using the correct type numbers and channel mappings. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ALSA: Add comment for control TLV APIDavid Henningsson2013-05-081-1/+5
| | | | | | | | Userspace is not meant to have to handle all strange dB ranges, so add a specification comment. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: PCM: channel mapping API implementationTakashi Iwai2012-09-061-0/+8
| | | | | | | | | | | | | | | | | | This patch implements the basic data types for the standard channel mapping API handling. - The definitions of the channel positions and the new TLV types are added in sound/asound.h and sound/tlv.h, so that they can be referred from user-space. - Introduced a new helper function snd_pcm_add_chmap_ctls() to create control elements representing the channel maps for each PCM (sub)stream. - Some standard pre-defined channel maps are provided for convenience. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: tlv: add DECLARE_TLV_DB_RANGE()Clemens Ladisch2012-07-161-0/+4
| | | | | | | | | Add a DECLARE_TLV_DB_RANGE() macro so that dB range information can be specified without having to count the items manually for TLV_DB_RANGE_HEAD(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: tlv: add DECLARE_TLV_CONTAINER()Clemens Ladisch2012-07-161-0/+5
| | | | | | | | Add the DECLARE_TLV_CONTAINER() macro to allow having static TLVs containing more than one item. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: tlv: compute TLV_*_ITEM lengths automaticallyClemens Ladisch2012-07-161-8/+12
| | | | | | | | | | Add helper macros with a little bit of preprocessor magic to automatically compute the length of a TLV item. This lets us avoid having to compute this by hand, and will allow to use items that do not use a fixed length. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: tlv - Define numbers in sound/tlv.hTakashi Iwai2010-10-171-1/+3
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add new TLV types for dBwith min/maxTakashi Iwai2009-06-171-0/+14
| | | | | | | | | | | Add new types for TLV dB scale specified with min/max values instead of min/step since the resolution can't match always with the one a device provides. For example, usb audio devices give 1/256 dB resolution while ALSA TLV is based on 1/100 dB resolution. The new min/max types have less problems because the possible rounding error happens only at min/max. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela2007-10-161-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] Add definition of TLV dB range compoundTakashi Iwai2006-09-231-8/+15
| | | | | | | | | Added the definition of TLV dB range compound. It contains one or more dB-range or linear-volume TLV entries with min/max ranges. Used for volume controls with non-linear curves. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] Add the definition of linear volume TLVTakashi Iwai2006-09-231-0/+10
| | | | | | | | Added the definition of linear volume TLV type. Some DSP chips and codecs (e.g. AK codec) use linear volume control. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] Control API - TLV implementation for additional information like dB scaleJaroslav Kysela2006-09-231-0/+43
This patch implements a TLV mechanism to transfer an additional information like dB scale to the user space. The types might be extended in future. Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>