aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/sh/rcar/core.c41
-rw-r--r--sound/soc/sh/rcar/dvc.c13
-rw-r--r--sound/soc/sh/rcar/rsnd.h15
-rw-r--r--sound/soc/sh/rcar/src.c25
-rw-r--r--sound/soc/sh/rcar/ssi.c39
5 files changed, 60 insertions, 73 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 74e2c4214058..6fa8709571ff 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -414,7 +414,7 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod)
414/* 414/*
415 * rsnd_dai functions 415 * rsnd_dai functions
416 */ 416 */
417#define __rsnd_mod_call(mod, func, rdai...) \ 417#define __rsnd_mod_call(mod, func, param...) \
418({ \ 418({ \
419 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \ 419 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
420 struct device *dev = rsnd_priv_to_dev(priv); \ 420 struct device *dev = rsnd_priv_to_dev(priv); \
@@ -424,18 +424,18 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod)
424 if ((mod->status & mask) == call) { \ 424 if ((mod->status & mask) == call) { \
425 dev_dbg(dev, "%s[%d] %s\n", \ 425 dev_dbg(dev, "%s[%d] %s\n", \
426 rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \ 426 rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
427 ret = (mod)->ops->func(mod, rdai); \ 427 ret = (mod)->ops->func(mod, param); \
428 mod->status = (mod->status & ~mask) | (~call & mask); \ 428 mod->status = (mod->status & ~mask) | (~call & mask); \
429 } \ 429 } \
430 ret; \ 430 ret; \
431}) 431})
432 432
433#define rsnd_mod_call(mod, func, rdai...) \ 433#define rsnd_mod_call(mod, func, param...) \
434 (!(mod) ? -ENODEV : \ 434 (!(mod) ? -ENODEV : \
435 !((mod)->ops->func) ? 0 : \ 435 !((mod)->ops->func) ? 0 : \
436 __rsnd_mod_call(mod, func, rdai)) 436 __rsnd_mod_call(mod, func, param))
437 437
438#define rsnd_dai_call(fn, io, rdai...) \ 438#define rsnd_dai_call(fn, io, param...) \
439({ \ 439({ \
440 struct rsnd_mod *mod; \ 440 struct rsnd_mod *mod; \
441 int ret = 0, i; \ 441 int ret = 0, i; \
@@ -443,7 +443,7 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod)
443 mod = (io)->mod[i]; \ 443 mod = (io)->mod[i]; \
444 if (!mod) \ 444 if (!mod) \
445 continue; \ 445 continue; \
446 ret = rsnd_mod_call(mod, fn, rdai); \ 446 ret = rsnd_mod_call(mod, fn, param); \
447 if (ret < 0) \ 447 if (ret < 0) \
448 break; \ 448 break; \
449 } \ 449 } \
@@ -585,20 +585,20 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
585 if (ret < 0) 585 if (ret < 0)
586 goto dai_trigger_end; 586 goto dai_trigger_end;
587 587
588 ret = rsnd_dai_call(init, io, rdai); 588 ret = rsnd_dai_call(init, io, priv);
589 if (ret < 0) 589 if (ret < 0)
590 goto dai_trigger_end; 590 goto dai_trigger_end;
591 591
592 ret = rsnd_dai_call(start, io, rdai); 592 ret = rsnd_dai_call(start, io, priv);
593 if (ret < 0) 593 if (ret < 0)
594 goto dai_trigger_end; 594 goto dai_trigger_end;
595 break; 595 break;
596 case SNDRV_PCM_TRIGGER_STOP: 596 case SNDRV_PCM_TRIGGER_STOP:
597 ret = rsnd_dai_call(stop, io, rdai); 597 ret = rsnd_dai_call(stop, io, priv);
598 if (ret < 0) 598 if (ret < 0)
599 goto dai_trigger_end; 599 goto dai_trigger_end;
600 600
601 ret = rsnd_dai_call(quit, io, rdai); 601 ret = rsnd_dai_call(quit, io, priv);
602 if (ret < 0) 602 if (ret < 0)
603 goto dai_trigger_end; 603 goto dai_trigger_end;
604 604
@@ -1109,11 +1109,11 @@ static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
1109 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); 1109 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
1110 int ret; 1110 int ret;
1111 1111
1112 ret = rsnd_dai_call(pcm_new, &rdai->playback, rdai, rtd); 1112 ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
1113 if (ret) 1113 if (ret)
1114 return ret; 1114 return ret;
1115 1115
1116 ret = rsnd_dai_call(pcm_new, &rdai->capture, rdai, rtd); 1116 ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
1117 if (ret) 1117 if (ret)
1118 return ret; 1118 return ret;
1119 1119
@@ -1136,10 +1136,9 @@ static const struct snd_soc_component_driver rsnd_soc_component = {
1136static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv, 1136static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
1137 struct rsnd_dai_stream *io) 1137 struct rsnd_dai_stream *io)
1138{ 1138{
1139 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
1140 int ret; 1139 int ret;
1141 1140
1142 ret = rsnd_dai_call(probe, io, rdai); 1141 ret = rsnd_dai_call(probe, io, priv);
1143 if (ret == -EAGAIN) { 1142 if (ret == -EAGAIN) {
1144 /* 1143 /*
1145 * Fallback to PIO mode 1144 * Fallback to PIO mode
@@ -1152,7 +1151,7 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
1152 * rsnd_dma_init() 1151 * rsnd_dma_init()
1153 * rsnd_ssi_fallback() 1152 * rsnd_ssi_fallback()
1154 */ 1153 */
1155 rsnd_dai_call(remove, io, rdai); 1154 rsnd_dai_call(remove, io, priv);
1156 1155
1157 /* 1156 /*
1158 * remove SRC/DVC from DAI, 1157 * remove SRC/DVC from DAI,
@@ -1163,13 +1162,13 @@ static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
1163 /* 1162 /*
1164 * fallback 1163 * fallback
1165 */ 1164 */
1166 rsnd_dai_call(fallback, io, rdai); 1165 rsnd_dai_call(fallback, io, priv);
1167 1166
1168 /* 1167 /*
1169 * retry to "probe". 1168 * retry to "probe".
1170 * DAI has SSI which is PIO mode only now. 1169 * DAI has SSI which is PIO mode only now.
1171 */ 1170 */
1172 ret = rsnd_dai_call(probe, io, rdai); 1171 ret = rsnd_dai_call(probe, io, priv);
1173 } 1172 }
1174 1173
1175 return ret; 1174 return ret;
@@ -1272,8 +1271,8 @@ exit_snd_soc:
1272 snd_soc_unregister_platform(dev); 1271 snd_soc_unregister_platform(dev);
1273exit_snd_probe: 1272exit_snd_probe:
1274 for_each_rsnd_dai(rdai, priv, i) { 1273 for_each_rsnd_dai(rdai, priv, i) {
1275 rsnd_dai_call(remove, &rdai->playback, rdai); 1274 rsnd_dai_call(remove, &rdai->playback, priv);
1276 rsnd_dai_call(remove, &rdai->capture, rdai); 1275 rsnd_dai_call(remove, &rdai->capture, priv);
1277 } 1276 }
1278 1277
1279 return ret; 1278 return ret;
@@ -1288,8 +1287,8 @@ static int rsnd_remove(struct platform_device *pdev)
1288 pm_runtime_disable(&pdev->dev); 1287 pm_runtime_disable(&pdev->dev);
1289 1288
1290 for_each_rsnd_dai(rdai, priv, i) { 1289 for_each_rsnd_dai(rdai, priv, i) {
1291 ret |= rsnd_dai_call(remove, &rdai->playback, rdai); 1290 ret |= rsnd_dai_call(remove, &rdai->playback, priv);
1292 ret |= rsnd_dai_call(remove, &rdai->capture, rdai); 1291 ret |= rsnd_dai_call(remove, &rdai->capture, priv);
1293 } 1292 }
1294 1293
1295 return ret; 1294 return ret;
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index e24db9e4ee25..4ddca4f380c7 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -117,9 +117,8 @@ static void rsnd_dvc_volume_update(struct rsnd_mod *mod)
117} 117}
118 118
119static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod, 119static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod,
120 struct rsnd_dai *rdai) 120 struct rsnd_priv *priv)
121{ 121{
122 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
123 struct device *dev = rsnd_priv_to_dev(priv); 122 struct device *dev = rsnd_priv_to_dev(priv);
124 123
125 dev_dbg(dev, "%s[%d] (Gen2) is probed\n", 124 dev_dbg(dev, "%s[%d] (Gen2) is probed\n",
@@ -129,10 +128,9 @@ static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod,
129} 128}
130 129
131static int rsnd_dvc_init(struct rsnd_mod *dvc_mod, 130static int rsnd_dvc_init(struct rsnd_mod *dvc_mod,
132 struct rsnd_dai *rdai) 131 struct rsnd_priv *priv)
133{ 132{
134 struct rsnd_dai_stream *io = rsnd_mod_to_io(dvc_mod); 133 struct rsnd_dai_stream *io = rsnd_mod_to_io(dvc_mod);
135 struct rsnd_priv *priv = rsnd_mod_to_priv(dvc_mod);
136 struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io); 134 struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
137 struct device *dev = rsnd_priv_to_dev(priv); 135 struct device *dev = rsnd_priv_to_dev(priv);
138 int dvc_id = rsnd_mod_id(dvc_mod); 136 int dvc_id = rsnd_mod_id(dvc_mod);
@@ -177,7 +175,7 @@ static int rsnd_dvc_init(struct rsnd_mod *dvc_mod,
177} 175}
178 176
179static int rsnd_dvc_quit(struct rsnd_mod *mod, 177static int rsnd_dvc_quit(struct rsnd_mod *mod,
180 struct rsnd_dai *rdai) 178 struct rsnd_priv *priv)
181{ 179{
182 rsnd_mod_hw_stop(mod); 180 rsnd_mod_hw_stop(mod);
183 181
@@ -185,7 +183,7 @@ static int rsnd_dvc_quit(struct rsnd_mod *mod,
185} 183}
186 184
187static int rsnd_dvc_start(struct rsnd_mod *mod, 185static int rsnd_dvc_start(struct rsnd_mod *mod,
188 struct rsnd_dai *rdai) 186 struct rsnd_priv *priv)
189{ 187{
190 rsnd_mod_write(mod, CMD_CTRL, 0x10); 188 rsnd_mod_write(mod, CMD_CTRL, 0x10);
191 189
@@ -193,7 +191,7 @@ static int rsnd_dvc_start(struct rsnd_mod *mod,
193} 191}
194 192
195static int rsnd_dvc_stop(struct rsnd_mod *mod, 193static int rsnd_dvc_stop(struct rsnd_mod *mod,
196 struct rsnd_dai *rdai) 194 struct rsnd_priv *priv)
197{ 195{
198 rsnd_mod_write(mod, CMD_CTRL, 0); 196 rsnd_mod_write(mod, CMD_CTRL, 0);
199 197
@@ -201,7 +199,6 @@ static int rsnd_dvc_stop(struct rsnd_mod *mod,
201} 199}
202 200
203static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, 201static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
204 struct rsnd_dai *rdai,
205 struct snd_soc_pcm_runtime *rtd) 202 struct snd_soc_pcm_runtime *rtd)
206{ 203{
207 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); 204 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index aaba717b8fd3..61545357f036 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -200,22 +200,21 @@ struct rsnd_mod_ops {
200 char *name; 200 char *name;
201 char* (*dma_name)(struct rsnd_mod *mod); 201 char* (*dma_name)(struct rsnd_mod *mod);
202 int (*probe)(struct rsnd_mod *mod, 202 int (*probe)(struct rsnd_mod *mod,
203 struct rsnd_dai *rdai); 203 struct rsnd_priv *priv);
204 int (*remove)(struct rsnd_mod *mod, 204 int (*remove)(struct rsnd_mod *mod,
205 struct rsnd_dai *rdai); 205 struct rsnd_priv *priv);
206 int (*init)(struct rsnd_mod *mod, 206 int (*init)(struct rsnd_mod *mod,
207 struct rsnd_dai *rdai); 207 struct rsnd_priv *priv);
208 int (*quit)(struct rsnd_mod *mod, 208 int (*quit)(struct rsnd_mod *mod,
209 struct rsnd_dai *rdai); 209 struct rsnd_priv *priv);
210 int (*start)(struct rsnd_mod *mod, 210 int (*start)(struct rsnd_mod *mod,
211 struct rsnd_dai *rdai); 211 struct rsnd_priv *priv);
212 int (*stop)(struct rsnd_mod *mod, 212 int (*stop)(struct rsnd_mod *mod,
213 struct rsnd_dai *rdai); 213 struct rsnd_priv *priv);
214 int (*pcm_new)(struct rsnd_mod *mod, 214 int (*pcm_new)(struct rsnd_mod *mod,
215 struct rsnd_dai *rdai,
216 struct snd_soc_pcm_runtime *rtd); 215 struct snd_soc_pcm_runtime *rtd);
217 int (*fallback)(struct rsnd_mod *mod, 216 int (*fallback)(struct rsnd_mod *mod,
218 struct rsnd_dai *rdai); 217 struct rsnd_priv *priv);
219}; 218};
220 219
221struct rsnd_dai_stream; 220struct rsnd_dai_stream;
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 31e19a00655f..0d136cdc4ada 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -294,10 +294,9 @@ static int rsnd_src_init(struct rsnd_mod *mod)
294} 294}
295 295
296static int rsnd_src_quit(struct rsnd_mod *mod, 296static int rsnd_src_quit(struct rsnd_mod *mod,
297 struct rsnd_dai *rdai) 297 struct rsnd_priv *priv)
298{ 298{
299 struct rsnd_src *src = rsnd_mod_to_src(mod); 299 struct rsnd_src *src = rsnd_mod_to_src(mod);
300 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
301 struct device *dev = rsnd_priv_to_dev(priv); 300 struct device *dev = rsnd_priv_to_dev(priv);
302 301
303 rsnd_mod_hw_stop(mod); 302 rsnd_mod_hw_stop(mod);
@@ -449,9 +448,8 @@ static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod)
449} 448}
450 449
451static int rsnd_src_probe_gen1(struct rsnd_mod *mod, 450static int rsnd_src_probe_gen1(struct rsnd_mod *mod,
452 struct rsnd_dai *rdai) 451 struct rsnd_priv *priv)
453{ 452{
454 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
455 struct device *dev = rsnd_priv_to_dev(priv); 453 struct device *dev = rsnd_priv_to_dev(priv);
456 454
457 dev_dbg(dev, "%s[%d] (Gen1) is probed\n", 455 dev_dbg(dev, "%s[%d] (Gen1) is probed\n",
@@ -461,7 +459,7 @@ static int rsnd_src_probe_gen1(struct rsnd_mod *mod,
461} 459}
462 460
463static int rsnd_src_init_gen1(struct rsnd_mod *mod, 461static int rsnd_src_init_gen1(struct rsnd_mod *mod,
464 struct rsnd_dai *rdai) 462 struct rsnd_priv *priv)
465{ 463{
466 int ret; 464 int ret;
467 465
@@ -485,7 +483,7 @@ static int rsnd_src_init_gen1(struct rsnd_mod *mod,
485} 483}
486 484
487static int rsnd_src_start_gen1(struct rsnd_mod *mod, 485static int rsnd_src_start_gen1(struct rsnd_mod *mod,
488 struct rsnd_dai *rdai) 486 struct rsnd_priv *priv)
489{ 487{
490 int id = rsnd_mod_id(mod); 488 int id = rsnd_mod_id(mod);
491 489
@@ -495,7 +493,7 @@ static int rsnd_src_start_gen1(struct rsnd_mod *mod,
495} 493}
496 494
497static int rsnd_src_stop_gen1(struct rsnd_mod *mod, 495static int rsnd_src_stop_gen1(struct rsnd_mod *mod,
498 struct rsnd_dai *rdai) 496 struct rsnd_priv *priv)
499{ 497{
500 int id = rsnd_mod_id(mod); 498 int id = rsnd_mod_id(mod);
501 499
@@ -691,9 +689,8 @@ static int rsnd_src_set_convert_timing_gen2(struct rsnd_mod *mod)
691} 689}
692 690
693static int rsnd_src_probe_gen2(struct rsnd_mod *mod, 691static int rsnd_src_probe_gen2(struct rsnd_mod *mod,
694 struct rsnd_dai *rdai) 692 struct rsnd_priv *priv)
695{ 693{
696 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
697 struct rsnd_src *src = rsnd_mod_to_src(mod); 694 struct rsnd_src *src = rsnd_mod_to_src(mod);
698 struct device *dev = rsnd_priv_to_dev(priv); 695 struct device *dev = rsnd_priv_to_dev(priv);
699 int irq = src->info->irq; 696 int irq = src->info->irq;
@@ -733,15 +730,15 @@ rsnd_src_probe_gen2_fail:
733} 730}
734 731
735static int rsnd_src_remove_gen2(struct rsnd_mod *mod, 732static int rsnd_src_remove_gen2(struct rsnd_mod *mod,
736 struct rsnd_dai *rdai) 733 struct rsnd_priv *priv)
737{ 734{
738 rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod)); 735 rsnd_dma_quit(priv, rsnd_mod_to_dma(mod));
739 736
740 return 0; 737 return 0;
741} 738}
742 739
743static int rsnd_src_init_gen2(struct rsnd_mod *mod, 740static int rsnd_src_init_gen2(struct rsnd_mod *mod,
744 struct rsnd_dai *rdai) 741 struct rsnd_priv *priv)
745{ 742{
746 int ret; 743 int ret;
747 744
@@ -761,7 +758,7 @@ static int rsnd_src_init_gen2(struct rsnd_mod *mod,
761} 758}
762 759
763static int rsnd_src_start_gen2(struct rsnd_mod *mod, 760static int rsnd_src_start_gen2(struct rsnd_mod *mod,
764 struct rsnd_dai *rdai) 761 struct rsnd_priv *priv)
765{ 762{
766 rsnd_dma_start(rsnd_mod_to_dma(mod)); 763 rsnd_dma_start(rsnd_mod_to_dma(mod));
767 764
@@ -769,7 +766,7 @@ static int rsnd_src_start_gen2(struct rsnd_mod *mod,
769} 766}
770 767
771static int rsnd_src_stop_gen2(struct rsnd_mod *mod, 768static int rsnd_src_stop_gen2(struct rsnd_mod *mod,
772 struct rsnd_dai *rdai) 769 struct rsnd_priv *priv)
773{ 770{
774 int ret; 771 int ret;
775 772
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 6e36c53e7b8f..b5a2fd61029d 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -270,10 +270,11 @@ static void rsnd_ssi_hw_stop(struct rsnd_ssi *ssi)
270 * SSI mod common functions 270 * SSI mod common functions
271 */ 271 */
272static int rsnd_ssi_init(struct rsnd_mod *mod, 272static int rsnd_ssi_init(struct rsnd_mod *mod,
273 struct rsnd_dai *rdai) 273 struct rsnd_priv *priv)
274{ 274{
275 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 275 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
276 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); 276 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
277 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
277 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 278 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
278 u32 cr; 279 u32 cr;
279 280
@@ -320,10 +321,9 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
320} 321}
321 322
322static int rsnd_ssi_quit(struct rsnd_mod *mod, 323static int rsnd_ssi_quit(struct rsnd_mod *mod,
323 struct rsnd_dai *rdai) 324 struct rsnd_priv *priv)
324{ 325{
325 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 326 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
326 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
327 struct device *dev = rsnd_priv_to_dev(priv); 327 struct device *dev = rsnd_priv_to_dev(priv);
328 328
329 if (ssi->err > 0) 329 if (ssi->err > 0)
@@ -347,7 +347,7 @@ static void rsnd_ssi_record_error(struct rsnd_ssi *ssi, u32 status)
347} 347}
348 348
349static int rsnd_ssi_start(struct rsnd_mod *mod, 349static int rsnd_ssi_start(struct rsnd_mod *mod,
350 struct rsnd_dai *rdai) 350 struct rsnd_priv *priv)
351{ 351{
352 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 352 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
353 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); 353 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
@@ -362,7 +362,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,
362} 362}
363 363
364static int rsnd_ssi_stop(struct rsnd_mod *mod, 364static int rsnd_ssi_stop(struct rsnd_mod *mod,
365 struct rsnd_dai *rdai) 365 struct rsnd_priv *priv)
366{ 366{
367 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 367 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
368 368
@@ -381,8 +381,8 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
381{ 381{
382 struct rsnd_ssi *ssi = data; 382 struct rsnd_ssi *ssi = data;
383 struct rsnd_mod *mod = &ssi->mod; 383 struct rsnd_mod *mod = &ssi->mod;
384 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
384 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); 385 struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
385 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
386 u32 status = rsnd_mod_read(mod, SSISR); 386 u32 status = rsnd_mod_read(mod, SSISR);
387 387
388 if (!io) 388 if (!io)
@@ -409,14 +409,13 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
409 409
410 /* PIO / DMA */ 410 /* PIO / DMA */
411 if (status & (UIRQ | OIRQ)) { 411 if (status & (UIRQ | OIRQ)) {
412 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
413 struct device *dev = rsnd_priv_to_dev(priv); 412 struct device *dev = rsnd_priv_to_dev(priv);
414 413
415 /* 414 /*
416 * restart SSI 415 * restart SSI
417 */ 416 */
418 rsnd_ssi_stop(mod, rdai); 417 rsnd_ssi_stop(mod, priv);
419 rsnd_ssi_start(mod, rdai); 418 rsnd_ssi_start(mod, priv);
420 419
421 dev_dbg(dev, "%s[%d] restart\n", 420 dev_dbg(dev, "%s[%d] restart\n",
422 rsnd_mod_name(mod), rsnd_mod_id(mod)); 421 rsnd_mod_name(mod), rsnd_mod_id(mod));
@@ -431,9 +430,8 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
431 * SSI PIO 430 * SSI PIO
432 */ 431 */
433static int rsnd_ssi_pio_probe(struct rsnd_mod *mod, 432static int rsnd_ssi_pio_probe(struct rsnd_mod *mod,
434 struct rsnd_dai *rdai) 433 struct rsnd_priv *priv)
435{ 434{
436 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
437 struct device *dev = rsnd_priv_to_dev(priv); 435 struct device *dev = rsnd_priv_to_dev(priv);
438 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 436 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
439 int ret; 437 int ret;
@@ -462,9 +460,8 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
462}; 460};
463 461
464static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, 462static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
465 struct rsnd_dai *rdai) 463 struct rsnd_priv *priv)
466{ 464{
467 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
468 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 465 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
469 struct device *dev = rsnd_priv_to_dev(priv); 466 struct device *dev = rsnd_priv_to_dev(priv);
470 int dma_id = ssi->info->dma_id; 467 int dma_id = ssi->info->dma_id;
@@ -497,14 +494,13 @@ rsnd_ssi_dma_probe_fail:
497} 494}
498 495
499static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, 496static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
500 struct rsnd_dai *rdai) 497 struct rsnd_priv *priv)
501{ 498{
502 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
503 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 499 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
504 struct device *dev = rsnd_priv_to_dev(priv); 500 struct device *dev = rsnd_priv_to_dev(priv);
505 int irq = ssi->info->irq; 501 int irq = ssi->info->irq;
506 502
507 rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod)); 503 rsnd_dma_quit(priv, rsnd_mod_to_dma(mod));
508 504
509 /* PIO will request IRQ again */ 505 /* PIO will request IRQ again */
510 devm_free_irq(dev, irq, ssi); 506 devm_free_irq(dev, irq, ssi);
@@ -513,9 +509,8 @@ static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
513} 509}
514 510
515static int rsnd_ssi_fallback(struct rsnd_mod *mod, 511static int rsnd_ssi_fallback(struct rsnd_mod *mod,
516 struct rsnd_dai *rdai) 512 struct rsnd_priv *priv)
517{ 513{
518 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
519 struct device *dev = rsnd_priv_to_dev(priv); 514 struct device *dev = rsnd_priv_to_dev(priv);
520 515
521 /* 516 /*
@@ -534,11 +529,11 @@ static int rsnd_ssi_fallback(struct rsnd_mod *mod,
534} 529}
535 530
536static int rsnd_ssi_dma_start(struct rsnd_mod *mod, 531static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
537 struct rsnd_dai *rdai) 532 struct rsnd_priv *priv)
538{ 533{
539 struct rsnd_dma *dma = rsnd_mod_to_dma(mod); 534 struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
540 535
541 rsnd_ssi_start(mod, rdai); 536 rsnd_ssi_start(mod, priv);
542 537
543 rsnd_dma_start(dma); 538 rsnd_dma_start(dma);
544 539
@@ -546,13 +541,13 @@ static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
546} 541}
547 542
548static int rsnd_ssi_dma_stop(struct rsnd_mod *mod, 543static int rsnd_ssi_dma_stop(struct rsnd_mod *mod,
549 struct rsnd_dai *rdai) 544 struct rsnd_priv *priv)
550{ 545{
551 struct rsnd_dma *dma = rsnd_mod_to_dma(mod); 546 struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
552 547
553 rsnd_dma_stop(dma); 548 rsnd_dma_stop(dma);
554 549
555 rsnd_ssi_stop(mod, rdai); 550 rsnd_ssi_stop(mod, priv);
556 551
557 return 0; 552 return 0;
558} 553}