aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-10-26 04:40:41 -0400
committerMark Brown <broonie@kernel.org>2015-11-16 05:09:29 -0500
commit37447b46e8c54c807e368d31ef6423c772b8dbbf (patch)
treedf57030c842acd23d73a8252ef6196fbe53bd550 /sound/soc/sh
parent40854c648ee79019a90034fc1f73ba2822812099 (diff)
ASoC: rsnd: move rsnd_src_ssi_irq_enable/disable() to ssi.c
Part of SSI IRQ enable/disable was controlled by SRU (on Gen1) or CMD (on Gen2). Because of this reason SSI IRQ function was implemented under src.c. but it is not understandable. Let's move it to ssi.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/rcar/rsnd.h2
-rw-r--r--sound/soc/sh/rcar/src.c28
-rw-r--r--sound/soc/sh/rcar/ssi.c32
3 files changed, 30 insertions, 32 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 996fa1ebe7c8..d6365dc2ac99 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -576,8 +576,6 @@ int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod,
576 int use_busif); 576 int use_busif);
577int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod, 577int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod,
578 struct rsnd_dai_stream *io); 578 struct rsnd_dai_stream *io);
579int rsnd_src_ssi_irq_enable(struct rsnd_mod *ssi_mod);
580int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod);
581 579
582/* 580/*
583 * R-Car CTU 581 * R-Car CTU
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index abfcc2480cf6..513094ec2312 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -210,34 +210,6 @@ int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod,
210 return 0; 210 return 0;
211} 211}
212 212
213int rsnd_src_ssi_irq_enable(struct rsnd_mod *ssi_mod)
214{
215 struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
216
217 if (rsnd_is_gen1(priv))
218 return 0;
219
220 /* enable SSI interrupt if Gen2 */
221 rsnd_mod_write(ssi_mod, SSI_INT_ENABLE,
222 rsnd_ssi_is_dma_mode(ssi_mod) ?
223 0x0e000000 : 0x0f000000);
224
225 return 0;
226}
227
228int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod)
229{
230 struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
231
232 if (rsnd_is_gen1(priv))
233 return 0;
234
235 /* disable SSI interrupt if Gen2 */
236 rsnd_mod_write(ssi_mod, SSI_INT_ENABLE, 0x00000000);
237
238 return 0;
239}
240
241static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io, 213static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io,
242 struct rsnd_src *src) 214 struct rsnd_src *src)
243{ 215{
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index d4803a82497d..c7d943411ae5 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -124,6 +124,34 @@ static void rsnd_ssi_status_check(struct rsnd_mod *mod,
124 dev_warn(dev, "status check failed\n"); 124 dev_warn(dev, "status check failed\n");
125} 125}
126 126
127static int rsnd_ssi_irq_enable(struct rsnd_mod *ssi_mod)
128{
129 struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
130
131 if (rsnd_is_gen1(priv))
132 return 0;
133
134 /* enable SSI interrupt if Gen2 */
135 rsnd_mod_write(ssi_mod, SSI_INT_ENABLE,
136 rsnd_ssi_is_dma_mode(ssi_mod) ?
137 0x0e000000 : 0x0f000000);
138
139 return 0;
140}
141
142static int rsnd_ssi_irq_disable(struct rsnd_mod *ssi_mod)
143{
144 struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
145
146 if (rsnd_is_gen1(priv))
147 return 0;
148
149 /* disable SSI interrupt if Gen2 */
150 rsnd_mod_write(ssi_mod, SSI_INT_ENABLE, 0x00000000);
151
152 return 0;
153}
154
127static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi, 155static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
128 struct rsnd_dai_stream *io) 156 struct rsnd_dai_stream *io)
129{ 157{
@@ -401,7 +429,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,
401 429
402 rsnd_ssi_hw_start(ssi, io); 430 rsnd_ssi_hw_start(ssi, io);
403 431
404 rsnd_src_ssi_irq_enable(mod); 432 rsnd_ssi_irq_enable(mod);
405 433
406 return 0; 434 return 0;
407} 435}
@@ -412,7 +440,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod,
412{ 440{
413 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 441 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
414 442
415 rsnd_src_ssi_irq_disable(mod); 443 rsnd_ssi_irq_disable(mod);
416 444
417 rsnd_ssi_record_error(ssi, rsnd_mod_read(mod, SSISR)); 445 rsnd_ssi_record_error(ssi, rsnd_mod_read(mod, SSISR));
418 446