From 5b2688a59af686f7c0a80edc49d7f190365ac090 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:28:47 +0800 Subject: ASoC: topology: ABI - Add PCM Support and bump ABI version to 4 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 Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 247c50bd60f0..2aa081ca95c1 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -83,7 +83,7 @@ #define SND_SOC_TPLG_NUM_TEXTS 16 /* ABI version */ -#define SND_SOC_TPLG_ABI_VERSION 0x3 +#define SND_SOC_TPLG_ABI_VERSION 0x4 /* Max size of TLV data */ #define SND_SOC_TPLG_TLV_SIZE 32 @@ -378,30 +378,29 @@ struct snd_soc_tplg_dapm_widget { */ } __attribute__((packed)); -struct snd_soc_tplg_pcm_cfg_caps { - struct snd_soc_tplg_stream_caps caps; - struct snd_soc_tplg_stream_config configs[SND_SOC_TPLG_STREAM_CONFIG_MAX]; - __le32 num_configs; /* number of configs */ -} __attribute__((packed)); /* - * Describes SW/FW specific features of PCM or DAI link. + * Describes SW/FW specific features of PCM (FE DAI & DAI link). * - * File block representation for PCM/DAI-Link :- + * File block representation for PCM :- * +-----------------------------------+-----+ * | struct snd_soc_tplg_hdr | 1 | * +-----------------------------------+-----+ - * | struct snd_soc_tplg_dapm_pcm_dai | N | + * | struct snd_soc_tplg_pcm | N | * +-----------------------------------+-----+ */ -struct snd_soc_tplg_pcm_dai { +struct snd_soc_tplg_pcm { __le32 size; /* in bytes of this structure */ - char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; - __le32 id; /* unique ID - used to match */ - __le32 playback; /* supports playback mode */ - __le32 capture; /* supports capture mode */ - __le32 compress; /* 1 = compressed; 0 = PCM */ - struct snd_soc_tplg_pcm_cfg_caps capconf[2]; /* capabilities and configs */ + char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; + char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; + __le32 pcm_id; /* unique ID - used to match */ + __le32 dai_id; /* unique ID - used to match */ + __le32 playback; /* supports playback mode */ + __le32 capture; /* supports capture mode */ + __le32 compress; /* 1 = compressed; 0 = PCM */ + struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */ + __le32 num_streams; /* number of streams */ + struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */ } __attribute__((packed)); #endif -- cgit v1.2.3 From 7654855ef84d78079109bb38195a8db6b188117b Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:29:47 +0800 Subject: ASoC: topology: ABI - Remove unused struct snd_soc_tplg_stream_config 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 Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 2aa081ca95c1..4bef63f5e1ff 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -226,16 +226,6 @@ struct snd_soc_tplg_stream { __le32 dai_fmt; /* SND_SOC_DAIFMT_ */ } __attribute__((packed)); -/* - * Duplex stream configuration supported by SW/FW. - */ -struct snd_soc_tplg_stream_config { - __le32 size; /* in bytes of this structure */ - char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; - struct snd_soc_tplg_stream playback; - struct snd_soc_tplg_stream capture; -} __attribute__((packed)); - /* * Manifest. List totals for each payload type. Not used in parsing, but will * be passed to the component driver before any other objects in order for any -- cgit v1.2.3 From e8b3fe8f383bbf055cbd69b776fcbbb5ed3befcd Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:30:05 +0800 Subject: ASoC: topology: ABI - Use __le32 instead of __u32 in snd_soc_tplg_dapm_widget 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 Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 4bef63f5e1ff..88210a8e450f 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -356,11 +356,11 @@ struct snd_soc_tplg_dapm_widget { __le32 shift; /* bits to shift */ __le32 mask; /* non-shifted mask */ __le32 subseq; /* sort within widget type */ - __u32 invert; /* invert the power bit */ - __u32 ignore_suspend; /* kept enabled over suspend */ - __u16 event_flags; - __u16 event_type; - __u16 num_kcontrols; + __le32 invert; /* invert the power bit */ + __le32 ignore_suspend; /* kept enabled over suspend */ + __le16 event_flags; + __le16 event_type; + __le32 num_kcontrols; struct snd_soc_tplg_private priv; /* * kcontrols that relate to this widget -- cgit v1.2.3 From 731324f5cee3caf230427f754701212961fe0bb1 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:31:34 +0800 Subject: ASoC: topology: ABI - Add name element to snd_soc_tplg_stream 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 Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 88210a8e450f..218148000187 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -217,6 +217,7 @@ struct snd_soc_tplg_stream_caps { */ struct snd_soc_tplg_stream { __le32 size; /* in bytes of this structure */ + char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */ __le64 format; /* SNDRV_PCM_FMTBIT_* */ __le32 rate; /* SNDRV_PCM_RATE_* */ __le32 period_bytes; /* size of period in bytes */ -- cgit v1.2.3 From 478d0d39719127c42f21ac85b8719a87b8fa7bd7 Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Wed, 30 Sep 2015 17:31:44 +0800 Subject: ASoC: topology: ABI - Change stream formats to a bitwise flag 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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 218148000187..eeb74a9cc2f8 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -198,7 +198,7 @@ struct snd_soc_tplg_ctl_hdr { struct snd_soc_tplg_stream_caps { __le32 size; /* in bytes of this structure */ char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; - __le64 formats[SND_SOC_TPLG_MAX_FORMATS]; /* supported formats SNDRV_PCM_FMTBIT_* */ + __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */ __le32 rates; /* supported rates SNDRV_PCM_RATE_* */ __le32 rate_min; /* min rate */ __le32 rate_max; /* max rate */ -- cgit v1.2.3 From 7c545b327d54cdc3f693093f744459f6e0d8ce58 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:32:04 +0800 Subject: ASoC: topology: ABI - Add the type for BE DAI link Define the topology type for BE DAI link: SND_SOC_TPLG_TYPE_BACKEND_LINK. Signed-off-by: Vedang Patel Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index eeb74a9cc2f8..f75fd29bf580 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -103,7 +103,8 @@ #define SND_SOC_TPLG_TYPE_PCM 7 #define SND_SOC_TPLG_TYPE_MANIFEST 8 #define SND_SOC_TPLG_TYPE_CODEC_LINK 9 -#define SND_SOC_TPLG_TYPE_PDATA 10 +#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 /* vendor block IDs - please add new vendor types to end */ -- cgit v1.2.3 From e2a9df656f28e42538562d090e2b6f3dec5b41f2 Mon Sep 17 00:00:00 2001 From: Vedang Patel Date: Wed, 30 Sep 2015 17:32:22 +0800 Subject: ASoC: topology: ABI - Add configuration for BE & Codec-Codec DAI Links struct snd_soc_tplg_link_config is defined to configure BE & CC links. Signed-off-by: Vedang Patel Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index f75fd29bf580..538ea1308008 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -395,4 +395,21 @@ struct snd_soc_tplg_pcm { struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */ } __attribute__((packed)); + +/* + * Describes the BE or CC link runtime supported configs or params + * + * File block representation for BE/CC link config :- + * +-----------------------------------+-----+ + * | struct snd_soc_tplg_hdr | 1 | + * +-----------------------------------+-----+ + * | struct snd_soc_tplg_link_config | N | + * +-----------------------------------+-----+ + */ +struct snd_soc_tplg_link_config { + __le32 size; /* in bytes of this structure */ + __le32 id; /* unique ID - used to match */ + 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)); #endif -- cgit v1.2.3 From 76a822a6ae9c0c67309318bb60a4117329252fc4 Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Wed, 30 Sep 2015 17:32:40 +0800 Subject: ASoC: topology: ABI - Remove tdm_slot & dai_fmt from snd_soc_tplg_stream These two fields are line parameters for BE/CC links and should not be from toplogy but from ACPI. Signed-off-by: Mengdong Lin Signed-off-by: Mark Brown --- include/uapi/sound/asoc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/uapi/sound') diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 538ea1308008..26539a7e4880 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -224,8 +224,6 @@ struct snd_soc_tplg_stream { __le32 period_bytes; /* size of period in bytes */ __le32 buffer_bytes; /* size of buffer in bytes */ __le32 channels; /* channels */ - __le32 tdm_slot; /* optional BE bitmask of supported TDM slots */ - __le32 dai_fmt; /* SND_SOC_DAIFMT_ */ } __attribute__((packed)); /* -- cgit v1.2.3