aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/rsnd.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/rsnd.h')
-rw-r--r--sound/soc/sh/rcar/rsnd.h92
1 files changed, 88 insertions, 4 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index d119adf97c9c..5826c8abf794 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -91,6 +91,9 @@ enum rsnd_reg {
91 RSND_REG_SHARE20, 91 RSND_REG_SHARE20,
92 RSND_REG_SHARE21, 92 RSND_REG_SHARE21,
93 RSND_REG_SHARE22, 93 RSND_REG_SHARE22,
94 RSND_REG_SHARE23,
95 RSND_REG_SHARE24,
96 RSND_REG_SHARE25,
94 97
95 RSND_REG_MAX, 98 RSND_REG_MAX,
96}; 99};
@@ -129,6 +132,9 @@ enum rsnd_reg {
129#define RSND_REG_CMD_CTRL RSND_REG_SHARE20 132#define RSND_REG_CMD_CTRL RSND_REG_SHARE20
130#define RSND_REG_CMDOUT_TIMSEL RSND_REG_SHARE21 133#define RSND_REG_CMDOUT_TIMSEL RSND_REG_SHARE21
131#define RSND_REG_BUSIF_DALIGN RSND_REG_SHARE22 134#define RSND_REG_BUSIF_DALIGN RSND_REG_SHARE22
135#define RSND_REG_DVC_VRCTR RSND_REG_SHARE23
136#define RSND_REG_DVC_VRPDR RSND_REG_SHARE24
137#define RSND_REG_DVC_VRDBR RSND_REG_SHARE25
132 138
133struct rsnd_of_data; 139struct rsnd_of_data;
134struct rsnd_priv; 140struct rsnd_priv;
@@ -200,6 +206,8 @@ struct rsnd_mod_ops {
200 int (*pcm_new)(struct rsnd_mod *mod, 206 int (*pcm_new)(struct rsnd_mod *mod,
201 struct rsnd_dai *rdai, 207 struct rsnd_dai *rdai,
202 struct snd_soc_pcm_runtime *rtd); 208 struct snd_soc_pcm_runtime *rtd);
209 int (*fallback)(struct rsnd_mod *mod,
210 struct rsnd_dai *rdai);
203}; 211};
204 212
205struct rsnd_dai_stream; 213struct rsnd_dai_stream;
@@ -210,7 +218,35 @@ struct rsnd_mod {
210 struct rsnd_mod_ops *ops; 218 struct rsnd_mod_ops *ops;
211 struct rsnd_dma dma; 219 struct rsnd_dma dma;
212 struct rsnd_dai_stream *io; 220 struct rsnd_dai_stream *io;
221 u32 status;
213}; 222};
223/*
224 * status
225 *
226 * bit
227 * 0 0: probe 1: remove
228 * 1 0: init 1: quit
229 * 2 0: start 1: stop
230 * 3 0: pcm_new
231 * 4 0: fallback
232 */
233#define __rsnd_mod_shift_probe 0
234#define __rsnd_mod_shift_remove 0
235#define __rsnd_mod_shift_init 1
236#define __rsnd_mod_shift_quit 1
237#define __rsnd_mod_shift_start 2
238#define __rsnd_mod_shift_stop 2
239#define __rsnd_mod_shift_pcm_new 3
240#define __rsnd_mod_shift_fallback 4
241
242#define __rsnd_mod_call_probe 0
243#define __rsnd_mod_call_remove 1
244#define __rsnd_mod_call_init 0
245#define __rsnd_mod_call_quit 1
246#define __rsnd_mod_call_start 0
247#define __rsnd_mod_call_stop 1
248#define __rsnd_mod_call_pcm_new 0
249#define __rsnd_mod_call_fallback 0
214 250
215#define rsnd_mod_to_priv(mod) ((mod)->priv) 251#define rsnd_mod_to_priv(mod) ((mod)->priv)
216#define rsnd_mod_to_dma(mod) (&(mod)->dma) 252#define rsnd_mod_to_dma(mod) (&(mod)->dma)
@@ -267,7 +303,8 @@ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id);
267int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io); 303int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io);
268int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai); 304int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai);
269#define rsnd_dai_get_platform_info(rdai) ((rdai)->info) 305#define rsnd_dai_get_platform_info(rdai) ((rdai)->info)
270#define rsnd_io_to_runtime(io) ((io)->substream->runtime) 306#define rsnd_io_to_runtime(io) ((io)->substream ? \
307 (io)->substream->runtime : NULL)
271 308
272void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt); 309void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt);
273int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional); 310int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
@@ -382,6 +419,51 @@ struct rsnd_priv {
382}) 419})
383 420
384/* 421/*
422 * rsnd_kctrl
423 */
424struct rsnd_kctrl_cfg {
425 unsigned int max;
426 unsigned int size;
427 u32 *val;
428 const char * const *texts;
429 void (*update)(struct rsnd_mod *mod);
430};
431
432#define RSND_DVC_CHANNELS 2
433struct rsnd_kctrl_cfg_m {
434 struct rsnd_kctrl_cfg cfg;
435 u32 val[RSND_DVC_CHANNELS];
436};
437
438struct rsnd_kctrl_cfg_s {
439 struct rsnd_kctrl_cfg cfg;
440 u32 val;
441};
442
443int rsnd_kctrl_new_m(struct rsnd_mod *mod,
444 struct rsnd_dai *rdai,
445 struct snd_soc_pcm_runtime *rtd,
446 const unsigned char *name,
447 void (*update)(struct rsnd_mod *mod),
448 struct rsnd_kctrl_cfg_m *_cfg,
449 u32 max);
450int rsnd_kctrl_new_s(struct rsnd_mod *mod,
451 struct rsnd_dai *rdai,
452 struct snd_soc_pcm_runtime *rtd,
453 const unsigned char *name,
454 void (*update)(struct rsnd_mod *mod),
455 struct rsnd_kctrl_cfg_s *_cfg,
456 u32 max);
457int rsnd_kctrl_new_e(struct rsnd_mod *mod,
458 struct rsnd_dai *rdai,
459 struct snd_soc_pcm_runtime *rtd,
460 const unsigned char *name,
461 struct rsnd_kctrl_cfg_s *_cfg,
462 void (*update)(struct rsnd_mod *mod),
463 const char * const *texts,
464 u32 max);
465
466/*
385 * R-Car SRC 467 * R-Car SRC
386 */ 468 */
387int rsnd_src_probe(struct platform_device *pdev, 469int rsnd_src_probe(struct platform_device *pdev,
@@ -395,10 +477,11 @@ int rsnd_src_ssiu_start(struct rsnd_mod *ssi_mod,
395 struct rsnd_dai *rdai, 477 struct rsnd_dai *rdai,
396 int use_busif); 478 int use_busif);
397int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod, 479int rsnd_src_ssiu_stop(struct rsnd_mod *ssi_mod,
398 struct rsnd_dai *rdai, 480 struct rsnd_dai *rdai);
399 int use_busif); 481int rsnd_src_ssi_irq_enable(struct rsnd_mod *ssi_mod,
400int rsnd_src_enable_ssi_irq(struct rsnd_mod *ssi_mod,
401 struct rsnd_dai *rdai); 482 struct rsnd_dai *rdai);
483int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod,
484 struct rsnd_dai *rdai);
402 485
403#define rsnd_src_nr(priv) ((priv)->src_nr) 486#define rsnd_src_nr(priv) ((priv)->src_nr)
404 487
@@ -410,6 +493,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
410 struct rsnd_priv *priv); 493 struct rsnd_priv *priv);
411struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); 494struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
412int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); 495int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
496int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
413 497
414/* 498/*
415 * R-Car DVC 499 * R-Car DVC