aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-07-15 03:17:17 -0400
committerMark Brown <broonie@kernel.org>2015-07-17 14:26:06 -0400
commit9269e3c3cfac277a49b485e27ac6850f9a11a259 (patch)
tree05e6a3dbe0b762f759eb65ec525ee11ebaa63ad0
parent7dfb49194557ccf27ab99c8c04c021320e7ae458 (diff)
ASoC: rsnd: add CTU (Channel Transfer Unit) prototype support
This patch adds CTU (Channel Transfer Unit) support for rsnd driver. But, it does nothing to data at this point, but is required for MIX support. CTU design is a little different from other IPs (CTU0 is including CTU00 - CTU03, and CTU1 is including CTU10 - CTU13, these have different register mapping) We need to care about it on this driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/sound/renesas,rsnd.txt14
-rw-r--r--include/sound/rcar_snd.h7
-rw-r--r--sound/soc/sh/rcar/Makefile2
-rw-r--r--sound/soc/sh/rcar/core.c12
-rw-r--r--sound/soc/sh/rcar/ctu.c171
-rw-r--r--sound/soc/sh/rcar/dma.c13
-rw-r--r--sound/soc/sh/rcar/gen.c2
-rw-r--r--sound/soc/sh/rcar/rsnd.h21
8 files changed, 236 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
index b6b3a786855f..278607de05de 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
@@ -18,6 +18,9 @@ Required properties:
18- rcar_sound,src : Should contain SRC feature. 18- rcar_sound,src : Should contain SRC feature.
19 The number of SRC subnode should be same as HW. 19 The number of SRC subnode should be same as HW.
20 see below for detail. 20 see below for detail.
21- rcar_sound,ctu : Should contain CTU feature.
22 The number of CTU subnode should be same as HW.
23 see below for detail.
21- rcar_sound,dvc : Should contain DVC feature. 24- rcar_sound,dvc : Should contain DVC feature.
22 The number of DVC subnode should be same as HW. 25 The number of DVC subnode should be same as HW.
23 see below for detail. 26 see below for detail.
@@ -90,6 +93,17 @@ rcar_sound: sound@ec500000 {
90 }; 93 };
91 }; 94 };
92 95
96 rcar_sound,ctu {
97 ctu00: ctu@0 { };
98 ctu01: ctu@1 { };
99 ctu02: ctu@2 { };
100 ctu03: ctu@3 { };
101 ctu10: ctu@4 { };
102 ctu11: ctu@5 { };
103 ctu12: ctu@6 { };
104 ctu13: ctu@7 { };
105 };
106
93 rcar_sound,src { 107 rcar_sound,src {
94 src0: src@0 { 108 src0: src@0 {
95 interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>; 109 interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
index 4cecd0c175f6..8f9303093ab9 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -61,6 +61,10 @@ struct rsnd_src_platform_info {
61/* 61/*
62 * flags 62 * flags
63 */ 63 */
64struct rsnd_ctu_platform_info {
65 u32 flags;
66};
67
64struct rsnd_dvc_platform_info { 68struct rsnd_dvc_platform_info {
65 u32 flags; 69 u32 flags;
66}; 70};
@@ -68,6 +72,7 @@ struct rsnd_dvc_platform_info {
68struct rsnd_dai_path_info { 72struct rsnd_dai_path_info {
69 struct rsnd_ssi_platform_info *ssi; 73 struct rsnd_ssi_platform_info *ssi;
70 struct rsnd_src_platform_info *src; 74 struct rsnd_src_platform_info *src;
75 struct rsnd_ctu_platform_info *ctu;
71 struct rsnd_dvc_platform_info *dvc; 76 struct rsnd_dvc_platform_info *dvc;
72}; 77};
73 78
@@ -93,6 +98,8 @@ struct rcar_snd_info {
93 int ssi_info_nr; 98 int ssi_info_nr;
94 struct rsnd_src_platform_info *src_info; 99 struct rsnd_src_platform_info *src_info;
95 int src_info_nr; 100 int src_info_nr;
101 struct rsnd_ctu_platform_info *ctu_info;
102 int ctu_info_nr;
96 struct rsnd_dvc_platform_info *dvc_info; 103 struct rsnd_dvc_platform_info *dvc_info;
97 int dvc_info_nr; 104 int dvc_info_nr;
98 struct rsnd_dai_platform_info *dai_info; 105 struct rsnd_dai_platform_info *dai_info;
diff --git a/sound/soc/sh/rcar/Makefile b/sound/soc/sh/rcar/Makefile
index 3a274fd3593c..7c4730a81c4a 100644
--- a/sound/soc/sh/rcar/Makefile
+++ b/sound/soc/sh/rcar/Makefile
@@ -1,4 +1,4 @@
1snd-soc-rcar-objs := core.o gen.o dma.o adg.o ssi.o src.o dvc.o 1snd-soc-rcar-objs := core.o gen.o dma.o adg.o ssi.o src.o ctu.o dvc.o
2obj-$(CONFIG_SND_SOC_RCAR) += snd-soc-rcar.o 2obj-$(CONFIG_SND_SOC_RCAR) += snd-soc-rcar.o
3 3
4snd-soc-rsrc-card-objs := rsrc-card.o 4snd-soc-rsrc-card-objs := rsrc-card.o
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index e20d8ea0aafe..63ae7bbfd1dc 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -651,6 +651,11 @@ static int rsnd_path_init(struct rsnd_priv *priv,
651 if (ret < 0) 651 if (ret < 0)
652 return ret; 652 return ret;
653 653
654 /* CTU */
655 ret = rsnd_path_add(priv, io, ctu);
656 if (ret < 0)
657 return ret;
658
654 /* DVC */ 659 /* DVC */
655 ret = rsnd_path_add(priv, io, dvc); 660 ret = rsnd_path_add(priv, io, dvc);
656 if (ret < 0) 661 if (ret < 0)
@@ -666,13 +671,14 @@ static void rsnd_of_parse_dai(struct platform_device *pdev,
666 struct device_node *dai_node, *dai_np; 671 struct device_node *dai_node, *dai_np;
667 struct device_node *ssi_node, *ssi_np; 672 struct device_node *ssi_node, *ssi_np;
668 struct device_node *src_node, *src_np; 673 struct device_node *src_node, *src_np;
674 struct device_node *ctu_node, *ctu_np;
669 struct device_node *dvc_node, *dvc_np; 675 struct device_node *dvc_node, *dvc_np;
670 struct device_node *playback, *capture; 676 struct device_node *playback, *capture;
671 struct rsnd_dai_platform_info *dai_info; 677 struct rsnd_dai_platform_info *dai_info;
672 struct rcar_snd_info *info = rsnd_priv_to_info(priv); 678 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
673 struct device *dev = &pdev->dev; 679 struct device *dev = &pdev->dev;
674 int nr, i; 680 int nr, i;
675 int dai_i, ssi_i, src_i, dvc_i; 681 int dai_i, ssi_i, src_i, ctu_i, dvc_i;
676 682
677 if (!of_data) 683 if (!of_data)
678 return; 684 return;
@@ -698,6 +704,7 @@ static void rsnd_of_parse_dai(struct platform_device *pdev,
698 704
699 ssi_node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi"); 705 ssi_node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi");
700 src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src"); 706 src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src");
707 ctu_node = of_get_child_by_name(dev->of_node, "rcar_sound,ctu");
701 dvc_node = of_get_child_by_name(dev->of_node, "rcar_sound,dvc"); 708 dvc_node = of_get_child_by_name(dev->of_node, "rcar_sound,dvc");
702 709
703#define mod_parse(name) \ 710#define mod_parse(name) \
@@ -734,6 +741,7 @@ if (name##_node) { \
734 741
735 mod_parse(ssi); 742 mod_parse(ssi);
736 mod_parse(src); 743 mod_parse(src);
744 mod_parse(ctu);
737 mod_parse(dvc); 745 mod_parse(dvc);
738 746
739 of_node_put(playback); 747 of_node_put(playback);
@@ -1146,6 +1154,7 @@ static int rsnd_probe(struct platform_device *pdev)
1146 rsnd_dma_probe, 1154 rsnd_dma_probe,
1147 rsnd_ssi_probe, 1155 rsnd_ssi_probe,
1148 rsnd_src_probe, 1156 rsnd_src_probe,
1157 rsnd_ctu_probe,
1149 rsnd_dvc_probe, 1158 rsnd_dvc_probe,
1150 rsnd_adg_probe, 1159 rsnd_adg_probe,
1151 rsnd_dai_probe, 1160 rsnd_dai_probe,
@@ -1241,6 +1250,7 @@ static int rsnd_remove(struct platform_device *pdev)
1241 struct rsnd_priv *priv) = { 1250 struct rsnd_priv *priv) = {
1242 rsnd_ssi_remove, 1251 rsnd_ssi_remove,
1243 rsnd_src_remove, 1252 rsnd_src_remove,
1253 rsnd_ctu_remove,
1244 rsnd_dvc_remove, 1254 rsnd_dvc_remove,
1245 }; 1255 };
1246 int ret = 0, i; 1256 int ret = 0, i;
diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c
new file mode 100644
index 000000000000..05edd2009b81
--- /dev/null
+++ b/sound/soc/sh/rcar/ctu.c
@@ -0,0 +1,171 @@
1/*
2 * ctu.c
3 *
4 * Copyright (c) 2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include "rsnd.h"
11
12#define CTU_NAME_SIZE 16
13#define CTU_NAME "ctu"
14
15struct rsnd_ctu {
16 struct rsnd_ctu_platform_info *info; /* rcar_snd.h */
17 struct rsnd_mod mod;
18};
19
20#define rsnd_ctu_nr(priv) ((priv)->ctu_nr)
21#define for_each_rsnd_ctu(pos, priv, i) \
22 for ((i) = 0; \
23 ((i) < rsnd_ctu_nr(priv)) && \
24 ((pos) = (struct rsnd_ctu *)(priv)->ctu + i); \
25 i++)
26
27#define rsnd_ctu_initialize_lock(mod) __rsnd_ctu_initialize_lock(mod, 1)
28#define rsnd_ctu_initialize_unlock(mod) __rsnd_ctu_initialize_lock(mod, 0)
29static void __rsnd_ctu_initialize_lock(struct rsnd_mod *mod, u32 enable)
30{
31 rsnd_mod_write(mod, CTU_CTUIR, enable);
32}
33
34static int rsnd_ctu_init(struct rsnd_mod *mod,
35 struct rsnd_dai_stream *io,
36 struct rsnd_priv *priv)
37{
38 rsnd_mod_hw_start(mod);
39
40 rsnd_ctu_initialize_lock(mod);
41
42 rsnd_mod_write(mod, CTU_ADINR, rsnd_get_adinr_chan(mod, io));
43
44 rsnd_ctu_initialize_unlock(mod);
45
46 return 0;
47}
48
49static int rsnd_ctu_quit(struct rsnd_mod *mod,
50 struct rsnd_dai_stream *io,
51 struct rsnd_priv *priv)
52{
53 rsnd_mod_hw_stop(mod);
54
55 return 0;
56}
57
58static struct rsnd_mod_ops rsnd_ctu_ops = {
59 .name = CTU_NAME,
60 .init = rsnd_ctu_init,
61 .quit = rsnd_ctu_quit,
62};
63
64struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id)
65{
66 if (WARN_ON(id < 0 || id >= rsnd_ctu_nr(priv)))
67 id = 0;
68
69 return &((struct rsnd_ctu *)(priv->ctu) + id)->mod;
70}
71
72void rsnd_of_parse_ctu(struct platform_device *pdev,
73 const struct rsnd_of_data *of_data,
74 struct rsnd_priv *priv)
75{
76 struct device_node *node;
77 struct rsnd_ctu_platform_info *ctu_info;
78 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
79 struct device *dev = &pdev->dev;
80 int nr;
81
82 if (!of_data)
83 return;
84
85 node = of_get_child_by_name(dev->of_node, "rcar_sound,ctu");
86 if (!node)
87 return;
88
89 nr = of_get_child_count(node);
90 if (!nr)
91 goto rsnd_of_parse_ctu_end;
92
93 ctu_info = devm_kzalloc(dev,
94 sizeof(struct rsnd_ctu_platform_info) * nr,
95 GFP_KERNEL);
96 if (!ctu_info) {
97 dev_err(dev, "ctu info allocation error\n");
98 goto rsnd_of_parse_ctu_end;
99 }
100
101 info->ctu_info = ctu_info;
102 info->ctu_info_nr = nr;
103
104rsnd_of_parse_ctu_end:
105 of_node_put(node);
106
107}
108
109int rsnd_ctu_probe(struct platform_device *pdev,
110 const struct rsnd_of_data *of_data,
111 struct rsnd_priv *priv)
112{
113 struct rcar_snd_info *info = rsnd_priv_to_info(priv);
114 struct device *dev = rsnd_priv_to_dev(priv);
115 struct rsnd_ctu *ctu;
116 struct clk *clk;
117 char name[CTU_NAME_SIZE];
118 int i, nr, ret;
119
120 /* This driver doesn't support Gen1 at this point */
121 if (rsnd_is_gen1(priv)) {
122 dev_warn(dev, "CTU is not supported on Gen1\n");
123 return -EINVAL;
124 }
125
126 rsnd_of_parse_ctu(pdev, of_data, priv);
127
128 nr = info->ctu_info_nr;
129 if (!nr)
130 return 0;
131
132 ctu = devm_kzalloc(dev, sizeof(*ctu) * nr, GFP_KERNEL);
133 if (!ctu)
134 return -ENOMEM;
135
136 priv->ctu_nr = nr;
137 priv->ctu = ctu;
138
139 for_each_rsnd_ctu(ctu, priv, i) {
140 /*
141 * CTU00, CTU01, CTU02, CTU03 => CTU0
142 * CTU10, CTU11, CTU12, CTU13 => CTU1
143 */
144 snprintf(name, CTU_NAME_SIZE, "%s.%d",
145 CTU_NAME, i / 4);
146
147 clk = devm_clk_get(dev, name);
148 if (IS_ERR(clk))
149 return PTR_ERR(clk);
150
151 ctu->info = &info->ctu_info[i];
152
153 ret = rsnd_mod_init(priv, &ctu->mod, &rsnd_ctu_ops,
154 clk, RSND_MOD_CTU, i);
155 if (ret)
156 return ret;
157 }
158
159 return 0;
160}
161
162void rsnd_ctu_remove(struct platform_device *pdev,
163 struct rsnd_priv *priv)
164{
165 struct rsnd_ctu *ctu;
166 int i;
167
168 for_each_rsnd_ctu(ctu, priv, i) {
169 rsnd_mod_quit(&ctu->mod);
170 }
171}
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 23282f48f71f..229b68d2cf70 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -426,7 +426,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io,
426 phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SCU); 426 phys_addr_t src_reg = rsnd_gen_get_phy_addr(priv, RSND_GEN2_SCU);
427 int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod); 427 int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod);
428 int use_src = !!rsnd_io_to_mod_src(io); 428 int use_src = !!rsnd_io_to_mod_src(io);
429 int use_dvc = !!rsnd_io_to_mod_dvc(io); 429 int use_cmd = !!rsnd_io_to_mod_dvc(io) ||
430 !!rsnd_io_to_mod_ctu(io);
430 int id = rsnd_mod_id(mod); 431 int id = rsnd_mod_id(mod);
431 struct dma_addr { 432 struct dma_addr {
432 dma_addr_t out_addr; 433 dma_addr_t out_addr;
@@ -464,7 +465,7 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io,
464 }; 465 };
465 466
466 /* it shouldn't happen */ 467 /* it shouldn't happen */
467 if (use_dvc && !use_src) 468 if (use_cmd && !use_src)
468 dev_err(dev, "DVC is selected without SRC\n"); 469 dev_err(dev, "DVC is selected without SRC\n");
469 470
470 /* use SSIU or SSI ? */ 471 /* use SSIU or SSI ? */
@@ -472,8 +473,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io,
472 is_ssi++; 473 is_ssi++;
473 474
474 return (is_from) ? 475 return (is_from) ?
475 dma_addrs[is_ssi][is_play][use_src + use_dvc].out_addr : 476 dma_addrs[is_ssi][is_play][use_src + use_cmd].out_addr :
476 dma_addrs[is_ssi][is_play][use_src + use_dvc].in_addr; 477 dma_addrs[is_ssi][is_play][use_src + use_cmd].in_addr;
477} 478}
478 479
479static dma_addr_t rsnd_dma_addr(struct rsnd_dai_stream *io, 480static dma_addr_t rsnd_dma_addr(struct rsnd_dai_stream *io,
@@ -504,6 +505,7 @@ static void rsnd_dma_of_path(struct rsnd_dma *dma,
504 struct rsnd_mod *this = rsnd_dma_to_mod(dma); 505 struct rsnd_mod *this = rsnd_dma_to_mod(dma);
505 struct rsnd_mod *ssi = rsnd_io_to_mod_ssi(io); 506 struct rsnd_mod *ssi = rsnd_io_to_mod_ssi(io);
506 struct rsnd_mod *src = rsnd_io_to_mod_src(io); 507 struct rsnd_mod *src = rsnd_io_to_mod_src(io);
508 struct rsnd_mod *ctu = rsnd_io_to_mod_ctu(io);
507 struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io); 509 struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io);
508 struct rsnd_mod *mod[MOD_MAX]; 510 struct rsnd_mod *mod[MOD_MAX];
509 struct rsnd_mod *mod_start, *mod_end; 511 struct rsnd_mod *mod_start, *mod_end;
@@ -543,6 +545,9 @@ static void rsnd_dma_of_path(struct rsnd_dma *dma,
543 if (src) { 545 if (src) {
544 mod[i] = src; 546 mod[i] = src;
545 src = NULL; 547 src = NULL;
548 } else if (ctu) {
549 mod[i] = ctu;
550 ctu = NULL;
546 } else if (dvc) { 551 } else if (dvc) {
547 mod[i] = dvc; 552 mod[i] = dvc;
548 dvc = NULL; 553 dvc = NULL;
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index a2d5df4d5d17..41b75cd4e09b 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -240,6 +240,8 @@ static int rsnd_gen2_probe(struct platform_device *pdev,
240 RSND_GEN_M_REG(SRC_SRCCR, 0x224, 0x40), 240 RSND_GEN_M_REG(SRC_SRCCR, 0x224, 0x40),
241 RSND_GEN_M_REG(SRC_BSDSR, 0x22c, 0x40), 241 RSND_GEN_M_REG(SRC_BSDSR, 0x22c, 0x40),
242 RSND_GEN_M_REG(SRC_BSISR, 0x238, 0x40), 242 RSND_GEN_M_REG(SRC_BSISR, 0x238, 0x40),
243 RSND_GEN_M_REG(CTU_CTUIR, 0x504, 0x100),
244 RSND_GEN_M_REG(CTU_ADINR, 0x508, 0x100),
243 RSND_GEN_M_REG(DVC_SWRSR, 0xe00, 0x100), 245 RSND_GEN_M_REG(DVC_SWRSR, 0xe00, 0x100),
244 RSND_GEN_M_REG(DVC_DVUIR, 0xe04, 0x100), 246 RSND_GEN_M_REG(DVC_DVUIR, 0xe04, 0x100),
245 RSND_GEN_M_REG(DVC_ADINR, 0xe08, 0x100), 247 RSND_GEN_M_REG(DVC_ADINR, 0xe08, 0x100),
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 7fee2079ba5a..f2128a7cf259 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -47,6 +47,8 @@ enum rsnd_reg {
47 RSND_REG_SCU_SYS_STATUS0, 47 RSND_REG_SCU_SYS_STATUS0,
48 RSND_REG_SCU_SYS_INT_EN0, 48 RSND_REG_SCU_SYS_INT_EN0,
49 RSND_REG_CMD_ROUTE_SLCT, 49 RSND_REG_CMD_ROUTE_SLCT,
50 RSND_REG_CTU_CTUIR,
51 RSND_REG_CTU_ADINR,
50 RSND_REG_DVC_SWRSR, 52 RSND_REG_DVC_SWRSR,
51 RSND_REG_DVC_DVUIR, 53 RSND_REG_DVC_DVUIR,
52 RSND_REG_DVC_ADINR, 54 RSND_REG_DVC_ADINR,
@@ -220,6 +222,7 @@ struct dma_chan *rsnd_dma_request_channel(struct device_node *of_node,
220 */ 222 */
221enum rsnd_mod_type { 223enum rsnd_mod_type {
222 RSND_MOD_DVC = 0, 224 RSND_MOD_DVC = 0,
225 RSND_MOD_CTU,
223 RSND_MOD_SRC, 226 RSND_MOD_SRC,
224 RSND_MOD_SSI, 227 RSND_MOD_SSI,
225 RSND_MOD_MAX, 228 RSND_MOD_MAX,
@@ -351,6 +354,7 @@ struct rsnd_dai_stream {
351#define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL) 354#define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
352#define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI) 355#define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
353#define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC) 356#define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC)
357#define rsnd_io_to_mod_ctu(io) rsnd_io_to_mod((io), RSND_MOD_CTU)
354#define rsnd_io_to_mod_dvc(io) rsnd_io_to_mod((io), RSND_MOD_DVC) 358#define rsnd_io_to_mod_dvc(io) rsnd_io_to_mod((io), RSND_MOD_DVC)
355#define rsnd_io_to_rdai(io) ((io)->rdai) 359#define rsnd_io_to_rdai(io) ((io)->rdai)
356#define rsnd_io_to_priv(io) (rsnd_rdai_to_priv(rsnd_io_to_rdai(io))) 360#define rsnd_io_to_priv(io) (rsnd_rdai_to_priv(rsnd_io_to_rdai(io)))
@@ -463,6 +467,12 @@ struct rsnd_priv {
463 int src_nr; 467 int src_nr;
464 468
465 /* 469 /*
470 * below value will be filled on rsnd_ctu_probe()
471 */
472 void *ctu;
473 int ctu_nr;
474
475 /*
466 * below value will be filled on rsnd_dvc_probe() 476 * below value will be filled on rsnd_dvc_probe()
467 */ 477 */
468 void *dvc; 478 void *dvc;
@@ -568,6 +578,17 @@ int rsnd_src_ssi_irq_enable(struct rsnd_mod *ssi_mod);
568int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod); 578int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod);
569 579
570/* 580/*
581 * R-Car CTU
582 */
583int rsnd_ctu_probe(struct platform_device *pdev,
584 const struct rsnd_of_data *of_data,
585 struct rsnd_priv *priv);
586
587void rsnd_ctu_remove(struct platform_device *pdev,
588 struct rsnd_priv *priv);
589struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id);
590
591/*
571 * R-Car DVC 592 * R-Car DVC
572 */ 593 */
573int rsnd_dvc_probe(struct platform_device *pdev, 594int rsnd_dvc_probe(struct platform_device *pdev,