Skip to content

Commit

Permalink
ASoC: audio-graph: Expose helpers from audio graph
Browse files Browse the repository at this point in the history
This commit exposes following functions which can be used by a sound
card driver based on audio graph driver. Idea is vendors can have a
thin driver and re-use common stuff from audio graph driver.

 - graph_card_probe()
 - graph_get_dais_count()
 - graph_parse_of()

In doing so a new header file is added for audio graph which can be
included by vendor drivers.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  • Loading branch information
pujars authored and intel-lab-lkp committed Oct 1, 2020
1 parent 23a9d7c commit b7b9780
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
19 changes: 19 additions & 0 deletions include/sound/graph_card.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0
*
* ASoC audio graph card support
*
*/

#ifndef __GRAPH_CARD_H
#define __GRAPH_CARD_H

#include <sound/simple_card_utils.h>

int graph_card_probe(struct snd_soc_card *card);

void graph_get_dais_count(struct asoc_simple_priv *priv,
struct link_info *li);

int graph_parse_of(struct asoc_simple_priv *priv);

#endif /* __GRAPH_CARD_H */
11 changes: 7 additions & 4 deletions sound/soc/generic/audio-graph-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
return 0;
}

static int graph_parse_of(struct asoc_simple_priv *priv)
int graph_parse_of(struct asoc_simple_priv *priv)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
struct link_info li;
Expand Down Expand Up @@ -566,6 +566,7 @@ static int graph_parse_of(struct asoc_simple_priv *priv)

return asoc_simple_parse_card_name(card, NULL);
}
EXPORT_SYMBOL_GPL(graph_parse_of);

static int graph_count_noml(struct asoc_simple_priv *priv,
struct device_node *cpu_ep,
Expand Down Expand Up @@ -604,8 +605,8 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
return 0;
}

static void graph_get_dais_count(struct asoc_simple_priv *priv,
struct link_info *li)
void graph_get_dais_count(struct asoc_simple_priv *priv,
struct link_info *li)
{
struct device *dev = simple_priv_to_dev(priv);

Expand Down Expand Up @@ -661,8 +662,9 @@ static void graph_get_dais_count(struct asoc_simple_priv *priv,
dev_dbg(dev, "link %d, dais %d, ccnf %d\n",
li->link, li->dais, li->conf);
}
EXPORT_SYMBOL_GPL(graph_get_dais_count);

static int graph_card_probe(struct snd_soc_card *card)
int graph_card_probe(struct snd_soc_card *card)
{
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
int ret;
Expand All @@ -677,6 +679,7 @@ static int graph_card_probe(struct snd_soc_card *card)

return 0;
}
EXPORT_SYMBOL_GPL(graph_card_probe);

static int graph_probe(struct platform_device *pdev)
{
Expand Down

0 comments on commit b7b9780

Please sign in to comment.