aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/sound/renesas,rsnd.txt8
-rw-r--r--sound/soc/sh/rcar/core.c13
-rw-r--r--sound/soc/sh/rcar/dvc.c38
3 files changed, 57 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
index 41a120c2389d..aa697abf337e 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
@@ -13,6 +13,9 @@ Required properties:
13- rcar_sound,src : Should contain SRC feature. 13- rcar_sound,src : Should contain SRC feature.
14 The number of SRC subnode should be same as HW. 14 The number of SRC subnode should be same as HW.
15 see below for detail. 15 see below for detail.
16- rcar_sound,dvc : Should contain DVC feature.
17 The number of DVC subnode should be same as HW.
18 see below for detail.
16- rcar_sound,dai : DAI contents. 19- rcar_sound,dai : DAI contents.
17 The number of DAI subnode should be same as HW. 20 The number of DAI subnode should be same as HW.
18 see below for detail. 21 see below for detail.
@@ -40,6 +43,11 @@ rcar_sound: rcar_sound@0xffd90000 {
40 <0 0xec540000 0 0x1000>, /* SSIU */ 43 <0 0xec540000 0 0x1000>, /* SSIU */
41 <0 0xec541000 0 0x1280>; /* SSI */ 44 <0 0xec541000 0 0x1280>; /* SSI */
42 45
46 rcar_sound,dvc {
47 dvc0: dvc@0 { };
48 dvc1: dvc@1 { };
49 };
50
43 rcar_sound,src { 51 rcar_sound,src {
44 src0: src@0 { }; 52 src0: src@0 { };
45 src1: src@1 { }; 53 src1: src@1 { };
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 49d9b31b185c..907d4802fd5c 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -286,7 +286,13 @@ static void rsnd_dma_of_path(struct rsnd_dma *dma,
286 mod[i] = src; 286 mod[i] = src;
287 src = NULL; 287 src = NULL;
288 } else { 288 } else {
289 mod[i] = dvc; 289 if ((!is_play) && (this == src))
290 this = dvc;
291
292 mod[i] = (is_play) ? src : dvc;
293 i++;
294 mod[i] = (is_play) ? dvc : src;
295 src = NULL;
290 dvc = NULL; 296 dvc = NULL;
291 } 297 }
292 298
@@ -719,12 +725,13 @@ static void rsnd_of_parse_dai(struct platform_device *pdev,
719 struct device_node *dai_node, *dai_np; 725 struct device_node *dai_node, *dai_np;
720 struct device_node *ssi_node, *ssi_np; 726 struct device_node *ssi_node, *ssi_np;
721 struct device_node *src_node, *src_np; 727 struct device_node *src_node, *src_np;
728 struct device_node *dvc_node, *dvc_np;
722 struct device_node *playback, *capture; 729 struct device_node *playback, *capture;
723 struct rsnd_dai_platform_info *dai_info; 730 struct rsnd_dai_platform_info *dai_info;
724 struct rcar_snd_info *info = rsnd_priv_to_info(priv); 731 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
725 struct device *dev = &pdev->dev; 732 struct device *dev = &pdev->dev;
726 int nr, i; 733 int nr, i;
727 int dai_i, ssi_i, src_i; 734 int dai_i, ssi_i, src_i, dvc_i;
728 735
729 if (!of_data) 736 if (!of_data)
730 return; 737 return;
@@ -750,6 +757,7 @@ static void rsnd_of_parse_dai(struct platform_device *pdev,
750 757
751 ssi_node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi"); 758 ssi_node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi");
752 src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src"); 759 src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src");
760 dvc_node = of_get_child_by_name(dev->of_node, "rcar_sound,dvc");
753 761
754#define mod_parse(name) \ 762#define mod_parse(name) \
755if (name##_node) { \ 763if (name##_node) { \
@@ -785,6 +793,7 @@ if (name##_node) { \
785 793
786 mod_parse(ssi); 794 mod_parse(ssi);
787 mod_parse(src); 795 mod_parse(src);
796 mod_parse(dvc);
788 797
789 if (playback) 798 if (playback)
790 of_node_put(playback); 799 of_node_put(playback);
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index deef310c75dc..9096fb03d001 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -235,6 +235,42 @@ struct rsnd_mod *rsnd_dvc_mod_get(struct rsnd_priv *priv, int id)
235 return &((struct rsnd_dvc *)(priv->dvc) + id)->mod; 235 return &((struct rsnd_dvc *)(priv->dvc) + id)->mod;
236} 236}
237 237
238static void rsnd_of_parse_dvc(struct platform_device *pdev,
239 const struct rsnd_of_data *of_data,
240 struct rsnd_priv *priv)
241{
242 struct device_node *node;
243 struct rsnd_dvc_platform_info *dvc_info;
244 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
245 struct device *dev = &pdev->dev;
246 int nr;
247
248 if (!of_data)
249 return;
250
251 node = of_get_child_by_name(dev->of_node, "rcar_sound,dvc");
252 if (!node)
253 return;
254
255 nr = of_get_child_count(node);
256 if (!nr)
257 goto rsnd_of_parse_dvc_end;
258
259 dvc_info = devm_kzalloc(dev,
260 sizeof(struct rsnd_dvc_platform_info) * nr,
261 GFP_KERNEL);
262 if (!dvc_info) {
263 dev_err(dev, "dvc info allocation error\n");
264 goto rsnd_of_parse_dvc_end;
265 }
266
267 info->dvc_info = dvc_info;
268 info->dvc_info_nr = nr;
269
270rsnd_of_parse_dvc_end:
271 of_node_put(node);
272}
273
238int rsnd_dvc_probe(struct platform_device *pdev, 274int rsnd_dvc_probe(struct platform_device *pdev,
239 const struct rsnd_of_data *of_data, 275 const struct rsnd_of_data *of_data,
240 struct rsnd_priv *priv) 276 struct rsnd_priv *priv)
@@ -246,6 +282,8 @@ int rsnd_dvc_probe(struct platform_device *pdev,
246 char name[RSND_DVC_NAME_SIZE]; 282 char name[RSND_DVC_NAME_SIZE];
247 int i, nr; 283 int i, nr;
248 284
285 rsnd_of_parse_dvc(pdev, of_data, priv);
286
249 nr = info->dvc_info_nr; 287 nr = info->dvc_info_nr;
250 if (!nr) 288 if (!nr)
251 return 0; 289 return 0;