* [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs
@ 2018-02-19 6:07 Kirill Marinushkin
2018-02-19 6:07 ` [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config Kirill Marinushkin
2018-02-20 17:08 ` [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
0 siblings, 2 replies; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-19 6:07 UTC (permalink / raw)
To: alsa-devel; +Cc: patch, Kirill Marinushkin
Currently, if the config file includes several hw_configs sections,
parse_hw_config_refs() returns after parsing only the first section.
For example, the following config, based on
alsa-lib/src/conf/topology/broadwell/broadwell.conf, is parsed incorrectly:
~~~~
SectionHWConfig."CodecHWConfig" {
id "1"
format "I2S" # physical audio format.
bclk "master" # Platform is master of bit clock
fsync "master" # platform is master of fsync
}
SectionHWConfig."CodecHWConfig2" {
id "2"
format "AC97"
}
SectionLink."Codec" {
# used for binding to the physical link
id "0"
hw_configs [
"CodecHWConfig"
"CodecHWConfig2"
]
default_hw_conf_id "2"
}
~~~~
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: alsa-devel@alsa-project.org
Cc: patch@alsa-project.org
---
src/topology/pcm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 58cee31d..d3836677 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -882,6 +882,7 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
/* refer to a list of HW configs */
snd_config_for_each(i, next, cfg) {
const char *val;
+ int err;
n = snd_config_iterator_entry(i);
if (snd_config_get_string(n, &val) < 0)
@@ -893,7 +894,9 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
}
link->num_hw_configs++;
- return tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
+ err = tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
+ if (err < 0)
+ return err;
}
return 0;
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config
2018-02-19 6:07 [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
@ 2018-02-19 6:07 ` Kirill Marinushkin
2018-02-19 6:51 ` Takashi Sakamoto
2018-02-20 17:08 ` [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
1 sibling, 1 reply; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-19 6:07 UTC (permalink / raw)
To: alsa-devel; +Cc: alsa-patch, Kirill Marinushkin
In kernel `soc-dai.h`, DAI clock gating is defined as following:
~~~~
\#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
\#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */
~~~~
Therefore, the corresponding field of struct snd_soc_tplg_hw_config should
be inverted compared to the current logic:
clock_count = 1 => SND_SOC_DAIFMT_CONT
clock_count = 0 => SND_SOC_DAIFMT_GATED
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: alsa-devel@alsa-project.org
Cc: alsa-patch@alsa-project.org
---
include/sound/asoc.h | 4 +++-
include/topology.h | 4 +++-
src/topology/pcm.c | 6 +++---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/include/sound/asoc.h b/include/sound/asoc.h
index 0f5d9f9a..9f601ef0 100644
--- a/include/sound/asoc.h
+++ b/include/sound/asoc.h
@@ -308,7 +308,9 @@ struct snd_soc_tplg_hw_config {
__le32 size; /* in bytes of this structure */
__le32 id; /* unique ID - - used to match */
__le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
- __u8 clock_gated; /* 1 if clock can be gated to save power */
+ __u8 clock_cont; /* 1 if clock is continuous, and can not be
+ * gated to save power
+ */
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
__u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
diff --git a/include/topology.h b/include/topology.h
index 8779da4d..630fee21 100644
--- a/include/topology.h
+++ b/include/topology.h
@@ -997,7 +997,9 @@ struct snd_tplg_pcm_template {
struct snd_tplg_hw_config_template {
int id; /* unique ID - - used to match */
unsigned int fmt; /* SND_SOC_DAI_FORMAT_ format value */
- unsigned char clock_gated; /* 1 if clock can be gated to save power */
+ unsigned char clock_cont; /* 1 if clock is continuous, and can not
+ * be gated to save power
+ */
unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */
unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */
unsigned char bclk_master; /* 1 for master of BCLK, 0 for slave */
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index d3836677..7f280ed0 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -1205,12 +1205,12 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
continue;
}
- if (strcmp(id, "pm_gate_clocks") == 0) {
+ if (strcmp(id, "pm_cont_clock") == 0) {
if (snd_config_get_string(n, &val) < 0)
return -EINVAL;
if (!strcmp(val, "true"))
- hw_cfg->clock_gated = true;
+ hw_cfg->clock_cont = true;
continue;
}
@@ -1376,7 +1376,7 @@ static int set_link_hw_config(struct snd_soc_tplg_hw_config *cfg,
cfg->id = tpl->id;
cfg->fmt = tpl->fmt;
- cfg->clock_gated = tpl->clock_gated;
+ cfg->clock_cont = tpl->clock_cont;
cfg->invert_bclk = tpl->invert_bclk;
cfg->invert_fsync = tpl->invert_fsync;
cfg->bclk_master = tpl->bclk_master;
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config
2018-02-19 6:07 ` [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config Kirill Marinushkin
@ 2018-02-19 6:51 ` Takashi Sakamoto
2018-02-19 19:01 ` Kirill Marinushkin
2018-02-19 20:38 ` [PATCH, alsa-lib v2 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
0 siblings, 2 replies; 7+ messages in thread
From: Takashi Sakamoto @ 2018-02-19 6:51 UTC (permalink / raw)
To: Kirill Marinushkin, alsa-devel; +Cc: alsa-patch
Hi,
On Feb 19 2018 15:07, Kirill Marinushkin wrote:
> In kernel `soc-dai.h`, DAI clock gating is defined as following:
>
> ~~~~
> \#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
> \#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */
> ~~~~
>
> Therefore, the corresponding field of struct snd_soc_tplg_hw_config should
> be inverted compared to the current logic:
>
> clock_count = 1 => SND_SOC_DAIFMT_CONT
> clock_count = 0 => SND_SOC_DAIFMT_GATED
>
> Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> Cc: alsa-devel@alsa-project.org
> Cc: alsa-patch@alsa-project.org
> ---
> include/sound/asoc.h | 4 +++-
> include/topology.h | 4 +++-
> src/topology/pcm.c | 6 +++---
> 3 files changed, 9 insertions(+), 5 deletions(-)
This change is based on breakage of ABI compatibility which I pointed in
this message[1]. Please take backward compatibility in account when
working for any change for interfaces between kernel/user spaces.
> diff --git a/include/sound/asoc.h b/include/sound/asoc.h
> index 0f5d9f9a..9f601ef0 100644
> --- a/include/sound/asoc.h
> +++ b/include/sound/asoc.h
> @@ -308,7 +308,9 @@ struct snd_soc_tplg_hw_config {
> __le32 size; /* in bytes of this structure */
> __le32 id; /* unique ID - - used to match */
> __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
> - __u8 clock_gated; /* 1 if clock can be gated to save power */
> + __u8 clock_cont; /* 1 if clock is continuous, and can not be
> + * gated to save power
> + */
> __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
> __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
> __u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
> diff --git a/include/topology.h b/include/topology.h
> index 8779da4d..630fee21 100644
> --- a/include/topology.h
> +++ b/include/topology.h
> @@ -997,7 +997,9 @@ struct snd_tplg_pcm_template {
> struct snd_tplg_hw_config_template {
> int id; /* unique ID - - used to match */
> unsigned int fmt; /* SND_SOC_DAI_FORMAT_ format value */
> - unsigned char clock_gated; /* 1 if clock can be gated to save power */
> + unsigned char clock_cont; /* 1 if clock is continuous, and can not
> + * be gated to save power
> + */
> unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */
> unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */
> unsigned char bclk_master; /* 1 for master of BCLK, 0 for slave */
> diff --git a/src/topology/pcm.c b/src/topology/pcm.c
> index d3836677..7f280ed0 100644
> --- a/src/topology/pcm.c
> +++ b/src/topology/pcm.c
> @@ -1205,12 +1205,12 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
> continue;
> }
>
> - if (strcmp(id, "pm_gate_clocks") == 0) {
> + if (strcmp(id, "pm_cont_clock") == 0) {
> if (snd_config_get_string(n, &val) < 0)
> return -EINVAL;
>
> if (!strcmp(val, "true"))
> - hw_cfg->clock_gated = true;
> + hw_cfg->clock_cont = true;
> continue;
> }
>
> @@ -1376,7 +1376,7 @@ static int set_link_hw_config(struct snd_soc_tplg_hw_config *cfg,
> cfg->id = tpl->id;
>
> cfg->fmt = tpl->fmt;
> - cfg->clock_gated = tpl->clock_gated;
> + cfg->clock_cont = tpl->clock_cont;
> cfg->invert_bclk = tpl->invert_bclk;
> cfg->invert_fsync = tpl->invert_fsync;
> cfg->bclk_master = tpl->bclk_master;
[1] [alsa-devel] [PATCH 1/2] ASoC: topology: Rename clock_gated to
clock_cont in snd_soc_tplg_hw_config
http://mailman.alsa-project.org/pipermail/alsa-devel/2018-February/132264.html
Regards
Takashi Sakamoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config
2018-02-19 6:51 ` Takashi Sakamoto
@ 2018-02-19 19:01 ` Kirill Marinushkin
2018-02-19 20:38 ` [PATCH, alsa-lib v2 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
1 sibling, 0 replies; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-19 19:01 UTC (permalink / raw)
To: Takashi Sakamoto, alsa-devel; +Cc: alsa-patch
On 02/19/18 07:51, Takashi Sakamoto wrote:
> Hi,
>
> On Feb 19 2018 15:07, Kirill Marinushkin wrote:
>> In kernel `soc-dai.h`, DAI clock gating is defined as following:
>>
>> ~~~~
>> \#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
>> \#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */
>> ~~~~
>>
>> Therefore, the corresponding field of struct snd_soc_tplg_hw_config should
>> be inverted compared to the current logic:
>>
>> clock_count = 1 => SND_SOC_DAIFMT_CONT
>> clock_count = 0 => SND_SOC_DAIFMT_GATED
>>
>> Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
>> Cc: alsa-devel@alsa-project.org
>> Cc: alsa-patch@alsa-project.org
>> ---
>> include/sound/asoc.h | 4 +++-
>> include/topology.h | 4 +++-
>> src/topology/pcm.c | 6 +++---
>> 3 files changed, 9 insertions(+), 5 deletions(-)
>
> This change is based on breakage of ABI compatibility which I pointed in this message[1]. Please take backward compatibility in account when working for any change for interfaces between kernel/user spaces.
>
>> diff --git a/include/sound/asoc.h b/include/sound/asoc.h
>> index 0f5d9f9a..9f601ef0 100644
>> --- a/include/sound/asoc.h
>> +++ b/include/sound/asoc.h
>> @@ -308,7 +308,9 @@ struct snd_soc_tplg_hw_config {
>> __le32 size; /* in bytes of this structure */
>> __le32 id; /* unique ID - - used to match */
>> __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
>> - __u8 clock_gated; /* 1 if clock can be gated to save power */
>> + __u8 clock_cont; /* 1 if clock is continuous, and can not be
>> + * gated to save power
>> + */
>> __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
>> __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
>> __u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
>> diff --git a/include/topology.h b/include/topology.h
>> index 8779da4d..630fee21 100644
>> --- a/include/topology.h
>> +++ b/include/topology.h
>> @@ -997,7 +997,9 @@ struct snd_tplg_pcm_template {
>> struct snd_tplg_hw_config_template {
>> int id; /* unique ID - - used to match */
>> unsigned int fmt; /* SND_SOC_DAI_FORMAT_ format value */
>> - unsigned char clock_gated; /* 1 if clock can be gated to save power */
>> + unsigned char clock_cont; /* 1 if clock is continuous, and can not
>> + * be gated to save power
>> + */
>> unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */
>> unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */
>> unsigned char bclk_master; /* 1 for master of BCLK, 0 for slave */
>> diff --git a/src/topology/pcm.c b/src/topology/pcm.c
>> index d3836677..7f280ed0 100644
>> --- a/src/topology/pcm.c
>> +++ b/src/topology/pcm.c
>> @@ -1205,12 +1205,12 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
>> continue;
>> }
>> - if (strcmp(id, "pm_gate_clocks") == 0) {
>> + if (strcmp(id, "pm_cont_clock") == 0) {
>> if (snd_config_get_string(n, &val) < 0)
>> return -EINVAL;
>> if (!strcmp(val, "true"))
>> - hw_cfg->clock_gated = true;
>> + hw_cfg->clock_cont = true;
>> continue;
>> }
>> @@ -1376,7 +1376,7 @@ static int set_link_hw_config(struct snd_soc_tplg_hw_config *cfg,
>> cfg->id = tpl->id;
>> cfg->fmt = tpl->fmt;
>> - cfg->clock_gated = tpl->clock_gated;
>> + cfg->clock_cont = tpl->clock_cont;
>> cfg->invert_bclk = tpl->invert_bclk;
>> cfg->invert_fsync = tpl->invert_fsync;
>> cfg->bclk_master = tpl->bclk_master;
>
>
> [1] [alsa-devel] [PATCH 1/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config
> http://mailman.alsa-project.org/pipermail/alsa-devel/2018-February/132264.html
>
> Regards
>
> Takashi Sakamoto
Hello Takashi Sakamoto,
I will propose a backwards-compatible solution as a PATCH v2.
Best Regards,
Kirill
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH, alsa-lib v2 1/2] topology: Fix parsing config with multiple hw_configs
2018-02-19 6:51 ` Takashi Sakamoto
2018-02-19 19:01 ` Kirill Marinushkin
@ 2018-02-19 20:38 ` Kirill Marinushkin
2018-02-19 20:38 ` [PATCH, alsa-lib v2 2/2] ASoC: topology: Add defines for snd_soc_tplg_hw_config.clock_gated Kirill Marinushkin
1 sibling, 1 reply; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-19 20:38 UTC (permalink / raw)
To: Takashi Sakamoto; +Cc: alsa-devel, patch, Kirill Marinushkin
Currently, if the config file includes several hw_configs sections,
parse_hw_config_refs() returns after parsing only the first section.
For example, the following config, based on
alsa-lib/src/conf/topology/broadwell/broadwell.conf, is parsed incorrectly:
~~~~
SectionHWConfig."CodecHWConfig" {
id "1"
format "I2S" # physical audio format.
bclk "master" # Platform is master of bit clock
fsync "master" # platform is master of fsync
}
SectionHWConfig."CodecHWConfig2" {
id "2"
format "AC97"
}
SectionLink."Codec" {
# used for binding to the physical link
id "0"
hw_configs [
"CodecHWConfig"
"CodecHWConfig2"
]
default_hw_conf_id "2"
}
~~~~
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: alsa-devel@alsa-project.org
Cc: patch@alsa-project.org
---
src/topology/pcm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 58cee31d..d3836677 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -882,6 +882,7 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
/* refer to a list of HW configs */
snd_config_for_each(i, next, cfg) {
const char *val;
+ int err;
n = snd_config_iterator_entry(i);
if (snd_config_get_string(n, &val) < 0)
@@ -893,7 +894,9 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
}
link->num_hw_configs++;
- return tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
+ err = tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
+ if (err < 0)
+ return err;
}
return 0;
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH, alsa-lib v2 2/2] ASoC: topology: Add defines for snd_soc_tplg_hw_config.clock_gated
2018-02-19 20:38 ` [PATCH, alsa-lib v2 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
@ 2018-02-19 20:38 ` Kirill Marinushkin
0 siblings, 0 replies; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-19 20:38 UTC (permalink / raw)
To: Takashi Sakamoto; +Cc: alsa-devel, alsa-patch, Kirill Marinushkin
In kernel `soc-dai.h`, DAI clock gating is defined as following:
~~~~
\#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
\#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */
~~~~
The corresponding field of struct snd_soc_tplg_hw_config cannot be used as
bool values due to the inverted logic. Therefore this commit adds the
defines for this field.
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
Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org
Cc: alsa-patch@alsa-project.org
---
include/sound/asoc.h | 7 ++++++-
include/topology.h | 2 +-
src/topology/pcm.c | 6 +++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/sound/asoc.h b/include/sound/asoc.h
index 0f5d9f9a..8f3d7bac 100644
--- a/include/sound/asoc.h
+++ b/include/sound/asoc.h
@@ -135,6 +135,11 @@
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1)
#define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2)
+/* DAI clock gating */
+#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0
+#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1
+#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2
+
/* DAI physical PCM data formats.
* Add new formats to the end of the list.
*/
@@ -308,7 +313,7 @@ struct snd_soc_tplg_hw_config {
__le32 size; /* in bytes of this structure */
__le32 id; /* unique ID - - used to match */
__le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */
- __u8 clock_gated; /* 1 if clock can be gated to save power */
+ __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
__u8 bclk_master; /* 1 for master of BCLK, 0 for slave */
diff --git a/include/topology.h b/include/topology.h
index 8779da4d..80d959be 100644
--- a/include/topology.h
+++ b/include/topology.h
@@ -997,7 +997,7 @@ struct snd_tplg_pcm_template {
struct snd_tplg_hw_config_template {
int id; /* unique ID - - used to match */
unsigned int fmt; /* SND_SOC_DAI_FORMAT_ format value */
- unsigned char clock_gated; /* 1 if clock can be gated to save power */
+ unsigned char clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */
unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */
unsigned char bclk_master; /* 1 for master of BCLK, 0 for slave */
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index d3836677..973f3028 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -1210,7 +1210,11 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg,
return -EINVAL;
if (!strcmp(val, "true"))
- hw_cfg->clock_gated = true;
+ hw_cfg->clock_gated =
+ SND_SOC_TPLG_DAI_CLK_GATE_GATED;
+ else
+ hw_cfg->clock_gated =
+ SND_SOC_TPLG_DAI_CLK_GATE_CONT;
continue;
}
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs
2018-02-19 6:07 [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
2018-02-19 6:07 ` [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config Kirill Marinushkin
@ 2018-02-20 17:08 ` Kirill Marinushkin
1 sibling, 0 replies; 7+ messages in thread
From: Kirill Marinushkin @ 2018-02-20 17:08 UTC (permalink / raw)
To: alsa-devel; +Cc: patch
On 02/19/18 07:07, Kirill Marinushkin wrote:
> Currently, if the config file includes several hw_configs sections,
> parse_hw_config_refs() returns after parsing only the first section.
>
> For example, the following config, based on
> alsa-lib/src/conf/topology/broadwell/broadwell.conf, is parsed incorrectly:
>
> ~~~~
> SectionHWConfig."CodecHWConfig" {
> id "1"
> format "I2S" # physical audio format.
> bclk "master" # Platform is master of bit clock
> fsync "master" # platform is master of fsync
> }
>
> SectionHWConfig."CodecHWConfig2" {
> id "2"
> format "AC97"
> }
>
> SectionLink."Codec" {
>
> # used for binding to the physical link
> id "0"
>
> hw_configs [
> "CodecHWConfig"
> "CodecHWConfig2"
> ]
>
> default_hw_conf_id "2"
> }
> ~~~~
>
> Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
> Cc: alsa-devel@alsa-project.org
> Cc: patch@alsa-project.org
> ---
> src/topology/pcm.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/topology/pcm.c b/src/topology/pcm.c
> index 58cee31d..d3836677 100644
> --- a/src/topology/pcm.c
> +++ b/src/topology/pcm.c
> @@ -882,6 +882,7 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
> /* refer to a list of HW configs */
> snd_config_for_each(i, next, cfg) {
> const char *val;
> + int err;
>
> n = snd_config_iterator_entry(i);
> if (snd_config_get_string(n, &val) < 0)
> @@ -893,7 +894,9 @@ static int parse_hw_config_refs(snd_tplg_t *tplg, snd_config_t *cfg,
> }
>
> link->num_hw_configs++;
> - return tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
> + err = tplg_ref_add(elem, SND_TPLG_TYPE_HW_CONFIG, val);
> + if (err < 0)
> + return err;
> }
>
> return 0;
This patch is outdated. Patch v2 is sent in a different thread to replace it.
Best Regards,
Kirill
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-20 17:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 6:07 [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
2018-02-19 6:07 ` [PATCH, alsa-lib 2/2] ASoC: topology: Rename clock_gated to clock_cont in snd_soc_tplg_hw_config Kirill Marinushkin
2018-02-19 6:51 ` Takashi Sakamoto
2018-02-19 19:01 ` Kirill Marinushkin
2018-02-19 20:38 ` [PATCH, alsa-lib v2 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
2018-02-19 20:38 ` [PATCH, alsa-lib v2 2/2] ASoC: topology: Add defines for snd_soc_tplg_hw_config.clock_gated Kirill Marinushkin
2018-02-20 17:08 ` [PATCH, alsa-lib 1/2] topology: Fix parsing config with multiple hw_configs Kirill Marinushkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.