Commit graph

22 commits

Author SHA1 Message Date
Mengdong Lin
4136d98606 topology: Parse and build private data for PCM
Users can define private for PCM (FE DAI & DAI links) elements by both
text conf file and C API:

- Text conf file may define multiple data blocks for a PCM and they will
  be merged in building phase;

- Add private data to C API template of PCM object.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-11-05 16:41:55 +01:00
Mengdong Lin
b398ed4058 topology: Parse flags for PCM
Users can define flags by both text conf file and C API.
Add flags and flag_mask to C API template of PCM object.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-11-05 16:41:53 +01:00
Mengdong Lin
f94ed5cf75 topology: Parse sig_bits of stream caps
Add sig_bits to stream caps template of C API and parse it.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-11-05 16:41:52 +01:00
Mengdong Lin
3a5341e2ac topology: Add doc for including other files in the text conf file
This patch adds document about how to include other files in the text
configuration files, by alsaconf syntax <xxx> and <searchdir:xxx>.

Users may define common info in separate files (e.g. vendor tokens,
tuples) and share them for different platforms, by including them via
syntax <path/to/configuration-file>. This can save the total size of
files. Users can also specifiy additional configuraiton directories
relative to "/usr/share/alsa/" to search the included files, via syntax
<searchdir:relative-path/to/usr/share/alsa>.

The alsaconf will search and open an included file in the following order
of priority:
1. directly open the file by its name;
2. search for the file name in "/usr/share/alsa";
3. search for the file name in user specified subdirectories under
   "/usr/share/alsa".

The order of the included files need not to be same as their dependencies,
because the toplogy library will load all of them before parsing their
dependencies.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-10-25 09:26:24 +02:00
Mengdong Lin
adb9866b70 topology: Fix missing stream name of widgets in text conf file
User can define the stream name of an input/output widget in the text conf
file, by setting "stream_name" of a SectionWidget.

Topology C API and kernel already have support for configuring a widget's
stream name. This patch just adds the missing part of the text conf file.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-10-25 09:24:28 +02:00
Mengdong Lin
962d006c28 topology: Tuple type can have an extenstion
After the type specific string ("uuid", "string", "byte", "short" and
"word"), users may append a string, like  "uuidxxx". The topology parser
will check the first few characters to get the tuple type.

This can allow users to put multiple tuples of the same type into one
vendor tuple section (SectionVendorTuples), e.g. parameters of multiple
firmware modules.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-17 10:00:28 +02:00
Mengdong Lin
a3683a2ba0 topology: Parse vendor private data for manifest
In text conf file, user can define a manifest section and let it refer
to private data sections, in the same syntax as other element types.

The text conf file can have at most 1 manifest section.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-17 10:00:17 +02:00
Mengdong Lin
62c180981b topology: Change uuid value to 16 separate characters in text conf file
Previously in text conf file, the uuid value of vendor tuples is a
16-characer string. Now change it to 16 characters separated by commas,
easier for users to edit it manually.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-17 10:00:04 +02:00
Mengdong Lin
bb03d929e8 topology: An element can refer to multipe data sections in text conf file
Previously in text conf file, an element can only refer to one data
section (SectionData). Now it can also refer to a list of data sections.
Thus users can split groups of firmware parameters to multiple data
sections, and put them all in the reference list.

Finally, data of these data sections will be merged, in the same order as
they are in the reference list, as the element's private data for kernel.

We still support the original syntax of reference to a single data
section. The doc is updated for the syntax extension.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-17 09:59:21 +02:00
Mengdong Lin
25d6f8e6a8 topology: Parse front-end DAI name and ID for the PCM
These two fields are necessary to create the front-end DAIs
in kernel but the support is missing in text conf previously.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-09 10:30:40 +02:00
Mengdong Lin
fdb9a6d19f topology: Add support for parsing vendor tuples
Vendor can define several tuple arrays in 'SectionVendorTuples', as
well as the reference to a vendor token list object.

A later patche will copy vendor tuples in ABI format to the private
buffer of its parent data object in the building phase.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-07 16:57:22 +02:00
Mengdong Lin
9b751b38cb topology: Add support for vendor tokens
Vendor can define a token list in SectionVendorTokens. Each token element
is a pair of string ID and integer value. And both the ID and value are
vendor-specific.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-07 16:57:22 +02:00
Mengdong Lin
2fd8d388f5 topology: Add doc for vendor tuples
Describe how to define vendor tokens and tuples in the text conf file.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-07 16:57:21 +02:00
Liam Girdwood
f5e0062258 topology: add support for CTL access flags to config file
Allow the config files to define CTL access flags.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-14 16:57:05 +01:00
Liam Girdwood
7eb683ee39 topology: remove little endian type from userspace header
Use a generic uint64_t for formats instead of an ABI endian specific
__le64 type.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-09 08:38:35 +01:00
Mengdong Lin
93b420b9e2 topology: Add C API support for PCM
PCM objects can be added by C API. And this is used to create FE DAIs
and DAI links in kernel.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2015-11-05 14:53:24 +01:00
Vedang Patel
2286a6fd4d topology: Add C API support for BE and CC Links.
Adding BE and CC Link support for C API reference. This will be used
to populate the .hw_params element for BE and .params for CC, enabling
us to update already existing DAI Links created by the kernel.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2015-11-05 14:53:24 +01:00
Mengdong Lin
8b0a5310bf topology: Add API to set a vendor specific version number
This vendor-specific version number is optional. It will be written to
the 'version' field of each block header of the binary toplogy data file.
The vendor driver can check this number for further processing in kernel.

The topology ABI version number is still stored in the 'abi' field of
block headers.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-23 10:45:52 +02:00
Mengdong Lin
5b518c9159 topology: A API calls to directly build topology data from templates
Add some new API calls so that applications can directly build topology data
using template structures.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-12 16:42:37 +02:00
Mengdong Lin
1b148ef590 topology: Add C templates structure for building topology from C programs
Define structures that can be used by applications to directly build topology
data instead of using text files. The application will build up the topology
data by populating the template structures for each object type and then
registering the template with the topology core.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-12 16:39:46 +02:00
Takashi Iwai
66ce9f9a11 topology: Fix typos
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 17:10:42 +02:00
Liam Girdwood
37692bb985 topology: Add topology core parser.
The topology core parses the high level topology file and calls the
individual object parsers when any new object element is detected at
the high level.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 16:21:48 +02:00