History

ALSA: core api: define offsets for TLV items

Currently, there are no pre-defined accessors for the elements in topology TLV data. In the absence of such offsets, the tlv data will have to be decoded using hardwired offset numbers 0-N depending on the type of TLV. This patch defines accessor offsets for the type, length, min and mute/step items in TLV data for DB_SCALE type tlv's. These will be used by drivers to decode the TLV data while loading topology thereby improving code readability. The type and len offsets are common for all TLV types. The min and step/mute offsets are specific to DB_SCALE tlv type.

Ranjani Sridharan committed 8 years ago

Commit 08f9f441 parent 47cdf761 file · +8 −0Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/sound/tlv.h+8−0
@@ -42,6 +42,10 @@ · 41 unmodified lines
4242 #define SNDRV_CTL_TLVD_LENGTH(...) \
4343 ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
4444
45+/* Accessor offsets for TLV data items */
46+#define SNDRV_CTL_TLVO_TYPE 0
47+#define SNDRV_CTL_TLVO_LEN 1
48+
4549 #define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \
4650 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
4751 #define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \
@@ -61,6 +65,10 @@ · 13 unmodified lines
6165 SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
6266 }
6367
68+/* Accessor offsets for min, mute and step items in dB scale type TLV */
69+#define SNDRV_CTL_TLVO_DB_SCALE_MIN 2
70+#define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP 3
71+
6472 /* dB scale specified with min/max values instead of step */
6573 #define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
6674 SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t