Skip to content

Commit

Permalink
ASoC: topology: ABI - Add the types for BE DAI
Browse files Browse the repository at this point in the history
Define the type and ABI struct for Backend DAIs. Add the number of BE DAIs
to manifest, and some reserved fields for future extensions.

Pump the version number to 5.

Topology core will check size of ABI objects to detect version mismatch
between user space and kernel.

Signed-off-by: Guneshwor Singh <[email protected]>
Signed-off-by: Mengdong Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
mengdonglin authored and broonie committed Aug 8, 2016
1 parent 29b4817 commit dc31e74
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions include/uapi/sound/asoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#define SND_SOC_TPLG_NUM_TEXTS 16

/* ABI version */
#define SND_SOC_TPLG_ABI_VERSION 0x4
#define SND_SOC_TPLG_ABI_VERSION 0x5

/* Max size of TLV data */
#define SND_SOC_TPLG_TLV_SIZE 32
Expand All @@ -105,7 +105,8 @@
#define SND_SOC_TPLG_TYPE_CODEC_LINK 9
#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
#define SND_SOC_TPLG_TYPE_PDATA 11
#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_PDATA
#define SND_SOC_TPLG_TYPE_BE_DAI 12
#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_BE_DAI

/* vendor block IDs - please add new vendor types to end */
#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000
Expand All @@ -124,6 +125,11 @@
#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5

/* BE DAI flags */
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0)
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)

/*
* Block Header.
* This header precedes all object and object arrays below.
Expand Down Expand Up @@ -285,6 +291,8 @@ struct snd_soc_tplg_manifest {
__le32 graph_elems; /* number of graph elements */
__le32 pcm_elems; /* number of PCM elements */
__le32 dai_link_elems; /* number of DAI link elements */
__le32 be_dai_elems; /* number of BE DAI elements */
__le32 reserved[20]; /* reserved for new ABI element types */
struct snd_soc_tplg_private priv;
} __attribute__((packed));

Expand Down Expand Up @@ -450,4 +458,26 @@ struct snd_soc_tplg_link_config {
struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
__le32 num_streams; /* number of streams */
} __attribute__((packed));

/*
* Describes SW/FW specific features of BE DAI.
*
* File block representation for BE DAI :-
* +-----------------------------------+-----+
* | struct snd_soc_tplg_hdr | 1 |
* +-----------------------------------+-----+
* | struct snd_soc_tplg_be_dai | N |
* +-----------------------------------+-----+
*/
struct snd_soc_tplg_be_dai {
__le32 size; /* in bytes of this structure */
char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */
__le32 dai_id; /* unique ID - used to match */
__le32 playback; /* supports playback mode */
__le32 capture; /* supports capture mode */
struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */
__le32 flag_mask; /* bitmask of flags to configure */
__le32 flags; /* SND_SOC_TPLG_DAI_FLGBIT_* */
struct snd_soc_tplg_private priv;
} __attribute__((packed));
#endif

0 comments on commit dc31e74

Please sign in to comment.