aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/sound/asoc.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-01ASoC: topology: Move v4 manifest header data structures to uapiGuenter Roeck1-0/+57
Topology manifest v4 is still part of the ABI. Move its data structures into the uapi header file. No functional change. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-16ASoC: topology: Add definitions for mclk_direction valuesKirill Marinushkin1-1/+5
Current comment makes not clear the direction of mclk. Previously, similar description caused a misunderstanding for bclk_master and fsync_master. This commit solves the potential confusion the same way it is solved for bclk_master and fsync_master. Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Mark Brown <broonie@kernel.org> Cc: Pan Xiuli <xiuli.pan@linux.intel.com> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-16ASoC: topology: Add missing clock gating parameter when parsing hw_configsKirill Marinushkin1-1/+6
Clock gating parameter is a part of `dai_fmt`. It is supported by `alsa-lib` when creating a topology binary file, but ignored by kernel when loading this topology file. After applying this commit, the clock gating parameter is not ignored any more. This solution is backwards compatible. The existing behaviour is not broken, because by default the parameter value is 0 and is ignored. snd_soc_tplg_hw_config.clock_gated = 0 => no effect snd_soc_tplg_hw_config.clock_gated = 1 => SND_SOC_DAIFMT_GATED snd_soc_tplg_hw_config.clock_gated = 2 => SND_SOC_DAIFMT_CONT For example, the following config, based on alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported: ~~~~ SectionHWConfig."CodecHWConfig" { id "1" format "I2S" # physical audio format. pm_gate_clocks "true" # clock can be gated } SectionLink."Codec" { # used for binding to the physical link id "0" hw_configs [ "CodecHWConfig" ] default_hw_conf_id "1" } ~~~~ Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Mark Brown <broonie@kernel.org> Cc: Pan Xiuli <xiuli.pan@linux.intel.com> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-16ASoC: topology: Fix bclk and fsync inversion in set_link_hw_format()Kirill Marinushkin1-2/+14
The values of bclk and fsync are inverted WRT the codec. But the existing solution already works for Broadwell, see the alsa-lib config: `alsa-lib/src/conf/topology/broadwell/broadwell.conf` This commit provides the backwards-compatible solution to fix this misuse. Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Pan Xiuli <xiuli.pan@linux.intel.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-02License cleanup: add SPDX license identifier to uapi header files with a licenseGreg Kroah-Hartman1-0/+1
Many user space API headers have licensing information, which is either incomplete, badly formatted or just a shorthand for referring to the license under which the file is supposed to be. This makes it hard for compliance tools to determine the correct license. Update these files with an SPDX license identifier. The identifier was chosen based on the license information in the file. GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license identifier with the added 'WITH Linux-syscall-note' exception, which is the officially assigned exception identifier for the kernel syscall exception: NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". This exception makes it possible to include GPL headers into non GPL code, without confusing license compliance tools. Headers which have either explicit dual licensing or are just licensed under a non GPL license are updated with the corresponding SPDX identifier and the GPLv2 with syscall exception identifier. The format is: ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE) SPDX license identifiers are a legally binding shorthand, which can be used instead of the full boiler plate text. The update does not remove existing license information as this has to be done on a case by case basis and the copyright holders might have to be consulted. This will happen in a separate step. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. See the previous patch in this series for the methodology of how this patch was researched. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-30ASoC: dapm: Add new widget type for constructing DAPM graphs on DSPs.Liam Girdwood1-1/+9
Add some DAPM widget types to better support the construction of DAPM graphs within DSPs. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-12Merge remote-tracking branches 'asoc/topic/tlv320aic31xx', 'asoc/topic/topology', 'asoc/topic/uda1380', 'asoc/topic/wm2200' and 'asoc/topic/wm8523' into asoc-nextMark Brown1-11/+79
2016-11-09ASoC: topology: ABI - Rename be_dai_elems to dai_elems in manifestMengdong Lin1-1/+1
User space uses this field to count physical DAIs, not only BE DAIs since users may not use DPCM. So we rename this field from be_dai_elems to dai_elems. This change is backward compatible, because it does not change the layout of the struct or data type. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-04ASoC: topology: ABI - Add voice wake up flag for DAI linksMengdong Lin1-0/+1
Add a new flag bit SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP to link flags. If a link is used for voice wake up, users can set this flag bit and topology will set the link's 'ignore_suspend' to true. This ABI update is backward compatible. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-04ASoC: topology: ABI - Rename struct and type for physical DAIsMengdong Lin1-7/+8
Rename the ABI struct and type because they are for configuring physical DAIs, not only backend DAIs since users may not need DPCM: - Rename struct snd_soc_tplg_be_dai to snd_soc_tplg_dai. - Rename type SND_SOC_TPLG_TYPE_BE_DAI to SND_SOC_TPLG_TYPE_DAI. This code refactoring is backward compatible because: - Both layout of the struct and type value has no change. Kernel can find the same type value and map to same data layout. - This struct is not in ABI v4 at all. Now the user space uses ABI v4. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-04ASoC: topology: ABI - Update physical DAI link configuration for version 5Mengdong Lin1-2/+44
The following fields are added to physical link configuration struct (snd_soc_tplg_link_config) in ABI v5: - name and stream name Topology will use them to find an existing physical link and configure it. - HW configurations Define the types and ABI struct for runtime supported hardware configs of physical DAI links, e.g. audio hardware formats. The default HW config ID will help topology to find the DAI format to set on init. Topology provides this as a fallback if such HW settings are not available in ACPI or device tree, to avoid hard code in drivers. It's only for config items that can be programmed by SW or FW, not for physical things like link connections or GPIO used for HP etc. - flags and private data The flags will be used to configure an existing physical DAI link. The private data is reserved for future extension. NOTE: Current kernel has no support for physical links. A later patch will add support for configuring physical links and make the support backward compatible for ABI v4. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-03ASoC: topology: ABI - Add flags and private data to PCMMengdong Lin1-0/+8
This is the remaining update to PCM ABI object of version 5. The flags will be applied to FE (Front End) links and can also be used by physical links. The private data is reserved for future extension, so offset update will add the private data size. Now user space is using ABI v4, and the previous patch "ASoC: topology: make PCM backward compatible from ABI v4" can assure the backward compatibility. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-03ASoC: topology: Support topology file of ABI v4Mengdong Lin1-1/+2
Users start to use topology ABI from v4. ABI v5 updated existing manifest and PCM elements. Two previous patches can support these ABI updates in a backward compatible way. So if the topology file from user space is generated by ABI v4, kernel will no longer quit but continue parsing. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-21ASoC: topology: ABI - Define DAI physical PCM data formatsMengdong Lin1-0/+15
Define DAI physical PCM data formats for user space, so users can configure the formats of backends by topology (e.g. the DAI format to set on backend link init). The kernel will also refer to these formats. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-11ASoC: topology: Reenable use from userspaceMark Brown1-6/+0
We had inserted a #error into the topology UAPI code to ensure that the ABI was not adopted by userspace while final review and testing was ongoing. The idea was that some finishing touches would be made to the ABI before declaring it stable and suitable for use in production but this has not yet happened as more than a year later revisions to the ABI are still onging. The reality however is that people are shipping topology files in production and these ABI changes are causing practical issues for users and we can't break userspace. This makes this error pointless so we should remove it. Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Vinod Koul <vinod.koul@intel.com>
2016-08-22ASoC: topology: ABI - Add sig_bits to stream capsMengdong Lin1-0/+1
Kernel struct snd_soc_pcm_stream, SoC PCM stream information, needs this field. Although current topology users don't configure this, we define it for future extension. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: topology: ABI - Add the types for BE DAIMengdong Lin1-2/+32
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 <guneshwor.o.singh@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-20ASoC: topology: Set the link ID when creating a FE DAI linkMengdong Lin1-1/+1
Topology will set the link's generic id when creating a FE link. Device drivers can check the id for link specific initialization. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-29ASoC: topology: ABI - Define types for vendor tuplesMengdong Lin1-1/+41
Tuples, a pair of token and value, can be used to define vendor specific data, for controls and widgets. This can avoid importing binary data blob from other files. Vendor specific tuple arrays will be embeded in the private data buffer of a control or widget object. To be backward compatible, union is used to define the tuple arrays in the existing private data ABI object 'struct snd_soc_tplg_private'. Vendors need to make sure the token values defined by the topology conf file match those defined by their driver. Now supported tuple types are uuid, string, bool, byte, short and word. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: topology: ABI - Rename dai_elems to pcm_elems in manifestMengdong Lin1-1/+1
This field is the number of PCM objects (a pair of FE DAI and DAI link). Signed-off-by: Lin Mengdong <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Remove tdm_slot & dai_fmt from snd_soc_tplg_streamMengdong Lin1-2/+0
These two fields are line parameters for BE/CC links and should not be from toplogy but from ACPI. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Add configuration for BE & Codec-Codec DAI LinksVedang Patel1-0/+17
struct snd_soc_tplg_link_config is defined to configure BE & CC links. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Add the type for BE DAI linkVedang Patel1-1/+2
Define the topology type for BE DAI link: SND_SOC_TPLG_TYPE_BACKEND_LINK. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Change stream formats to a bitwise flagMengdong Lin1-1/+1
The toplogy user space tool will generate this bitwise flag by using SNDRV_PCM_FORMAT_* exposed by asound.h, and the topology core will copy this flag when generating DAI streams. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Add name element to snd_soc_tplg_streamVedang Patel1-0/+1
For codec-codec links, this struct will be mapped to the DAI links's params, which is struct snd_soc_pcm_stream and it needs a stream name. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Use __le32 instead of __u32 in snd_soc_tplg_dapm_widgetVedang Patel1-5/+5
This fixes the endianness of the ABI parameters in the struct. The field 'num_kcontrols' is also extended from 16 bits to 32 bits. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Remove unused struct snd_soc_tplg_stream_configVedang Patel1-10/+0
The struct snd_soc_tplg_stream_config is no longer used in the ABI. We are using snd_soc_tplg_stream instead. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: topology: ABI - Add PCM Support and bump ABI version to 4Vedang Patel1-16/+15
The struct snd_soc_tplg_pcm_dai is renamed to snd_soc_tplg_pcm. This struct will now be used to handle data related to PCMs (FE DAI & DAI links). It's not for BE, because BE DAI mappings will be provided by ACPI/FDT data. Remove the unused struct snd_soc_tplg_pcm_cfg_caps. We are using snd_soc_tplg_stream and snd_soc_stream_caps instead. Bump ABI version to 4. Signed-off-by: Vedang Patel <vedang.patel@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-19Merge tag 'asoc-v4.2-disable-topology' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai1-0/+6
ASoC: Disable topology support for v4.2 The topology code merged in the v4.2 merge window introduced a new ABI which was believed to be suitable for use but subsequently additional work by the developers of this feature have revealed some problems that need to be addressed. In order to allow this to be done without having to support the initial ABI add Kconfig to disable the build and also add some #error statements to the UAPI header so users can't use them.
2015-08-18ASoC: topology: Disable use from userspaceMark Brown1-0/+6
Since the topology API is still in sufficient flux for changes to be identified disable the use of the userspace ABI by adding #error statements to the code, ensuring that nobody relies on the headers as currently defined. It is expected that this change will be reverted for v4.3. Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-06ASoC: topology: Add private data type and bump ABI version to 3Liam Girdwood1-2/+3
Add ID for standalone private data object types and bump ABI version to 3 in order to userpsace features. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-06ASoC: topology: Add ops support to byte controls UAPIMengdong Lin1-3/+6
Add UAPI support for setting byte control ops. Rename the ops structure to be more generic so it can be sued by other objects too. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-06ASoC: topology: Update TLV support so we can support more TLV typesMengdong Lin1-6/+13
Currently the TLV topology structure is targeted at only supporting the DB scale data. This patch extends support for the other TLV types so they can be easily added at a later stage. TLV structure is moved to common topology control header since it's a common field for controls and can be processed in a general way. Users must set a proper access flag for a control since it's used to decide if the TLV field is valid and if a TLV callback is needed. Removed the following fields from topology TLV struct: - size/count: type can decide the size. - numid: not needed to initialize TLV for kcontrol. - data: replaced by the type specific struct. Added TLV structure to generic control header and removed TLV structure from mixer control. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-06Merge tag 'asoc-fix-v4.2-rc3' into asoc-fix-topologyMark Brown1-2/+2
ASoC: Fixes for v4.2 A lot of small fixes here, a few to the core: - Fix for binding DAPM stream widgets on devices with prefixes assigned to them - Minor fixes for the newly added topology interfaces - Locking and memory leak fixes for DAPM - Driver specific fixes
2015-08-06ASoC: topology: add private data to manifestVinod Koul1-0/+1
The topology file manifest should include a private data field. This allows vendors to specify vendor data in the manifest, like timestamps, hashes, additional information for removing platform configuration out of drivers and making these configurable per platform Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-06ASoC: topology: Add subsequence in topologySubhransu S. Prusty1-0/+1
Some widgets may need sorting within, So add this support in topology. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-02ASoC: topology: fix typos in topology headerVinod Koul1-2/+2
Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-03ASoC: topology: Add topology UAPI headerLiam Girdwood1-0/+388
The ASoC topology UAPI header defines the structures required to define any DSP firmware audio topology and control objects from userspace. The following objects are supported :- o kcontrols including TLV controls. o DAPM widgets and graph elements o Vendor bespoke objects. o Coefficient data o FE PCM capabilities and config. o BE link capabilities and config. o Codec <-> codec link capabilities and config. o Topology object manifest. The file format is simple and divided into blocks for each object type and each block has a header that defines it's size and type. Blocks can be in any order of type and can either all be in a single file or spread across more than one file. Blocks also have a group identifier ID so that they can be loaded and unloaded by ID. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>