[4/4] ASoC: simple-card: parse symmetric-clock-roles property

Message ID 20230602090322.1876359-5-alvin@pqrs.dk
State New
Headers
Series ASoC: support dai-links with symmetric clock roles |

Commit Message

Alvin Šipraga June 2, 2023, 9:03 a.m. UTC
  From: Alvin Šipraga <alsi@bang-olufsen.dk>

The property, when set, specifies that both ends of the dai-link should
have the same clock consumer/provider roles. As with other simple-card
properties, a prefix can be specified.

Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
---
 sound/soc/generic/simple-card.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Kuninori Morimoto June 5, 2023, 12:28 a.m. UTC | #1
Hi Alvin

Thank you for the patch

> --- a/sound/soc/generic/simple-card.c
> +++ b/sound/soc/generic/simple-card.c
> @@ -181,6 +181,7 @@ static int simple_link_init(struct asoc_simple_priv *priv,
>  {
>  	struct device *dev = simple_priv_to_dev(priv);
>  	struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
> +	char prop[128];
>  	int ret;
>  
>  	ret = asoc_simple_parse_daifmt(dev, node, codec,
> @@ -188,6 +189,9 @@ static int simple_link_init(struct asoc_simple_priv *priv,
>  	if (ret < 0)
>  		return 0;
>  
> +	snprintf(prop, sizeof(prop), "%ssymmetric-clock-roles", prefix);
> +	dai_link->symmetric_clock_roles = of_property_read_bool(node, prop);
> +
>  	dai_link->init			= asoc_simple_dai_init;
>  	dai_link->ops			= &simple_ops;

looks good to me.

simple-card / audio-graph-card / audio-graph-card2 want to support same settings
(But unfortunately it is not completely synchronized...).

Could you please add same settings or indicate it on the comment
(like /* FIXME support symmetric-clock-roles here */, etc)
on audio-graph-card, if you create v2 patch ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto
  
Alvin Šipraga June 5, 2023, 11:12 a.m. UTC | #2
Hi Kuninori,

On Mon, Jun 05, 2023 at 12:28:14AM +0000, Kuninori Morimoto wrote:
> 
> Hi Alvin
> 
> Thank you for the patch
> 
> > --- a/sound/soc/generic/simple-card.c
> > +++ b/sound/soc/generic/simple-card.c
> > @@ -181,6 +181,7 @@ static int simple_link_init(struct asoc_simple_priv *priv,
> >  {
> >  	struct device *dev = simple_priv_to_dev(priv);
> >  	struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
> > +	char prop[128];
> >  	int ret;
> >  
> >  	ret = asoc_simple_parse_daifmt(dev, node, codec,
> > @@ -188,6 +189,9 @@ static int simple_link_init(struct asoc_simple_priv *priv,
> >  	if (ret < 0)
> >  		return 0;
> >  
> > +	snprintf(prop, sizeof(prop), "%ssymmetric-clock-roles", prefix);
> > +	dai_link->symmetric_clock_roles = of_property_read_bool(node, prop);
> > +
> >  	dai_link->init			= asoc_simple_dai_init;
> >  	dai_link->ops			= &simple_ops;
> 
> looks good to me.
> 
> simple-card / audio-graph-card / audio-graph-card2 want to support same settings
> (But unfortunately it is not completely synchronized...).
> 
> Could you please add same settings or indicate it on the comment
> (like /* FIXME support symmetric-clock-roles here */, etc)
> on audio-graph-card, if you create v2 patch ?
> 
> Thank you for your help !!

Sure. If I send a v2, I will add a patch for audio-graph-card as well. :)

Kind regards,
Alvin
  

Patch

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 5a5e4ecd0f61..4513e30948b7 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -181,6 +181,7 @@  static int simple_link_init(struct asoc_simple_priv *priv,
 {
 	struct device *dev = simple_priv_to_dev(priv);
 	struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
+	char prop[128];
 	int ret;
 
 	ret = asoc_simple_parse_daifmt(dev, node, codec,
@@ -188,6 +189,9 @@  static int simple_link_init(struct asoc_simple_priv *priv,
 	if (ret < 0)
 		return 0;
 
+	snprintf(prop, sizeof(prop), "%ssymmetric-clock-roles", prefix);
+	dai_link->symmetric_clock_roles = of_property_read_bool(node, prop);
+
 	dai_link->init			= asoc_simple_dai_init;
 	dai_link->ops			= &simple_ops;