18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * uapi/sound/asoc.h -- ALSA SoC Firmware Controls and DAPM 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Texas Instruments Inc. 68c2ecf20Sopenharmony_ci * Copyright (C) 2015 Intel Corporation. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 98c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as 108c2ecf20Sopenharmony_ci * published by the Free Software Foundation. 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * Simple file API to load FW that includes mixers, coefficients, DAPM graphs, 138c2ecf20Sopenharmony_ci * algorithms, equalisers, DAIs, widgets etc. 148c2ecf20Sopenharmony_ci*/ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#ifndef __LINUX_UAPI_SND_ASOC_H 178c2ecf20Sopenharmony_ci#define __LINUX_UAPI_SND_ASOC_H 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#include <linux/types.h> 208c2ecf20Sopenharmony_ci#include <sound/asound.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci/* 238c2ecf20Sopenharmony_ci * Maximum number of channels topology kcontrol can represent. 248c2ecf20Sopenharmony_ci */ 258c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_MAX_CHAN 8 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* 288c2ecf20Sopenharmony_ci * Maximum number of PCM formats capability 298c2ecf20Sopenharmony_ci */ 308c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_MAX_FORMATS 16 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* 338c2ecf20Sopenharmony_ci * Maximum number of PCM stream configs 348c2ecf20Sopenharmony_ci */ 358c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_STREAM_CONFIG_MAX 8 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* 388c2ecf20Sopenharmony_ci * Maximum number of physical link's hardware configs 398c2ecf20Sopenharmony_ci */ 408c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_HW_CONFIG_MAX 8 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/* individual kcontrol info types - can be mixed with other types */ 438c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_VOLSW 1 448c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_VOLSW_SX 2 458c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_VOLSW_XR_SX 3 468c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_ENUM 4 478c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_BYTES 5 488c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_ENUM_VALUE 6 498c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_RANGE 7 508c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_CTL_STROBE 8 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci/* individual widget kcontrol info types - can be mixed with other types */ 548c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_CTL_VOLSW 64 558c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE 65 568c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT 66 578c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE 67 588c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_CTL_PIN 68 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci/* DAPM widget types - add new items to the end */ 618c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_INPUT 0 628c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_OUTPUT 1 638c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_MUX 2 648c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_MIXER 3 658c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_PGA 4 668c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_OUT_DRV 5 678c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_ADC 6 688c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_DAC 7 698c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_SWITCH 8 708c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_PRE 9 718c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_POST 10 728c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_AIF_IN 11 738c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_AIF_OUT 12 748c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_DAI_IN 13 758c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_DAI_OUT 14 768c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_DAI_LINK 15 778c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_BUFFER 16 788c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_SCHEDULER 17 798c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_EFFECT 18 808c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_SIGGEN 19 818c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_SRC 20 828c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_ASRC 21 838c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_ENCODER 22 848c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_DECODER 23 858c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAPM_LAST SND_SOC_TPLG_DAPM_DECODER 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci/* Header magic number and string sizes */ 888c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_MAGIC 0x41536F43 /* ASoC */ 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci/* string sizes */ 918c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_NUM_TEXTS 16 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci/* ABI version */ 948c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */ 958c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */ 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci/* Max size of TLV data */ 988c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TLV_SIZE 32 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci/* 1018c2ecf20Sopenharmony_ci * File and Block header data types. 1028c2ecf20Sopenharmony_ci * Add new generic and vendor types to end of list. 1038c2ecf20Sopenharmony_ci * Generic types are handled by the core whilst vendors types are passed 1048c2ecf20Sopenharmony_ci * to the component drivers for handling. 1058c2ecf20Sopenharmony_ci */ 1068c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_MIXER 1 1078c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_BYTES 2 1088c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_ENUM 3 1098c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_DAPM_GRAPH 4 1108c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_DAPM_WIDGET 5 1118c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_DAI_LINK 6 1128c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_PCM 7 1138c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_MANIFEST 8 1148c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_CODEC_LINK 9 1158c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10 1168c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_PDATA 11 1178c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_DAI 12 1188c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_DAI 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci/* vendor block IDs - please add new vendor types to end */ 1218c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_VENDOR_FW 1000 1228c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_VENDOR_CONFIG 1001 1238c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPE_VENDOR_COEFF 1002 1248c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TYPEVENDOR_CODEC 1003 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_STREAM_PLAYBACK 0 1278c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_STREAM_CAPTURE 1 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci/* vendor tuple types */ 1308c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_UUID 0 1318c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_STRING 1 1328c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2 1338c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3 1348c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4 1358c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci/* DAI flags */ 1388c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_RATES (1 << 0) 1398c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) 1408c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci/* DAI clock gating */ 1438c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0 1448c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1 1458c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci/* DAI mclk_direction */ 1488c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_MCLK_CO 0 /* for codec, mclk is output */ 1498c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_MCLK_CI 1 /* for codec, mclk is input */ 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci/* DAI physical PCM data formats. 1528c2ecf20Sopenharmony_ci * Add new formats to the end of the list. 1538c2ecf20Sopenharmony_ci */ 1548c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_I2S 1 /* I2S mode */ 1558c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_RIGHT_J 2 /* Right Justified mode */ 1568c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_LEFT_J 3 /* Left Justified mode */ 1578c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_DSP_A 4 /* L data MSB after FRM LRC */ 1588c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_DSP_B 5 /* L data MSB during FRM LRC */ 1598c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_AC97 6 /* AC97 */ 1608c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_PDM 7 /* Pulse density modulation */ 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci/* left and right justified also known as MSB and LSB respectively */ 1638c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_MSB SND_SOC_DAI_FORMAT_LEFT_J 1648c2ecf20Sopenharmony_ci#define SND_SOC_DAI_FORMAT_LSB SND_SOC_DAI_FORMAT_RIGHT_J 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci/* DAI link flags */ 1678c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_RATES (1 << 0) 1688c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) 1698c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) 1708c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3) 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci/* DAI topology BCLK parameter 1738c2ecf20Sopenharmony_ci * For the backwards capability, by default codec is bclk master 1748c2ecf20Sopenharmony_ci */ 1758c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_BCLK_CM 0 /* codec is bclk master */ 1768c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */ 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci/* DAI topology FSYNC parameter 1798c2ecf20Sopenharmony_ci * For the backwards capability, by default codec is fsync master 1808c2ecf20Sopenharmony_ci */ 1818c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_FSYNC_CM 0 /* codec is fsync master */ 1828c2ecf20Sopenharmony_ci#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */ 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci/* 1858c2ecf20Sopenharmony_ci * Block Header. 1868c2ecf20Sopenharmony_ci * This header precedes all object and object arrays below. 1878c2ecf20Sopenharmony_ci */ 1888c2ecf20Sopenharmony_cistruct snd_soc_tplg_hdr { 1898c2ecf20Sopenharmony_ci __le32 magic; /* magic number */ 1908c2ecf20Sopenharmony_ci __le32 abi; /* ABI version */ 1918c2ecf20Sopenharmony_ci __le32 version; /* optional vendor specific version details */ 1928c2ecf20Sopenharmony_ci __le32 type; /* SND_SOC_TPLG_TYPE_ */ 1938c2ecf20Sopenharmony_ci __le32 size; /* size of this structure */ 1948c2ecf20Sopenharmony_ci __le32 vendor_type; /* optional vendor specific type info */ 1958c2ecf20Sopenharmony_ci __le32 payload_size; /* data bytes, excluding this header */ 1968c2ecf20Sopenharmony_ci __le32 index; /* identifier for block */ 1978c2ecf20Sopenharmony_ci __le32 count; /* number of elements in block */ 1988c2ecf20Sopenharmony_ci} __attribute__((packed)); 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci/* vendor tuple for uuid */ 2018c2ecf20Sopenharmony_cistruct snd_soc_tplg_vendor_uuid_elem { 2028c2ecf20Sopenharmony_ci __le32 token; 2038c2ecf20Sopenharmony_ci char uuid[16]; 2048c2ecf20Sopenharmony_ci} __attribute__((packed)); 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ci/* vendor tuple for a bool/byte/short/word value */ 2078c2ecf20Sopenharmony_cistruct snd_soc_tplg_vendor_value_elem { 2088c2ecf20Sopenharmony_ci __le32 token; 2098c2ecf20Sopenharmony_ci __le32 value; 2108c2ecf20Sopenharmony_ci} __attribute__((packed)); 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci/* vendor tuple for string */ 2138c2ecf20Sopenharmony_cistruct snd_soc_tplg_vendor_string_elem { 2148c2ecf20Sopenharmony_ci __le32 token; 2158c2ecf20Sopenharmony_ci char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2168c2ecf20Sopenharmony_ci} __attribute__((packed)); 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_cistruct snd_soc_tplg_vendor_array { 2198c2ecf20Sopenharmony_ci __le32 size; /* size in bytes of the array, including all elements */ 2208c2ecf20Sopenharmony_ci __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */ 2218c2ecf20Sopenharmony_ci __le32 num_elems; /* number of elements in array */ 2228c2ecf20Sopenharmony_ci union { 2238c2ecf20Sopenharmony_ci struct snd_soc_tplg_vendor_uuid_elem uuid[0]; 2248c2ecf20Sopenharmony_ci struct snd_soc_tplg_vendor_value_elem value[0]; 2258c2ecf20Sopenharmony_ci struct snd_soc_tplg_vendor_string_elem string[0]; 2268c2ecf20Sopenharmony_ci }; 2278c2ecf20Sopenharmony_ci} __attribute__((packed)); 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/* 2308c2ecf20Sopenharmony_ci * Private data. 2318c2ecf20Sopenharmony_ci * All topology objects may have private data that can be used by the driver or 2328c2ecf20Sopenharmony_ci * firmware. Core will ignore this data. 2338c2ecf20Sopenharmony_ci */ 2348c2ecf20Sopenharmony_cistruct snd_soc_tplg_private { 2358c2ecf20Sopenharmony_ci __le32 size; /* in bytes of private data */ 2368c2ecf20Sopenharmony_ci union { 2378c2ecf20Sopenharmony_ci char data[0]; 2388c2ecf20Sopenharmony_ci struct snd_soc_tplg_vendor_array array[0]; 2398c2ecf20Sopenharmony_ci }; 2408c2ecf20Sopenharmony_ci} __attribute__((packed)); 2418c2ecf20Sopenharmony_ci 2428c2ecf20Sopenharmony_ci/* 2438c2ecf20Sopenharmony_ci * Kcontrol TLV data. 2448c2ecf20Sopenharmony_ci */ 2458c2ecf20Sopenharmony_cistruct snd_soc_tplg_tlv_dbscale { 2468c2ecf20Sopenharmony_ci __le32 min; 2478c2ecf20Sopenharmony_ci __le32 step; 2488c2ecf20Sopenharmony_ci __le32 mute; 2498c2ecf20Sopenharmony_ci} __attribute__((packed)); 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_cistruct snd_soc_tplg_ctl_tlv { 2528c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 2538c2ecf20Sopenharmony_ci __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */ 2548c2ecf20Sopenharmony_ci union { 2558c2ecf20Sopenharmony_ci __le32 data[SND_SOC_TPLG_TLV_SIZE]; 2568c2ecf20Sopenharmony_ci struct snd_soc_tplg_tlv_dbscale scale; 2578c2ecf20Sopenharmony_ci }; 2588c2ecf20Sopenharmony_ci} __attribute__((packed)); 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci/* 2618c2ecf20Sopenharmony_ci * Kcontrol channel data 2628c2ecf20Sopenharmony_ci */ 2638c2ecf20Sopenharmony_cistruct snd_soc_tplg_channel { 2648c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 2658c2ecf20Sopenharmony_ci __le32 reg; 2668c2ecf20Sopenharmony_ci __le32 shift; 2678c2ecf20Sopenharmony_ci __le32 id; /* ID maps to Left, Right, LFE etc */ 2688c2ecf20Sopenharmony_ci} __attribute__((packed)); 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci/* 2718c2ecf20Sopenharmony_ci * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops 2728c2ecf20Sopenharmony_ci * Kcontrol ops need get/put/info. 2738c2ecf20Sopenharmony_ci * Bytes ext ops need get/put. 2748c2ecf20Sopenharmony_ci */ 2758c2ecf20Sopenharmony_cistruct snd_soc_tplg_io_ops { 2768c2ecf20Sopenharmony_ci __le32 get; 2778c2ecf20Sopenharmony_ci __le32 put; 2788c2ecf20Sopenharmony_ci __le32 info; 2798c2ecf20Sopenharmony_ci} __attribute__((packed)); 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci/* 2828c2ecf20Sopenharmony_ci * kcontrol header 2838c2ecf20Sopenharmony_ci */ 2848c2ecf20Sopenharmony_cistruct snd_soc_tplg_ctl_hdr { 2858c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 2868c2ecf20Sopenharmony_ci __le32 type; 2878c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2888c2ecf20Sopenharmony_ci __le32 access; 2898c2ecf20Sopenharmony_ci struct snd_soc_tplg_io_ops ops; 2908c2ecf20Sopenharmony_ci struct snd_soc_tplg_ctl_tlv tlv; 2918c2ecf20Sopenharmony_ci} __attribute__((packed)); 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ci/* 2948c2ecf20Sopenharmony_ci * Stream Capabilities 2958c2ecf20Sopenharmony_ci */ 2968c2ecf20Sopenharmony_cistruct snd_soc_tplg_stream_caps { 2978c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 2988c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2998c2ecf20Sopenharmony_ci __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */ 3008c2ecf20Sopenharmony_ci __le32 rates; /* supported rates SNDRV_PCM_RATE_* */ 3018c2ecf20Sopenharmony_ci __le32 rate_min; /* min rate */ 3028c2ecf20Sopenharmony_ci __le32 rate_max; /* max rate */ 3038c2ecf20Sopenharmony_ci __le32 channels_min; /* min channels */ 3048c2ecf20Sopenharmony_ci __le32 channels_max; /* max channels */ 3058c2ecf20Sopenharmony_ci __le32 periods_min; /* min number of periods */ 3068c2ecf20Sopenharmony_ci __le32 periods_max; /* max number of periods */ 3078c2ecf20Sopenharmony_ci __le32 period_size_min; /* min period size bytes */ 3088c2ecf20Sopenharmony_ci __le32 period_size_max; /* max period size bytes */ 3098c2ecf20Sopenharmony_ci __le32 buffer_size_min; /* min buffer size bytes */ 3108c2ecf20Sopenharmony_ci __le32 buffer_size_max; /* max buffer size bytes */ 3118c2ecf20Sopenharmony_ci __le32 sig_bits; /* number of bits of content */ 3128c2ecf20Sopenharmony_ci} __attribute__((packed)); 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_ci/* 3158c2ecf20Sopenharmony_ci * FE or BE Stream configuration supported by SW/FW 3168c2ecf20Sopenharmony_ci */ 3178c2ecf20Sopenharmony_cistruct snd_soc_tplg_stream { 3188c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 3198c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */ 3208c2ecf20Sopenharmony_ci __le64 format; /* SNDRV_PCM_FMTBIT_* */ 3218c2ecf20Sopenharmony_ci __le32 rate; /* SNDRV_PCM_RATE_* */ 3228c2ecf20Sopenharmony_ci __le32 period_bytes; /* size of period in bytes */ 3238c2ecf20Sopenharmony_ci __le32 buffer_bytes; /* size of buffer in bytes */ 3248c2ecf20Sopenharmony_ci __le32 channels; /* channels */ 3258c2ecf20Sopenharmony_ci} __attribute__((packed)); 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci/* 3298c2ecf20Sopenharmony_ci * Describes a physical link's runtime supported hardware config, 3308c2ecf20Sopenharmony_ci * i.e. hardware audio formats. 3318c2ecf20Sopenharmony_ci */ 3328c2ecf20Sopenharmony_cistruct snd_soc_tplg_hw_config { 3338c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 3348c2ecf20Sopenharmony_ci __le32 id; /* unique ID - - used to match */ 3358c2ecf20Sopenharmony_ci __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */ 3368c2ecf20Sopenharmony_ci __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */ 3378c2ecf20Sopenharmony_ci __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */ 3388c2ecf20Sopenharmony_ci __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */ 3398c2ecf20Sopenharmony_ci __u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */ 3408c2ecf20Sopenharmony_ci __u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */ 3418c2ecf20Sopenharmony_ci __u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */ 3428c2ecf20Sopenharmony_ci __le16 reserved; /* for 32bit alignment */ 3438c2ecf20Sopenharmony_ci __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */ 3448c2ecf20Sopenharmony_ci __le32 bclk_rate; /* BCLK freqency in Hz */ 3458c2ecf20Sopenharmony_ci __le32 fsync_rate; /* frame clock in Hz */ 3468c2ecf20Sopenharmony_ci __le32 tdm_slots; /* number of TDM slots in use */ 3478c2ecf20Sopenharmony_ci __le32 tdm_slot_width; /* width in bits for each slot */ 3488c2ecf20Sopenharmony_ci __le32 tx_slots; /* bit mask for active Tx slots */ 3498c2ecf20Sopenharmony_ci __le32 rx_slots; /* bit mask for active Rx slots */ 3508c2ecf20Sopenharmony_ci __le32 tx_channels; /* number of Tx channels */ 3518c2ecf20Sopenharmony_ci __le32 tx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */ 3528c2ecf20Sopenharmony_ci __le32 rx_channels; /* number of Rx channels */ 3538c2ecf20Sopenharmony_ci __le32 rx_chanmap[SND_SOC_TPLG_MAX_CHAN]; /* array of slot number */ 3548c2ecf20Sopenharmony_ci} __attribute__((packed)); 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci/* 3578c2ecf20Sopenharmony_ci * Manifest. List totals for each payload type. Not used in parsing, but will 3588c2ecf20Sopenharmony_ci * be passed to the component driver before any other objects in order for any 3598c2ecf20Sopenharmony_ci * global component resource allocations. 3608c2ecf20Sopenharmony_ci * 3618c2ecf20Sopenharmony_ci * File block representation for manifest :- 3628c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3638c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 3648c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3658c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_manifest | 1 | 3668c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3678c2ecf20Sopenharmony_ci */ 3688c2ecf20Sopenharmony_cistruct snd_soc_tplg_manifest { 3698c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 3708c2ecf20Sopenharmony_ci __le32 control_elems; /* number of control elements */ 3718c2ecf20Sopenharmony_ci __le32 widget_elems; /* number of widget elements */ 3728c2ecf20Sopenharmony_ci __le32 graph_elems; /* number of graph elements */ 3738c2ecf20Sopenharmony_ci __le32 pcm_elems; /* number of PCM elements */ 3748c2ecf20Sopenharmony_ci __le32 dai_link_elems; /* number of DAI link elements */ 3758c2ecf20Sopenharmony_ci __le32 dai_elems; /* number of physical DAI elements */ 3768c2ecf20Sopenharmony_ci __le32 reserved[20]; /* reserved for new ABI element types */ 3778c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 3788c2ecf20Sopenharmony_ci} __attribute__((packed)); 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_ci/* 3818c2ecf20Sopenharmony_ci * Mixer kcontrol. 3828c2ecf20Sopenharmony_ci * 3838c2ecf20Sopenharmony_ci * File block representation for mixer kcontrol :- 3848c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3858c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 3868c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3878c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_mixer_control | N | 3888c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 3898c2ecf20Sopenharmony_ci */ 3908c2ecf20Sopenharmony_cistruct snd_soc_tplg_mixer_control { 3918c2ecf20Sopenharmony_ci struct snd_soc_tplg_ctl_hdr hdr; 3928c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 3938c2ecf20Sopenharmony_ci __le32 min; 3948c2ecf20Sopenharmony_ci __le32 max; 3958c2ecf20Sopenharmony_ci __le32 platform_max; 3968c2ecf20Sopenharmony_ci __le32 invert; 3978c2ecf20Sopenharmony_ci __le32 num_channels; 3988c2ecf20Sopenharmony_ci struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; 3998c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 4008c2ecf20Sopenharmony_ci} __attribute__((packed)); 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci/* 4038c2ecf20Sopenharmony_ci * Enumerated kcontrol 4048c2ecf20Sopenharmony_ci * 4058c2ecf20Sopenharmony_ci * File block representation for enum kcontrol :- 4068c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4078c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 4088c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4098c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_enum_control | N | 4108c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4118c2ecf20Sopenharmony_ci */ 4128c2ecf20Sopenharmony_cistruct snd_soc_tplg_enum_control { 4138c2ecf20Sopenharmony_ci struct snd_soc_tplg_ctl_hdr hdr; 4148c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 4158c2ecf20Sopenharmony_ci __le32 num_channels; 4168c2ecf20Sopenharmony_ci struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; 4178c2ecf20Sopenharmony_ci __le32 items; 4188c2ecf20Sopenharmony_ci __le32 mask; 4198c2ecf20Sopenharmony_ci __le32 count; 4208c2ecf20Sopenharmony_ci char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4218c2ecf20Sopenharmony_ci __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4]; 4228c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 4238c2ecf20Sopenharmony_ci} __attribute__((packed)); 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci/* 4268c2ecf20Sopenharmony_ci * Bytes kcontrol 4278c2ecf20Sopenharmony_ci * 4288c2ecf20Sopenharmony_ci * File block representation for bytes kcontrol :- 4298c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4308c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 4318c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4328c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_bytes_control | N | 4338c2ecf20Sopenharmony_ci * +-----------------------------------+----+ 4348c2ecf20Sopenharmony_ci */ 4358c2ecf20Sopenharmony_cistruct snd_soc_tplg_bytes_control { 4368c2ecf20Sopenharmony_ci struct snd_soc_tplg_ctl_hdr hdr; 4378c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 4388c2ecf20Sopenharmony_ci __le32 max; 4398c2ecf20Sopenharmony_ci __le32 mask; 4408c2ecf20Sopenharmony_ci __le32 base; 4418c2ecf20Sopenharmony_ci __le32 num_regs; 4428c2ecf20Sopenharmony_ci struct snd_soc_tplg_io_ops ext_ops; 4438c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 4448c2ecf20Sopenharmony_ci} __attribute__((packed)); 4458c2ecf20Sopenharmony_ci 4468c2ecf20Sopenharmony_ci/* 4478c2ecf20Sopenharmony_ci * DAPM Graph Element 4488c2ecf20Sopenharmony_ci * 4498c2ecf20Sopenharmony_ci * File block representation for DAPM graph elements :- 4508c2ecf20Sopenharmony_ci * +-------------------------------------+----+ 4518c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 4528c2ecf20Sopenharmony_ci * +-------------------------------------+----+ 4538c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_dapm_graph_elem | N | 4548c2ecf20Sopenharmony_ci * +-------------------------------------+----+ 4558c2ecf20Sopenharmony_ci */ 4568c2ecf20Sopenharmony_cistruct snd_soc_tplg_dapm_graph_elem { 4578c2ecf20Sopenharmony_ci char sink[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4588c2ecf20Sopenharmony_ci char control[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4598c2ecf20Sopenharmony_ci char source[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4608c2ecf20Sopenharmony_ci} __attribute__((packed)); 4618c2ecf20Sopenharmony_ci 4628c2ecf20Sopenharmony_ci/* 4638c2ecf20Sopenharmony_ci * DAPM Widget. 4648c2ecf20Sopenharmony_ci * 4658c2ecf20Sopenharmony_ci * File block representation for DAPM widget :- 4668c2ecf20Sopenharmony_ci * +-------------------------------------+-----+ 4678c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 4688c2ecf20Sopenharmony_ci * +-------------------------------------+-----+ 4698c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_dapm_widget | N | 4708c2ecf20Sopenharmony_ci * +-------------------------------------+-----+ 4718c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_enum_control | 0|1 | 4728c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_mixer_control | 0|N | 4738c2ecf20Sopenharmony_ci * +-------------------------------------+-----+ 4748c2ecf20Sopenharmony_ci * 4758c2ecf20Sopenharmony_ci * Optional enum or mixer control can be appended to the end of each widget 4768c2ecf20Sopenharmony_ci * in the block. 4778c2ecf20Sopenharmony_ci */ 4788c2ecf20Sopenharmony_cistruct snd_soc_tplg_dapm_widget { 4798c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 4808c2ecf20Sopenharmony_ci __le32 id; /* SND_SOC_DAPM_CTL */ 4818c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4828c2ecf20Sopenharmony_ci char sname[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci __le32 reg; /* negative reg = no direct dapm */ 4858c2ecf20Sopenharmony_ci __le32 shift; /* bits to shift */ 4868c2ecf20Sopenharmony_ci __le32 mask; /* non-shifted mask */ 4878c2ecf20Sopenharmony_ci __le32 subseq; /* sort within widget type */ 4888c2ecf20Sopenharmony_ci __le32 invert; /* invert the power bit */ 4898c2ecf20Sopenharmony_ci __le32 ignore_suspend; /* kept enabled over suspend */ 4908c2ecf20Sopenharmony_ci __le16 event_flags; 4918c2ecf20Sopenharmony_ci __le16 event_type; 4928c2ecf20Sopenharmony_ci __le32 num_kcontrols; 4938c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 4948c2ecf20Sopenharmony_ci /* 4958c2ecf20Sopenharmony_ci * kcontrols that relate to this widget 4968c2ecf20Sopenharmony_ci * follow here after widget private data 4978c2ecf20Sopenharmony_ci */ 4988c2ecf20Sopenharmony_ci} __attribute__((packed)); 4998c2ecf20Sopenharmony_ci 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_ci/* 5028c2ecf20Sopenharmony_ci * Describes SW/FW specific features of PCM (FE DAI & DAI link). 5038c2ecf20Sopenharmony_ci * 5048c2ecf20Sopenharmony_ci * File block representation for PCM :- 5058c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5068c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 5078c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5088c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_pcm | N | 5098c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5108c2ecf20Sopenharmony_ci */ 5118c2ecf20Sopenharmony_cistruct snd_soc_tplg_pcm { 5128c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 5138c2ecf20Sopenharmony_ci char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 5148c2ecf20Sopenharmony_ci char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 5158c2ecf20Sopenharmony_ci __le32 pcm_id; /* unique ID - used to match with DAI link */ 5168c2ecf20Sopenharmony_ci __le32 dai_id; /* unique ID - used to match */ 5178c2ecf20Sopenharmony_ci __le32 playback; /* supports playback mode */ 5188c2ecf20Sopenharmony_ci __le32 capture; /* supports capture mode */ 5198c2ecf20Sopenharmony_ci __le32 compress; /* 1 = compressed; 0 = PCM */ 5208c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */ 5218c2ecf20Sopenharmony_ci __le32 num_streams; /* number of streams */ 5228c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */ 5238c2ecf20Sopenharmony_ci __le32 flag_mask; /* bitmask of flags to configure */ 5248c2ecf20Sopenharmony_ci __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */ 5258c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 5268c2ecf20Sopenharmony_ci} __attribute__((packed)); 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci/* 5308c2ecf20Sopenharmony_ci * Describes the physical link runtime supported configs or params 5318c2ecf20Sopenharmony_ci * 5328c2ecf20Sopenharmony_ci * File block representation for physical link config :- 5338c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5348c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 5358c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5368c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_link_config | N | 5378c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5388c2ecf20Sopenharmony_ci */ 5398c2ecf20Sopenharmony_cistruct snd_soc_tplg_link_config { 5408c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 5418c2ecf20Sopenharmony_ci __le32 id; /* unique ID - used to match */ 5428c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */ 5438c2ecf20Sopenharmony_ci char stream_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* stream name - used to match */ 5448c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */ 5458c2ecf20Sopenharmony_ci __le32 num_streams; /* number of streams */ 5468c2ecf20Sopenharmony_ci struct snd_soc_tplg_hw_config hw_config[SND_SOC_TPLG_HW_CONFIG_MAX]; /* hw configs */ 5478c2ecf20Sopenharmony_ci __le32 num_hw_configs; /* number of hw configs */ 5488c2ecf20Sopenharmony_ci __le32 default_hw_config_id; /* default hw config ID for init */ 5498c2ecf20Sopenharmony_ci __le32 flag_mask; /* bitmask of flags to configure */ 5508c2ecf20Sopenharmony_ci __le32 flags; /* SND_SOC_TPLG_LNK_FLGBIT_* flag value */ 5518c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 5528c2ecf20Sopenharmony_ci} __attribute__((packed)); 5538c2ecf20Sopenharmony_ci 5548c2ecf20Sopenharmony_ci/* 5558c2ecf20Sopenharmony_ci * Describes SW/FW specific features of physical DAI. 5568c2ecf20Sopenharmony_ci * It can be used to configure backend DAIs for DPCM. 5578c2ecf20Sopenharmony_ci * 5588c2ecf20Sopenharmony_ci * File block representation for physical DAI :- 5598c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5608c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_hdr | 1 | 5618c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5628c2ecf20Sopenharmony_ci * | struct snd_soc_tplg_dai | N | 5638c2ecf20Sopenharmony_ci * +-----------------------------------+-----+ 5648c2ecf20Sopenharmony_ci */ 5658c2ecf20Sopenharmony_cistruct snd_soc_tplg_dai { 5668c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 5678c2ecf20Sopenharmony_ci char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* name - used to match */ 5688c2ecf20Sopenharmony_ci __le32 dai_id; /* unique ID - used to match */ 5698c2ecf20Sopenharmony_ci __le32 playback; /* supports playback mode */ 5708c2ecf20Sopenharmony_ci __le32 capture; /* supports capture mode */ 5718c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */ 5728c2ecf20Sopenharmony_ci __le32 flag_mask; /* bitmask of flags to configure */ 5738c2ecf20Sopenharmony_ci __le32 flags; /* SND_SOC_TPLG_DAI_FLGBIT_* */ 5748c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 5758c2ecf20Sopenharmony_ci} __attribute__((packed)); 5768c2ecf20Sopenharmony_ci 5778c2ecf20Sopenharmony_ci/* 5788c2ecf20Sopenharmony_ci * Old version of ABI structs, supported for backward compatibility. 5798c2ecf20Sopenharmony_ci */ 5808c2ecf20Sopenharmony_ci 5818c2ecf20Sopenharmony_ci/* Manifest v4 */ 5828c2ecf20Sopenharmony_cistruct snd_soc_tplg_manifest_v4 { 5838c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 5848c2ecf20Sopenharmony_ci __le32 control_elems; /* number of control elements */ 5858c2ecf20Sopenharmony_ci __le32 widget_elems; /* number of widget elements */ 5868c2ecf20Sopenharmony_ci __le32 graph_elems; /* number of graph elements */ 5878c2ecf20Sopenharmony_ci __le32 pcm_elems; /* number of PCM elements */ 5888c2ecf20Sopenharmony_ci __le32 dai_link_elems; /* number of DAI link elements */ 5898c2ecf20Sopenharmony_ci struct snd_soc_tplg_private priv; 5908c2ecf20Sopenharmony_ci} __packed; 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_ci/* Stream Capabilities v4 */ 5938c2ecf20Sopenharmony_cistruct snd_soc_tplg_stream_caps_v4 { 5948c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 5958c2ecf20Sopenharmony_ci char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 5968c2ecf20Sopenharmony_ci __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */ 5978c2ecf20Sopenharmony_ci __le32 rates; /* supported rates SNDRV_PCM_RATE_* */ 5988c2ecf20Sopenharmony_ci __le32 rate_min; /* min rate */ 5998c2ecf20Sopenharmony_ci __le32 rate_max; /* max rate */ 6008c2ecf20Sopenharmony_ci __le32 channels_min; /* min channels */ 6018c2ecf20Sopenharmony_ci __le32 channels_max; /* max channels */ 6028c2ecf20Sopenharmony_ci __le32 periods_min; /* min number of periods */ 6038c2ecf20Sopenharmony_ci __le32 periods_max; /* max number of periods */ 6048c2ecf20Sopenharmony_ci __le32 period_size_min; /* min period size bytes */ 6058c2ecf20Sopenharmony_ci __le32 period_size_max; /* max period size bytes */ 6068c2ecf20Sopenharmony_ci __le32 buffer_size_min; /* min buffer size bytes */ 6078c2ecf20Sopenharmony_ci __le32 buffer_size_max; /* max buffer size bytes */ 6088c2ecf20Sopenharmony_ci} __packed; 6098c2ecf20Sopenharmony_ci 6108c2ecf20Sopenharmony_ci/* PCM v4 */ 6118c2ecf20Sopenharmony_cistruct snd_soc_tplg_pcm_v4 { 6128c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 6138c2ecf20Sopenharmony_ci char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 6148c2ecf20Sopenharmony_ci char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 6158c2ecf20Sopenharmony_ci __le32 pcm_id; /* unique ID - used to match with DAI link */ 6168c2ecf20Sopenharmony_ci __le32 dai_id; /* unique ID - used to match */ 6178c2ecf20Sopenharmony_ci __le32 playback; /* supports playback mode */ 6188c2ecf20Sopenharmony_ci __le32 capture; /* supports capture mode */ 6198c2ecf20Sopenharmony_ci __le32 compress; /* 1 = compressed; 0 = PCM */ 6208c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */ 6218c2ecf20Sopenharmony_ci __le32 num_streams; /* number of streams */ 6228c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */ 6238c2ecf20Sopenharmony_ci} __packed; 6248c2ecf20Sopenharmony_ci 6258c2ecf20Sopenharmony_ci/* Physical link config v4 */ 6268c2ecf20Sopenharmony_cistruct snd_soc_tplg_link_config_v4 { 6278c2ecf20Sopenharmony_ci __le32 size; /* in bytes of this structure */ 6288c2ecf20Sopenharmony_ci __le32 id; /* unique ID - used to match */ 6298c2ecf20Sopenharmony_ci struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */ 6308c2ecf20Sopenharmony_ci __le32 num_streams; /* number of streams */ 6318c2ecf20Sopenharmony_ci} __packed; 6328c2ecf20Sopenharmony_ci 6338c2ecf20Sopenharmony_ci#endif 634