2 * Renesas R-Car SSIU/SSI support
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
8 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 #include <linux/delay.h>
16 #define RSND_SSI_NAME_SIZE 16
21 #define FORCE (1 << 31) /* Fixed */
22 #define DMEN (1 << 28) /* DMA Enable */
23 #define UIEN (1 << 27) /* Underflow Interrupt Enable */
24 #define OIEN (1 << 26) /* Overflow Interrupt Enable */
25 #define IIEN (1 << 25) /* Idle Mode Interrupt Enable */
26 #define DIEN (1 << 24) /* Data Interrupt Enable */
27 #define CHNL_4 (1 << 22) /* Channels */
28 #define CHNL_6 (2 << 22) /* Channels */
29 #define CHNL_8 (3 << 22) /* Channels */
30 #define DWL_8 (0 << 19) /* Data Word Length */
31 #define DWL_16 (1 << 19) /* Data Word Length */
32 #define DWL_18 (2 << 19) /* Data Word Length */
33 #define DWL_20 (3 << 19) /* Data Word Length */
34 #define DWL_22 (4 << 19) /* Data Word Length */
35 #define DWL_24 (5 << 19) /* Data Word Length */
36 #define DWL_32 (6 << 19) /* Data Word Length */
38 #define SWL_32 (3 << 16) /* R/W System Word Length */
39 #define SCKD (1 << 15) /* Serial Bit Clock Direction */
40 #define SWSD (1 << 14) /* Serial WS Direction */
41 #define SCKP (1 << 13) /* Serial Bit Clock Polarity */
42 #define SWSP (1 << 12) /* Serial WS Polarity */
43 #define SDTA (1 << 10) /* Serial Data Alignment */
44 #define PDTA (1 << 9) /* Parallel Data Alignment */
45 #define DEL (1 << 8) /* Serial Data Delay */
46 #define CKDV(v) (v << 4) /* Serial Clock Division Ratio */
47 #define TRMD (1 << 1) /* Transmit/Receive Mode Select */
48 #define EN (1 << 0) /* SSI Module Enable */
53 #define UIRQ (1 << 27) /* Underflow Error Interrupt Status */
54 #define OIRQ (1 << 26) /* Overflow Error Interrupt Status */
55 #define IIRQ (1 << 25) /* Idle Mode Interrupt Status */
56 #define DIRQ (1 << 24) /* Data Interrupt Status Flag */
61 #define CONT (1 << 8) /* WS Continue Function */
62 #define WS_MODE (1 << 0) /* WS Mode */
64 #define SSI_NAME "ssi"
82 #define RSND_SSI_CLK_PIN_SHARE (1 << 0)
83 #define RSND_SSI_NO_BUSIF (1 << 1) /* SSI+DMA without BUSIF */
85 #define for_each_rsnd_ssi(pos, priv, i) \
87 (i < rsnd_ssi_nr(priv)) && \
88 ((pos) = ((struct rsnd_ssi *)(priv)->ssi + i)); \
91 #define rsnd_ssi_get(priv, id) ((struct rsnd_ssi *)(priv->ssi) + id)
92 #define rsnd_ssi_to_dma(mod) ((ssi)->dma)
93 #define rsnd_ssi_nr(priv) ((priv)->ssi_nr)
94 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
95 #define rsnd_ssi_mode_flags(p) ((p)->flags)
96 #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io))
97 #define rsnd_ssi_is_multi_slave(mod, io) \
98 (rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod)))
99 #define rsnd_ssi_is_run_mods(mod, io) \
100 (rsnd_ssi_run_mods(io) & (1 << rsnd_mod_id(mod)))
102 int rsnd_ssi_use_busif(struct rsnd_dai_stream *io)
104 struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io);
105 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
108 if (!rsnd_ssi_is_dma_mode(mod))
111 if (!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_NO_BUSIF))
113 if (rsnd_io_to_mod_src(io))
119 static void rsnd_ssi_status_clear(struct rsnd_mod *mod)
121 rsnd_mod_write(mod, SSISR, 0);
124 static u32 rsnd_ssi_status_get(struct rsnd_mod *mod)
126 return rsnd_mod_read(mod, SSISR);
129 static void rsnd_ssi_status_check(struct rsnd_mod *mod,
132 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
133 struct device *dev = rsnd_priv_to_dev(priv);
137 for (i = 0; i < 1024; i++) {
138 status = rsnd_ssi_status_get(mod);
145 dev_warn(dev, "%s[%d] status check failed\n",
146 rsnd_mod_name(mod), rsnd_mod_id(mod));
149 static u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
151 struct rsnd_mod *mod;
152 enum rsnd_mod_type types[] = {
160 for (i = 0; i < ARRAY_SIZE(types); i++) {
161 mod = rsnd_io_to_mod(io, types[i]);
165 mask |= 1 << rsnd_mod_id(mod);
171 static u32 rsnd_ssi_run_mods(struct rsnd_dai_stream *io)
173 struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
174 struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io);
176 return rsnd_ssi_multi_slaves_runtime(io) |
177 1 << rsnd_mod_id(ssi_mod) |
178 1 << rsnd_mod_id(ssi_parent_mod);
181 u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io)
183 if (rsnd_runtime_is_ssi_multi(io))
184 return rsnd_ssi_multi_slaves(io);
189 static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
190 struct rsnd_dai_stream *io)
192 struct rsnd_priv *priv = rsnd_io_to_priv(io);
193 struct device *dev = rsnd_priv_to_dev(priv);
194 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
195 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
196 struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io);
197 int chan = rsnd_runtime_channel_for_ssi(io);
199 int ssi_clk_mul_table[] = {
200 1, 2, 4, 8, 16, 6, 12,
202 unsigned int main_rate;
203 unsigned int rate = rsnd_io_is_play(io) ?
204 rsnd_src_get_out_rate(priv, io) :
205 rsnd_src_get_in_rate(priv, io);
207 if (!rsnd_rdai_is_clk_master(rdai))
210 if (ssi_parent_mod && !rsnd_ssi_is_parent(mod, io))
213 if (rsnd_ssi_is_multi_slave(mod, io))
216 if (ssi->usrcnt > 1) {
217 if (ssi->rate != rate) {
218 dev_err(dev, "SSI parent/child should use same rate\n");
226 * Find best clock, and try to start ADG
228 for (j = 0; j < ARRAY_SIZE(ssi_clk_mul_table); j++) {
231 * It will set SSIWSR.CONT here, but SSICR.CKDV = 000
232 * with it is not allowed. (SSIWSR.WS_MODE with
233 * SSICR.CKDV = 000 is not allowed either).
234 * Skip it. See SSICR.CKDV
240 * this driver is assuming that
241 * system word is 32bit x chan
242 * see rsnd_ssi_init()
244 main_rate = rate * 32 * chan * ssi_clk_mul_table[j];
246 ret = rsnd_adg_ssi_clk_try_start(mod, main_rate);
248 ssi->cr_clk = FORCE | SWL_32 |
249 SCKD | SWSD | CKDV(j);
254 dev_dbg(dev, "%s[%d] outputs %u Hz\n",
256 rsnd_mod_id(mod), rate);
262 dev_err(dev, "unsupported clock rate\n");
266 static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod,
267 struct rsnd_dai_stream *io)
269 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
270 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
271 struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io);
273 if (!rsnd_rdai_is_clk_master(rdai))
276 if (ssi_parent_mod && !rsnd_ssi_is_parent(mod, io))
285 rsnd_adg_ssi_clk_stop(mod);
288 static void rsnd_ssi_config_init(struct rsnd_mod *mod,
289 struct rsnd_dai_stream *io)
291 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
292 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
293 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
299 is_tdm = rsnd_runtime_is_ssi_tdm(io);
302 * always use 32bit system word.
303 * see also rsnd_ssi_master_clk_enable()
305 cr_own = FORCE | SWL_32 | PDTA;
307 if (rdai->bit_clk_inv)
309 if (rdai->frm_clk_inv ^ is_tdm)
311 if (rdai->data_alignment)
315 if (rsnd_io_is_play(io))
318 switch (runtime->sample_bits) {
327 if (rsnd_ssi_is_dma_mode(mod)) {
328 cr_mode = UIEN | OIEN | /* over/under run */
329 DMEN; /* DMA : enable DMA */
331 cr_mode = DIEN; /* PIO : enable Data interrupt */
337 * rsnd_ssiu_init_gen2()
345 ssi->cr_own = cr_own;
346 ssi->cr_mode = cr_mode;
350 static void rsnd_ssi_register_setup(struct rsnd_mod *mod)
352 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
354 rsnd_mod_write(mod, SSIWSR, ssi->wsr);
355 rsnd_mod_write(mod, SSICR, ssi->cr_own |
357 ssi->cr_mode); /* without EN */
361 * SSI mod common functions
363 static int rsnd_ssi_init(struct rsnd_mod *mod,
364 struct rsnd_dai_stream *io,
365 struct rsnd_priv *priv)
367 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
370 if (!rsnd_ssi_is_run_mods(mod, io))
375 rsnd_mod_power_on(mod);
377 ret = rsnd_ssi_master_clk_start(mod, io);
381 if (!rsnd_ssi_is_parent(mod, io))
382 rsnd_ssi_config_init(mod, io);
384 rsnd_ssi_register_setup(mod);
386 /* clear error status */
387 rsnd_ssi_status_clear(mod);
392 static int rsnd_ssi_quit(struct rsnd_mod *mod,
393 struct rsnd_dai_stream *io,
394 struct rsnd_priv *priv)
396 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
397 struct device *dev = rsnd_priv_to_dev(priv);
399 if (!rsnd_ssi_is_run_mods(mod, io))
403 dev_err(dev, "%s[%d] usrcnt error\n",
404 rsnd_mod_name(mod), rsnd_mod_id(mod));
408 if (!rsnd_ssi_is_parent(mod, io))
411 rsnd_ssi_master_clk_stop(mod, io);
413 rsnd_mod_power_off(mod);
420 static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
421 struct rsnd_dai_stream *io,
422 struct snd_pcm_substream *substream,
423 struct snd_pcm_hw_params *params)
425 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
426 int chan = params_channels(params);
429 * snd_pcm_ops::hw_params will be called *before*
430 * snd_soc_dai_ops::trigger. Thus, ssi->usrcnt is 0
436 * It will happen if SSI has parent/child connection.
437 * it is error if child <-> parent SSI uses
438 * different channels.
440 if (ssi->chan != chan)
449 static int rsnd_ssi_start(struct rsnd_mod *mod,
450 struct rsnd_dai_stream *io,
451 struct rsnd_priv *priv)
453 if (!rsnd_ssi_is_run_mods(mod, io))
457 * EN will be set via SSIU :: SSI_CONTROL
458 * if Multi channel mode
460 if (rsnd_ssi_multi_slaves_runtime(io))
463 rsnd_mod_bset(mod, SSICR, EN, EN);
468 static int rsnd_ssi_stop(struct rsnd_mod *mod,
469 struct rsnd_dai_stream *io,
470 struct rsnd_priv *priv)
472 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
475 if (!rsnd_ssi_is_run_mods(mod, io))
479 * don't stop if not last user
489 * and, wait all data was sent
494 rsnd_mod_write(mod, SSICR, cr | EN);
495 rsnd_ssi_status_check(mod, DIRQ);
499 * and, wait idle state
501 rsnd_mod_write(mod, SSICR, cr); /* disabled all */
502 rsnd_ssi_status_check(mod, IIRQ);
507 static int rsnd_ssi_irq(struct rsnd_mod *mod,
508 struct rsnd_dai_stream *io,
509 struct rsnd_priv *priv,
514 if (rsnd_is_gen1(priv))
517 if (rsnd_ssi_is_parent(mod, io))
520 if (!rsnd_ssi_is_run_mods(mod, io))
524 val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
526 rsnd_mod_write(mod, SSI_INT_ENABLE, val);
531 static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
532 struct rsnd_dai_stream *io)
534 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
535 int is_dma = rsnd_ssi_is_dma_mode(mod);
537 bool elapsed = false;
540 spin_lock(&priv->lock);
542 /* ignore all cases if not working */
543 if (!rsnd_io_is_working(io))
544 goto rsnd_ssi_interrupt_out;
546 status = rsnd_ssi_status_get(mod);
549 if (!is_dma && (status & DIRQ)) {
550 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
551 u32 *buf = (u32 *)(runtime->dma_area +
552 rsnd_dai_pointer_offset(io, 0));
555 * 8/16/32 data can be assesse to TDR/RDR register
556 * directly as 32bit data
557 * see rsnd_ssi_init()
559 if (rsnd_io_is_play(io))
560 rsnd_mod_write(mod, SSITDR, *buf);
562 *buf = rsnd_mod_read(mod, SSIRDR);
564 elapsed = rsnd_dai_pointer_update(io, sizeof(*buf));
568 if (is_dma && (status & (UIRQ | OIRQ)))
571 rsnd_ssi_status_clear(mod);
572 rsnd_ssi_interrupt_out:
573 spin_unlock(&priv->lock);
576 rsnd_dai_period_elapsed(io);
579 snd_pcm_stop_xrun(io->substream);
583 static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
585 struct rsnd_mod *mod = data;
587 rsnd_mod_interrupt(mod, __rsnd_ssi_interrupt);
595 static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
596 struct rsnd_dai_stream *io)
598 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
599 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
601 if (!__rsnd_ssi_is_pin_sharing(mod))
604 if (!rsnd_rdai_is_clk_master(rdai))
607 switch (rsnd_mod_id(mod)) {
610 rsnd_dai_connect(rsnd_ssi_mod_get(priv, 0), io, RSND_MOD_SSIP);
613 rsnd_dai_connect(rsnd_ssi_mod_get(priv, 3), io, RSND_MOD_SSIP);
616 rsnd_dai_connect(rsnd_ssi_mod_get(priv, 7), io, RSND_MOD_SSIP);
621 static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
622 struct rsnd_dai_stream *io,
623 struct snd_soc_pcm_runtime *rtd)
626 * rsnd_rdai_is_clk_master() will be enabled after set_fmt,
627 * and, pcm_new will be called after it.
628 * This function reuse pcm_new at this point.
630 rsnd_ssi_parent_attach(mod, io);
635 static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
636 struct rsnd_dai_stream *io,
637 struct rsnd_priv *priv)
639 struct device *dev = rsnd_priv_to_dev(priv);
640 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
644 * SSIP/SSIU/IRQ are not needed on
647 if (rsnd_ssi_is_multi_slave(mod, io))
651 * It can't judge ssi parent at this point
652 * see rsnd_ssi_pcm_new()
655 ret = rsnd_ssiu_attach(io, mod);
660 * SSI might be called again as PIO fallback
661 * It is easy to manual handling for IRQ request/free
663 ret = request_irq(ssi->irq,
671 static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
673 .probe = rsnd_ssi_common_probe,
674 .init = rsnd_ssi_init,
675 .quit = rsnd_ssi_quit,
676 .start = rsnd_ssi_start,
677 .stop = rsnd_ssi_stop,
679 .pcm_new = rsnd_ssi_pcm_new,
680 .hw_params = rsnd_ssi_hw_params,
683 static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
684 struct rsnd_dai_stream *io,
685 struct rsnd_priv *priv)
687 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
691 * SSIP/SSIU/IRQ/DMA are not needed on
694 if (rsnd_ssi_is_multi_slave(mod, io))
697 ret = rsnd_ssi_common_probe(mod, io, priv);
701 /* SSI probe might be called many times in MUX multi path */
702 ret = rsnd_dma_attach(io, mod, &ssi->dma);
707 static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
708 struct rsnd_dai_stream *io,
709 struct rsnd_priv *priv)
711 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
713 /* PIO will request IRQ again */
714 free_irq(ssi->irq, mod);
719 static int rsnd_ssi_fallback(struct rsnd_mod *mod,
720 struct rsnd_dai_stream *io,
721 struct rsnd_priv *priv)
723 struct device *dev = rsnd_priv_to_dev(priv);
728 * SSI .probe might be called again.
730 * rsnd_rdai_continuance_probe()
732 mod->ops = &rsnd_ssi_pio_ops;
734 dev_info(dev, "%s[%d] fallback to PIO mode\n",
735 rsnd_mod_name(mod), rsnd_mod_id(mod));
740 static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
741 struct rsnd_mod *mod)
743 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
744 int is_play = rsnd_io_is_play(io);
747 if (rsnd_ssi_use_busif(io))
748 name = is_play ? "rxu" : "txu";
750 name = is_play ? "rx" : "tx";
752 return rsnd_dma_request_channel(rsnd_ssi_of_node(priv),
756 static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
758 .dma_req = rsnd_ssi_dma_req,
759 .probe = rsnd_ssi_dma_probe,
760 .remove = rsnd_ssi_dma_remove,
761 .init = rsnd_ssi_init,
762 .quit = rsnd_ssi_quit,
763 .start = rsnd_ssi_start,
764 .stop = rsnd_ssi_stop,
766 .pcm_new = rsnd_ssi_pcm_new,
767 .fallback = rsnd_ssi_fallback,
768 .hw_params = rsnd_ssi_hw_params,
771 int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
773 return mod->ops == &rsnd_ssi_dma_ops;
780 static struct rsnd_mod_ops rsnd_ssi_non_ops = {
787 static void rsnd_ssi_connect(struct rsnd_mod *mod,
788 struct rsnd_dai_stream *io)
790 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
791 enum rsnd_mod_type types[] = {
797 enum rsnd_mod_type type;
800 /* try SSI -> SSIM1 -> SSIM2 -> SSIM3 */
801 for (i = 0; i < ARRAY_SIZE(types); i++) {
803 if (!rsnd_io_to_mod(io, type)) {
804 rsnd_dai_connect(mod, io, type);
805 rsnd_set_slot(rdai, 2 * (i + 1), (i + 1));
811 void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
812 struct device_node *playback,
813 struct device_node *capture)
815 struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai);
816 struct device_node *node;
817 struct device_node *np;
818 struct rsnd_mod *mod;
821 node = rsnd_ssi_of_node(priv);
826 for_each_child_of_node(node, np) {
827 mod = rsnd_ssi_mod_get(priv, i);
829 rsnd_ssi_connect(mod, &rdai->playback);
831 rsnd_ssi_connect(mod, &rdai->capture);
838 struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
840 if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv)))
843 return rsnd_mod_get(rsnd_ssi_get(priv, id));
846 int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
848 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
850 return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE);
853 static u32 *rsnd_ssi_get_status(struct rsnd_dai_stream *io,
854 struct rsnd_mod *mod,
855 enum rsnd_mod_type type)
858 * SSIP (= SSI parent) needs to be special, otherwise,
859 * 2nd SSI might doesn't start. see also rsnd_mod_call()
861 * We can't include parent SSI status on SSI, because we don't know
862 * how many SSI requests parent SSI. Thus, it is localed on "io" now.
865 * Capture : SSI1 (needs SSI0)
867 * 1) start Capture -> SSI0/SSI1 are started.
868 * 2) start Playback -> SSI0 doesn't work, because it is already
869 * marked as "started" on 1)
871 * OTOH, using each mod's status is good for MUX case.
872 * It doesn't need to start in 2nd start
874 * IO-0: SRC0 -> CTU1 -+-> MUX -> DVC -> SSIU -> SSI0
876 * IO-1: SRC1 -> CTU2 -+
878 * 1) start IO-0 -> start SSI0
879 * 2) start IO-1 -> SSI0 doesn't need to start, because it is
880 * already started on 1)
882 if (type == RSND_MOD_SSIP)
883 return &io->parent_ssi_status;
885 return rsnd_mod_get_status(io, mod, type);
888 int rsnd_ssi_probe(struct rsnd_priv *priv)
890 struct device_node *node;
891 struct device_node *np;
892 struct device *dev = rsnd_priv_to_dev(priv);
893 struct rsnd_mod_ops *ops;
895 struct rsnd_ssi *ssi;
896 char name[RSND_SSI_NAME_SIZE];
899 node = rsnd_ssi_of_node(priv);
903 nr = of_get_child_count(node);
906 goto rsnd_ssi_probe_done;
909 ssi = devm_kzalloc(dev, sizeof(*ssi) * nr, GFP_KERNEL);
912 goto rsnd_ssi_probe_done;
919 for_each_child_of_node(node, np) {
920 ssi = rsnd_ssi_get(priv, i);
922 snprintf(name, RSND_SSI_NAME_SIZE, "%s.%d",
925 clk = devm_clk_get(dev, name);
928 goto rsnd_ssi_probe_done;
931 if (of_get_property(np, "shared-pin", NULL))
932 ssi->flags |= RSND_SSI_CLK_PIN_SHARE;
934 if (of_get_property(np, "no-busif", NULL))
935 ssi->flags |= RSND_SSI_NO_BUSIF;
937 ssi->irq = irq_of_parse_and_map(np, 0);
940 goto rsnd_ssi_probe_done;
943 ops = &rsnd_ssi_non_ops;
944 if (of_property_read_bool(np, "pio-transfer"))
945 ops = &rsnd_ssi_pio_ops;
947 ops = &rsnd_ssi_dma_ops;
949 ret = rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk,
950 rsnd_ssi_get_status, RSND_MOD_SSI, i);
952 goto rsnd_ssi_probe_done;
965 void rsnd_ssi_remove(struct rsnd_priv *priv)
967 struct rsnd_ssi *ssi;
970 for_each_rsnd_ssi(ssi, priv, i) {
971 rsnd_mod_quit(rsnd_mod_get(ssi));