aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/src.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/src.c')
-rw-r--r--sound/soc/sh/rcar/src.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index ea6a214985d0..eee75ebf961c 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -628,7 +628,41 @@ struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id)
628 return &((struct rsnd_src *)(priv->src) + id)->mod; 628 return &((struct rsnd_src *)(priv->src) + id)->mod;
629} 629}
630 630
631static void rsnd_of_parse_src(struct platform_device *pdev,
632 const struct rsnd_of_data *of_data,
633 struct rsnd_priv *priv)
634{
635 struct device_node *src_node;
636 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
637 struct rsnd_src_platform_info *src_info;
638 struct device *dev = &pdev->dev;
639 int nr;
640
641 if (!of_data)
642 return;
643
644 src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src");
645 if (!src_node)
646 return;
647
648 nr = of_get_child_count(src_node);
649 if (!nr)
650 return;
651
652 src_info = devm_kzalloc(dev,
653 sizeof(struct rsnd_src_platform_info) * nr,
654 GFP_KERNEL);
655 if (!src_info) {
656 dev_err(dev, "src info allocation error\n");
657 return;
658 }
659
660 info->src_info = src_info;
661 info->src_info_nr = nr;
662}
663
631int rsnd_src_probe(struct platform_device *pdev, 664int rsnd_src_probe(struct platform_device *pdev,
665 const struct rsnd_of_data *of_data,
632 struct rsnd_priv *priv) 666 struct rsnd_priv *priv)
633{ 667{
634 struct rcar_snd_info *info = rsnd_priv_to_info(priv); 668 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
@@ -639,6 +673,8 @@ int rsnd_src_probe(struct platform_device *pdev,
639 char name[RSND_SRC_NAME_SIZE]; 673 char name[RSND_SRC_NAME_SIZE];
640 int i, nr; 674 int i, nr;
641 675
676 rsnd_of_parse_src(pdev, of_data, priv);
677
642 /* 678 /*
643 * init SRC 679 * init SRC
644 */ 680 */