4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
14 #include <linux/clk.h>
15 #include <linux/device.h>
16 #include <linux/dma-mapping.h>
18 #include <linux/list.h>
19 #include <linux/module.h>
20 #include <linux/of_device.h>
21 #include <linux/of_irq.h>
22 #include <linux/sh_dma.h>
23 #include <linux/workqueue.h>
24 #include <sound/soc.h>
25 #include <sound/pcm_params.h>
27 #define RSND_GEN1_SRU 0
28 #define RSND_GEN1_ADG 1
29 #define RSND_GEN1_SSI 2
31 #define RSND_GEN2_SCU 0
32 #define RSND_GEN2_ADG 1
33 #define RSND_GEN2_SSIU 2
34 #define RSND_GEN2_SSI 3
36 #define RSND_BASE_MAX 4
41 * The register address offsets SRU/SCU/SSIU on Gen1/Gen2 are very different.
42 * This driver uses pseudo register in order to hide it.
43 * see gen1/gen2 for detail
46 /* SCU (MIX/CTU/DVC) */
47 RSND_REG_SRC_I_BUSIF_MODE
,
48 RSND_REG_SRC_O_BUSIF_MODE
,
49 RSND_REG_SRC_ROUTE_MODE0
,
59 RSND_REG_SRC_INT_ENABLE0
,
60 RSND_REG_SRC_BUSIF_DALIGN
,
61 RSND_REG_SRCIN_TIMSEL0
,
62 RSND_REG_SRCIN_TIMSEL1
,
63 RSND_REG_SRCIN_TIMSEL2
,
64 RSND_REG_SRCIN_TIMSEL3
,
65 RSND_REG_SRCIN_TIMSEL4
,
66 RSND_REG_SRCOUT_TIMSEL0
,
67 RSND_REG_SRCOUT_TIMSEL1
,
68 RSND_REG_SRCOUT_TIMSEL2
,
69 RSND_REG_SRCOUT_TIMSEL3
,
70 RSND_REG_SRCOUT_TIMSEL4
,
71 RSND_REG_SCU_SYS_STATUS0
,
72 RSND_REG_SCU_SYS_STATUS1
,
73 RSND_REG_SCU_SYS_INT_EN0
,
74 RSND_REG_SCU_SYS_INT_EN1
,
76 RSND_REG_CMD_BUSIF_DALIGN
,
77 RSND_REG_CMD_ROUTE_SLCT
,
78 RSND_REG_CMDOUT_TIMSEL
,
149 RSND_REG_AUDIO_CLK_SEL0
,
150 RSND_REG_AUDIO_CLK_SEL1
,
151 RSND_REG_AUDIO_CLK_SEL2
,
158 RSND_REG_SSI_CONTROL
,
160 RSND_REG_SSI_BUSIF_MODE
,
161 RSND_REG_SSI_BUSIF_ADINR
,
162 RSND_REG_SSI_BUSIF_DALIGN
,
163 RSND_REG_SSI_INT_ENABLE
,
164 RSND_REG_SSI_SYS_STATUS0
,
165 RSND_REG_SSI_SYS_STATUS1
,
166 RSND_REG_SSI_SYS_STATUS2
,
167 RSND_REG_SSI_SYS_STATUS3
,
168 RSND_REG_SSI_SYS_STATUS4
,
169 RSND_REG_SSI_SYS_STATUS5
,
170 RSND_REG_SSI_SYS_STATUS6
,
171 RSND_REG_SSI_SYS_STATUS7
,
186 struct rsnd_dai_stream
;
189 * R-Car basic functions
191 #define rsnd_mod_read(m, r) \
192 rsnd_read(rsnd_mod_to_priv(m), m, RSND_REG_##r)
193 #define rsnd_mod_write(m, r, d) \
194 rsnd_write(rsnd_mod_to_priv(m), m, RSND_REG_##r, d)
195 #define rsnd_mod_bset(m, r, s, d) \
196 rsnd_bset(rsnd_mod_to_priv(m), m, RSND_REG_##r, s, d)
198 u32
rsnd_read(struct rsnd_priv
*priv
, struct rsnd_mod
*mod
, enum rsnd_reg reg
);
199 void rsnd_write(struct rsnd_priv
*priv
, struct rsnd_mod
*mod
,
200 enum rsnd_reg reg
, u32 data
);
201 void rsnd_force_write(struct rsnd_priv
*priv
, struct rsnd_mod
*mod
,
202 enum rsnd_reg reg
, u32 data
);
203 void rsnd_bset(struct rsnd_priv
*priv
, struct rsnd_mod
*mod
, enum rsnd_reg reg
,
205 u32
rsnd_get_adinr_bit(struct rsnd_mod
*mod
, struct rsnd_dai_stream
*io
);
206 u32
rsnd_get_dalign(struct rsnd_mod
*mod
, struct rsnd_dai_stream
*io
);
211 int rsnd_dma_attach(struct rsnd_dai_stream
*io
,
212 struct rsnd_mod
*mod
, struct rsnd_mod
**dma_mod
);
213 int rsnd_dma_probe(struct rsnd_priv
*priv
);
214 struct dma_chan
*rsnd_dma_request_channel(struct device_node
*of_node
,
215 struct rsnd_mod
*mod
, char *name
);
228 RSND_MOD_SSIM3
, /* SSI multi 3 */
229 RSND_MOD_SSIM2
, /* SSI multi 2 */
230 RSND_MOD_SSIM1
, /* SSI multi 1 */
231 RSND_MOD_SSIP
, /* SSI parent */
237 struct rsnd_mod_ops
{
239 struct dma_chan
* (*dma_req
)(struct rsnd_dai_stream
*io
,
240 struct rsnd_mod
*mod
);
241 int (*probe
)(struct rsnd_mod
*mod
,
242 struct rsnd_dai_stream
*io
,
243 struct rsnd_priv
*priv
);
244 int (*remove
)(struct rsnd_mod
*mod
,
245 struct rsnd_dai_stream
*io
,
246 struct rsnd_priv
*priv
);
247 int (*init
)(struct rsnd_mod
*mod
,
248 struct rsnd_dai_stream
*io
,
249 struct rsnd_priv
*priv
);
250 int (*quit
)(struct rsnd_mod
*mod
,
251 struct rsnd_dai_stream
*io
,
252 struct rsnd_priv
*priv
);
253 int (*start
)(struct rsnd_mod
*mod
,
254 struct rsnd_dai_stream
*io
,
255 struct rsnd_priv
*priv
);
256 int (*stop
)(struct rsnd_mod
*mod
,
257 struct rsnd_dai_stream
*io
,
258 struct rsnd_priv
*priv
);
259 int (*irq
)(struct rsnd_mod
*mod
,
260 struct rsnd_dai_stream
*io
,
261 struct rsnd_priv
*priv
, int enable
);
262 int (*pcm_new
)(struct rsnd_mod
*mod
,
263 struct rsnd_dai_stream
*io
,
264 struct snd_soc_pcm_runtime
*rtd
);
265 int (*hw_params
)(struct rsnd_mod
*mod
,
266 struct rsnd_dai_stream
*io
,
267 struct snd_pcm_substream
*substream
,
268 struct snd_pcm_hw_params
*hw_params
);
269 int (*fallback
)(struct rsnd_mod
*mod
,
270 struct rsnd_dai_stream
*io
,
271 struct rsnd_priv
*priv
);
272 int (*nolock_start
)(struct rsnd_mod
*mod
,
273 struct rsnd_dai_stream
*io
,
274 struct rsnd_priv
*priv
);
275 int (*nolock_stop
)(struct rsnd_mod
*mod
,
276 struct rsnd_dai_stream
*io
,
277 struct rsnd_priv
*priv
);
280 struct rsnd_dai_stream
;
283 enum rsnd_mod_type type
;
284 struct rsnd_mod_ops
*ops
;
285 struct rsnd_priv
*priv
;
287 u32
*(*get_status
)(struct rsnd_dai_stream
*io
,
288 struct rsnd_mod
*mod
,
289 enum rsnd_mod_type type
);
297 * A 0: nolock_start 1: nolock_stop
301 * H is always called (see __rsnd_mod_call)
302 * H 0: probe 1: remove
307 #define __rsnd_mod_shift_nolock_start 0
308 #define __rsnd_mod_shift_nolock_stop 0
309 #define __rsnd_mod_shift_init 4
310 #define __rsnd_mod_shift_quit 4
311 #define __rsnd_mod_shift_start 8
312 #define __rsnd_mod_shift_stop 8
313 #define __rsnd_mod_shift_probe 28 /* always called */
314 #define __rsnd_mod_shift_remove 28 /* always called */
315 #define __rsnd_mod_shift_irq 28 /* always called */
316 #define __rsnd_mod_shift_pcm_new 28 /* always called */
317 #define __rsnd_mod_shift_fallback 28 /* always called */
318 #define __rsnd_mod_shift_hw_params 28 /* always called */
320 #define __rsnd_mod_add_probe 0
321 #define __rsnd_mod_add_remove 0
322 #define __rsnd_mod_add_nolock_start 1
323 #define __rsnd_mod_add_nolock_stop -1
324 #define __rsnd_mod_add_init 1
325 #define __rsnd_mod_add_quit -1
326 #define __rsnd_mod_add_start 1
327 #define __rsnd_mod_add_stop -1
328 #define __rsnd_mod_add_irq 0
329 #define __rsnd_mod_add_pcm_new 0
330 #define __rsnd_mod_add_fallback 0
331 #define __rsnd_mod_add_hw_params 0
333 #define __rsnd_mod_call_probe 0
334 #define __rsnd_mod_call_remove 0
335 #define __rsnd_mod_call_init 0
336 #define __rsnd_mod_call_quit 1
337 #define __rsnd_mod_call_start 0
338 #define __rsnd_mod_call_stop 1
339 #define __rsnd_mod_call_irq 0
340 #define __rsnd_mod_call_pcm_new 0
341 #define __rsnd_mod_call_fallback 0
342 #define __rsnd_mod_call_hw_params 0
343 #define __rsnd_mod_call_nolock_start 0
344 #define __rsnd_mod_call_nolock_stop 1
346 #define rsnd_mod_to_priv(mod) ((mod)->priv)
347 #define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1)
348 #define rsnd_mod_power_on(mod) clk_enable((mod)->clk)
349 #define rsnd_mod_power_off(mod) clk_disable((mod)->clk)
350 #define rsnd_mod_get(ip) (&(ip)->mod)
352 int rsnd_mod_init(struct rsnd_priv
*priv
,
353 struct rsnd_mod
*mod
,
354 struct rsnd_mod_ops
*ops
,
356 u32
* (*get_status
)(struct rsnd_dai_stream
*io
,
357 struct rsnd_mod
*mod
,
358 enum rsnd_mod_type type
),
359 enum rsnd_mod_type type
,
361 void rsnd_mod_quit(struct rsnd_mod
*mod
);
362 char *rsnd_mod_name(struct rsnd_mod
*mod
);
363 struct dma_chan
*rsnd_mod_dma_req(struct rsnd_dai_stream
*io
,
364 struct rsnd_mod
*mod
);
365 void rsnd_mod_interrupt(struct rsnd_mod
*mod
,
366 void (*callback
)(struct rsnd_mod
*mod
,
367 struct rsnd_dai_stream
*io
));
368 u32
*rsnd_mod_get_status(struct rsnd_dai_stream
*io
,
369 struct rsnd_mod
*mod
,
370 enum rsnd_mod_type type
);
371 struct rsnd_mod
*rsnd_mod_next(int *iterator
,
372 struct rsnd_dai_stream
*io
,
373 enum rsnd_mod_type
*array
,
375 #define for_each_rsnd_mod(iterator, pos, io) \
377 (pos = rsnd_mod_next(&iterator, io, NULL, 0)); iterator++)
378 #define for_each_rsnd_mod_arrays(iterator, pos, io, array, size) \
380 (pos = rsnd_mod_next(&iterator, io, array, size)); iterator++)
381 #define for_each_rsnd_mod_array(iterator, pos, io, array) \
382 for_each_rsnd_mod_arrays(iterator, pos, io, array, ARRAY_SIZE(array))
384 void rsnd_parse_connect_common(struct rsnd_dai
*rdai
,
385 struct rsnd_mod
* (*mod_get
)(struct rsnd_priv
*priv
, int id
),
386 struct device_node
*node
,
387 struct device_node
*playback
,
388 struct device_node
*capture
);
390 void rsnd_set_slot(struct rsnd_dai
*rdai
,
391 int slots
, int slots_total
);
392 int rsnd_get_slot(struct rsnd_dai_stream
*io
);
393 int rsnd_get_slot_num(struct rsnd_dai_stream
*io
);
395 int rsnd_runtime_channel_original(struct rsnd_dai_stream
*io
);
396 int rsnd_runtime_channel_after_ctu(struct rsnd_dai_stream
*io
);
397 int rsnd_runtime_channel_for_ssi(struct rsnd_dai_stream
*io
);
398 int rsnd_runtime_is_ssi_multi(struct rsnd_dai_stream
*io
);
399 int rsnd_runtime_is_ssi_tdm(struct rsnd_dai_stream
*io
);
404 #define rsnd_parse_of_node(priv, node) \
405 of_get_child_by_name(rsnd_priv_to_dev(priv)->of_node, node)
406 #define RSND_NODE_DAI "rcar_sound,dai"
407 #define RSND_NODE_SSI "rcar_sound,ssi"
408 #define RSND_NODE_SRC "rcar_sound,src"
409 #define RSND_NODE_CTU "rcar_sound,ctu"
410 #define RSND_NODE_MIX "rcar_sound,mix"
411 #define RSND_NODE_DVC "rcar_sound,dvc"
416 #define RSND_DAI_NAME_SIZE 16
417 struct rsnd_dai_stream
{
418 char name
[RSND_DAI_NAME_SIZE
];
419 struct snd_pcm_substream
*substream
;
420 struct rsnd_mod
*mod
[RSND_MOD_MAX
];
421 struct rsnd_dai_path_info
*info
; /* rcar_snd.h */
422 struct rsnd_dai
*rdai
;
423 u32 parent_ssi_status
;
427 int next_period_byte
;
429 #define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
430 #define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
431 #define rsnd_io_to_mod_ssiu(io) rsnd_io_to_mod((io), RSND_MOD_SSIU)
432 #define rsnd_io_to_mod_ssip(io) rsnd_io_to_mod((io), RSND_MOD_SSIP)
433 #define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC)
434 #define rsnd_io_to_mod_ctu(io) rsnd_io_to_mod((io), RSND_MOD_CTU)
435 #define rsnd_io_to_mod_mix(io) rsnd_io_to_mod((io), RSND_MOD_MIX)
436 #define rsnd_io_to_mod_dvc(io) rsnd_io_to_mod((io), RSND_MOD_DVC)
437 #define rsnd_io_to_mod_cmd(io) rsnd_io_to_mod((io), RSND_MOD_CMD)
438 #define rsnd_io_to_rdai(io) ((io)->rdai)
439 #define rsnd_io_to_priv(io) (rsnd_rdai_to_priv(rsnd_io_to_rdai(io)))
440 #define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io)
441 #define rsnd_io_to_runtime(io) ((io)->substream ? \
442 (io)->substream->runtime : NULL)
443 int rsnd_io_is_working(struct rsnd_dai_stream
*io
);
446 char name
[RSND_DAI_NAME_SIZE
];
447 struct rsnd_dai_stream playback
;
448 struct rsnd_dai_stream capture
;
449 struct rsnd_priv
*priv
;
454 unsigned int clk_master
:1;
455 unsigned int bit_clk_inv
:1;
456 unsigned int frm_clk_inv
:1;
457 unsigned int sys_delay
:1;
458 unsigned int data_alignment
:1;
461 #define rsnd_rdai_nr(priv) ((priv)->rdai_nr)
462 #define rsnd_rdai_is_clk_master(rdai) ((rdai)->clk_master)
463 #define rsnd_rdai_to_priv(rdai) ((rdai)->priv)
464 #define for_each_rsnd_dai(rdai, priv, i) \
466 (i < rsnd_rdai_nr(priv)) && \
467 ((rdai) = rsnd_rdai_get(priv, i)); \
470 struct rsnd_dai
*rsnd_rdai_get(struct rsnd_priv
*priv
, int id
);
472 bool rsnd_dai_pointer_update(struct rsnd_dai_stream
*io
, int cnt
);
473 void rsnd_dai_period_elapsed(struct rsnd_dai_stream
*io
);
474 int rsnd_dai_pointer_offset(struct rsnd_dai_stream
*io
, int additional
);
475 int rsnd_dai_connect(struct rsnd_mod
*mod
,
476 struct rsnd_dai_stream
*io
,
477 enum rsnd_mod_type type
);
478 #define rsnd_dai_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_DAI)
483 int rsnd_gen_probe(struct rsnd_priv
*priv
);
484 void __iomem
*rsnd_gen_reg_get(struct rsnd_priv
*priv
,
485 struct rsnd_mod
*mod
,
487 phys_addr_t
rsnd_gen_get_phy_addr(struct rsnd_priv
*priv
, int reg_id
);
492 int rsnd_adg_ssi_clk_stop(struct rsnd_mod
*mod
);
493 int rsnd_adg_ssi_clk_try_start(struct rsnd_mod
*mod
, unsigned int rate
);
494 int rsnd_adg_probe(struct rsnd_priv
*priv
);
495 void rsnd_adg_remove(struct rsnd_priv
*priv
);
496 int rsnd_adg_set_src_timesel_gen2(struct rsnd_mod
*src_mod
,
497 struct rsnd_dai_stream
*io
,
498 unsigned int in_rate
,
499 unsigned int out_rate
);
500 int rsnd_adg_set_cmd_timsel_gen2(struct rsnd_mod
*mod
,
501 struct rsnd_dai_stream
*io
);
502 #define rsnd_adg_clk_enable(priv) rsnd_adg_clk_control(priv, 1)
503 #define rsnd_adg_clk_disable(priv) rsnd_adg_clk_control(priv, 0)
504 void rsnd_adg_clk_control(struct rsnd_priv
*priv
, int enable
);
511 struct platform_device
*pdev
;
514 #define RSND_GEN_MASK (0xF << 0)
515 #define RSND_GEN1 (1 << 0)
516 #define RSND_GEN2 (2 << 0)
519 * below value will be filled on rsnd_gen_probe()
524 * below value will be filled on rsnd_adg_probe()
529 * below value will be filled on rsnd_dma_probe()
534 * below value will be filled on rsnd_ssi_probe()
540 * below value will be filled on rsnd_ssiu_probe()
546 * below value will be filled on rsnd_src_probe()
552 * below value will be filled on rsnd_ctu_probe()
558 * below value will be filled on rsnd_mix_probe()
564 * below value will be filled on rsnd_dvc_probe()
570 * below value will be filled on rsnd_cmd_probe()
576 * below value will be filled on rsnd_dai_probe()
578 struct snd_soc_dai_driver
*daidrv
;
579 struct rsnd_dai
*rdai
;
583 #define rsnd_priv_to_pdev(priv) ((priv)->pdev)
584 #define rsnd_priv_to_dev(priv) (&(rsnd_priv_to_pdev(priv)->dev))
586 #define rsnd_is_gen1(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN1)
587 #define rsnd_is_gen2(priv) (((priv)->flags & RSND_GEN_MASK) == RSND_GEN2)
592 struct rsnd_kctrl_cfg
{
596 const char * const *texts
;
597 void (*update
)(struct rsnd_dai_stream
*io
, struct rsnd_mod
*mod
);
598 struct rsnd_dai_stream
*io
;
599 struct snd_card
*card
;
600 struct snd_kcontrol
*kctrl
;
603 #define RSND_MAX_CHANNELS 8
604 struct rsnd_kctrl_cfg_m
{
605 struct rsnd_kctrl_cfg cfg
;
606 u32 val
[RSND_MAX_CHANNELS
];
609 struct rsnd_kctrl_cfg_s
{
610 struct rsnd_kctrl_cfg cfg
;
614 void _rsnd_kctrl_remove(struct rsnd_kctrl_cfg
*cfg
);
615 #define rsnd_kctrl_remove(_cfg) _rsnd_kctrl_remove(&((_cfg).cfg))
617 int rsnd_kctrl_new_m(struct rsnd_mod
*mod
,
618 struct rsnd_dai_stream
*io
,
619 struct snd_soc_pcm_runtime
*rtd
,
620 const unsigned char *name
,
621 void (*update
)(struct rsnd_dai_stream
*io
,
622 struct rsnd_mod
*mod
),
623 struct rsnd_kctrl_cfg_m
*_cfg
,
626 int rsnd_kctrl_new_s(struct rsnd_mod
*mod
,
627 struct rsnd_dai_stream
*io
,
628 struct snd_soc_pcm_runtime
*rtd
,
629 const unsigned char *name
,
630 void (*update
)(struct rsnd_dai_stream
*io
,
631 struct rsnd_mod
*mod
),
632 struct rsnd_kctrl_cfg_s
*_cfg
,
634 int rsnd_kctrl_new_e(struct rsnd_mod
*mod
,
635 struct rsnd_dai_stream
*io
,
636 struct snd_soc_pcm_runtime
*rtd
,
637 const unsigned char *name
,
638 struct rsnd_kctrl_cfg_s
*_cfg
,
639 void (*update
)(struct rsnd_dai_stream
*io
,
640 struct rsnd_mod
*mod
),
641 const char * const *texts
,
647 int rsnd_ssi_probe(struct rsnd_priv
*priv
);
648 void rsnd_ssi_remove(struct rsnd_priv
*priv
);
649 struct rsnd_mod
*rsnd_ssi_mod_get(struct rsnd_priv
*priv
, int id
);
650 int rsnd_ssi_is_dma_mode(struct rsnd_mod
*mod
);
651 int rsnd_ssi_use_busif(struct rsnd_dai_stream
*io
);
652 u32
rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream
*io
);
654 #define rsnd_ssi_is_pin_sharing(io) \
655 __rsnd_ssi_is_pin_sharing(rsnd_io_to_mod_ssi(io))
656 int __rsnd_ssi_is_pin_sharing(struct rsnd_mod
*mod
);
658 #define rsnd_ssi_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_SSI)
659 void rsnd_parse_connect_ssi(struct rsnd_dai
*rdai
,
660 struct device_node
*playback
,
661 struct device_node
*capture
);
666 int rsnd_ssiu_attach(struct rsnd_dai_stream
*io
,
667 struct rsnd_mod
*mod
);
668 int rsnd_ssiu_probe(struct rsnd_priv
*priv
);
669 void rsnd_ssiu_remove(struct rsnd_priv
*priv
);
674 int rsnd_src_probe(struct rsnd_priv
*priv
);
675 void rsnd_src_remove(struct rsnd_priv
*priv
);
676 struct rsnd_mod
*rsnd_src_mod_get(struct rsnd_priv
*priv
, int id
);
678 #define rsnd_src_get_in_rate(priv, io) rsnd_src_get_rate(priv, io, 1)
679 #define rsnd_src_get_out_rate(priv, io) rsnd_src_get_rate(priv, io, 0)
680 unsigned int rsnd_src_get_rate(struct rsnd_priv
*priv
,
681 struct rsnd_dai_stream
*io
,
684 #define rsnd_src_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_SRC)
685 #define rsnd_parse_connect_src(rdai, playback, capture) \
686 rsnd_parse_connect_common(rdai, rsnd_src_mod_get, \
687 rsnd_src_of_node(rsnd_rdai_to_priv(rdai)), \
693 int rsnd_ctu_probe(struct rsnd_priv
*priv
);
694 void rsnd_ctu_remove(struct rsnd_priv
*priv
);
695 int rsnd_ctu_converted_channel(struct rsnd_mod
*mod
);
696 struct rsnd_mod
*rsnd_ctu_mod_get(struct rsnd_priv
*priv
, int id
);
697 #define rsnd_ctu_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_CTU)
698 #define rsnd_parse_connect_ctu(rdai, playback, capture) \
699 rsnd_parse_connect_common(rdai, rsnd_ctu_mod_get, \
700 rsnd_ctu_of_node(rsnd_rdai_to_priv(rdai)), \
706 int rsnd_mix_probe(struct rsnd_priv
*priv
);
707 void rsnd_mix_remove(struct rsnd_priv
*priv
);
708 struct rsnd_mod
*rsnd_mix_mod_get(struct rsnd_priv
*priv
, int id
);
709 #define rsnd_mix_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_MIX)
710 #define rsnd_parse_connect_mix(rdai, playback, capture) \
711 rsnd_parse_connect_common(rdai, rsnd_mix_mod_get, \
712 rsnd_mix_of_node(rsnd_rdai_to_priv(rdai)), \
718 int rsnd_dvc_probe(struct rsnd_priv
*priv
);
719 void rsnd_dvc_remove(struct rsnd_priv
*priv
);
720 struct rsnd_mod
*rsnd_dvc_mod_get(struct rsnd_priv
*priv
, int id
);
721 #define rsnd_dvc_of_node(priv) rsnd_parse_of_node(priv, RSND_NODE_DVC)
722 #define rsnd_parse_connect_dvc(rdai, playback, capture) \
723 rsnd_parse_connect_common(rdai, rsnd_dvc_mod_get, \
724 rsnd_dvc_of_node(rsnd_rdai_to_priv(rdai)), \
730 int rsnd_cmd_probe(struct rsnd_priv
*priv
);
731 void rsnd_cmd_remove(struct rsnd_priv
*priv
);
732 int rsnd_cmd_attach(struct rsnd_dai_stream
*io
, int id
);
733 struct rsnd_mod
*rsnd_cmd_mod_get(struct rsnd_priv
*priv
, int id
);
736 void rsnd_mod_make_sure(struct rsnd_mod
*mod
, enum rsnd_mod_type type
);
737 #define rsnd_mod_confirm_ssi(mssi) rsnd_mod_make_sure(mssi, RSND_MOD_SSI)
738 #define rsnd_mod_confirm_src(msrc) rsnd_mod_make_sure(msrc, RSND_MOD_SRC)
739 #define rsnd_mod_confirm_dvc(mdvc) rsnd_mod_make_sure(mdvc, RSND_MOD_DVC)
741 #define rsnd_mod_confirm_ssi(mssi)
742 #define rsnd_mod_confirm_src(msrc)
743 #define rsnd_mod_confirm_dvc(mdvc)