Topology Interface

Overview

// typedefs

typedef struct snd_tplg snd_tplg_t;

// enums

enum snd_tplg_type;

// structs

struct snd_tplg_bytes_template;
struct snd_tplg_channel_elem;
struct snd_tplg_channel_map_template;
struct snd_tplg_channel_template;
struct snd_tplg_ctl_template;
struct snd_tplg_dai_template;
struct snd_tplg_enum_template;
struct snd_tplg_graph_elem;
struct snd_tplg_graph_template;
struct snd_tplg_hw_config_template;
struct snd_tplg_io_ops_template;
struct snd_tplg_link_template;
struct snd_tplg_mixer_template;
struct snd_tplg_obj_template;
struct snd_tplg_obj_template_t;
struct snd_tplg_pcm_template;
struct snd_tplg_pdata_template;
struct snd_tplg_stream_caps_template;
struct snd_tplg_stream_template;
struct snd_tplg_tlv_dbscale_template;
struct snd_tplg_tlv_template;
struct snd_tplg_widget_template;

// global functions

snd_tplg_t*
snd_tplg_new(void);

void
snd_tplg_free(snd_tplg_t* tplg);

int
snd_tplg_build_file(
    snd_tplg_t* tplg,
    const char* infile,
    const char* outfile
);

void
snd_tplg_verbose(
    snd_tplg_t* tplg,
    int verbose
);

int
snd_tplg_add_object(
    snd_tplg_t* tplg,
    snd_tplg_obj_template_t* t
);

int
snd_tplg_build(
    snd_tplg_t* tplg,
    const char* outfile
);

int
snd_tplg_set_manifest_data(
    snd_tplg_t* tplg,
    const void* data,
    int len
);

int
snd_tplg_set_version(
    snd_tplg_t* tplg,
    unsigned int version
);

// macros

#define SND_TPLG_MAX_CHAN

Detailed Documentation

Typedefs

typedef struct snd_tplg snd_tplg_t

Topology context

Global Functions

snd_tplg_t*
snd_tplg_new(void)

Create a new topology parser instance.

Returns:

New topology parser instance

void
snd_tplg_free(snd_tplg_t* tplg)

Free a topology parser instance.

Parameters:

tplg Topology parser instance
int
snd_tplg_build_file(
    snd_tplg_t* tplg,
    const char* infile,
    const char* outfile
)

Parse and build topology text file into binary file.

Parameters:

tplg Topology instance.
infile Topology text input file to be parsed
outfile Binary topology output file.

Returns:

Zero on success, otherwise a negative error code

void
snd_tplg_verbose(
    snd_tplg_t* tplg,
    int verbose
)

Enable verbose reporting of binary file output.

Parameters:

tplg Topology Instance
verbose Enable verbose output level if non zero
int
snd_tplg_add_object(
    snd_tplg_t* tplg,
    snd_tplg_obj_template_t* t
)

Register topology template object.

Parameters:

tplg Topology instance.
t Template object.

Returns:

Zero on success, otherwise a negative error code

int
snd_tplg_build(
    snd_tplg_t* tplg,
    const char* outfile
)

Build all registered topology data into binary file.

Parameters:

tplg Topology instance.
outfile Binary topology output file.

Returns:

Zero on success, otherwise a negative error code

int
snd_tplg_set_manifest_data(
    snd_tplg_t* tplg,
    const void* data,
    int len
)

Attach private data to topology manifest.

Parameters:

tplg Topology instance.
data Private data.
len Length of data in bytes.

Returns:

Zero on success, otherwise a negative error code

int
snd_tplg_set_version(
    snd_tplg_t* tplg,
    unsigned int version
)

Set an optional vendor specific version number.

Parameters:

tplg Topology instance.
version Vendor specific version number.

Returns:

Zero on success, otherwise a negative error code

Macros

#define SND_TPLG_MAX_CHAN

Maximum number of channels supported in one control