Lines Matching +full:convert +full:- +full:rate

1 // SPDX-License-Identifier: GPL-2.0
3 // Renesas R-Car SRC support
9 * You can use Synchronous Sampling Rate Convert (if no DVC)
11 * amixer set "SRC Out Rate" on
13 * amixer set "SRC Out Rate" 96000 // convert rate to 96000Hz
14 * amixer set "SRC Out Rate" 22050 // convert rate to 22050Hz
36 struct rsnd_kctrl_cfg_s sen; /* sync convert enable */
37 struct rsnd_kctrl_cfg_s sync; /* sync convert */
43 #define rsnd_src_get(priv, id) ((struct rsnd_src *)(priv->src) + id)
44 #define rsnd_src_nr(priv) ((priv)->src_nr)
45 #define rsnd_src_sync_is_enabled(mod) (rsnd_mod_to_src(mod)->sen.val)
53 ((pos) = (struct rsnd_src *)(priv)->src + i); \
58 * image of SRC (Sampling Rate Converter)
60 * 96kHz <-> +-----+ 48kHz +-----+ 48kHz +-------+
61 * 48kHz <-> | SRC | <------> | SSI | <-----> | codec |
62 * 44.1kHz <-> +-----+ +-----+ +-------+
103 convert_rate = src->sync.val; in rsnd_src_convert_rate()
109 convert_rate = runtime->rate; in rsnd_src_convert_rate()
120 unsigned int rate = 0; in rsnd_src_get_rate() local
125 * runtime_rate -> [SRC] -> convert_rate in rsnd_src_get_rate()
128 * convert_rate -> [SRC] -> runtime_rate in rsnd_src_get_rate()
132 return runtime->rate; in rsnd_src_get_rate()
135 * return convert rate if SRC is used, in rsnd_src_get_rate()
136 * otherwise, return runtime->rate as usual in rsnd_src_get_rate()
139 rate = rsnd_src_convert_rate(io, src_mod); in rsnd_src_get_rate()
141 if (!rate) in rsnd_src_get_rate()
142 rate = runtime->rate; in rsnd_src_get_rate()
144 return rate; in rsnd_src_get_rate()
148 0x01800000, /* 6 - 1/6 */
149 0x01000000, /* 6 - 1/4 */
150 0x00c00000, /* 6 - 1/3 */
151 0x00800000, /* 6 - 1/2 */
152 0x00600000, /* 6 - 2/3 */
153 0x00400000, /* 6 - 1 */
157 0x02400000, /* 6 - 1/6 */
158 0x01800000, /* 6 - 1/4 */
159 0x01200000, /* 6 - 1/3 */
160 0x00c00000, /* 6 - 1/2 */
161 0x00900000, /* 6 - 2/3 */
162 0x00600000, /* 6 - 1 */
166 0x00100060, /* 6 - 1/6 */
167 0x00100040, /* 6 - 1/4 */
168 0x00100030, /* 6 - 1/3 */
169 0x00100020, /* 6 - 1/2 */
170 0x00100020, /* 6 - 2/3 */
171 0x00100020, /* 6 - 1 */
227 /* 6 - 1/6 are very enough ratio for SRC_BSDSR */ in rsnd_src_set_convert_rate()
364 int irq = src->irq; in rsnd_src_irq()
372 * IRQ is not supported on non-DT in rsnd_src_irq()
443 * Enable SRC output if you want to use sync convert together with DVC in rsnd_src_start()
470 src->sync.val = 0; in rsnd_src_init()
496 src->sync.val = 0; in rsnd_src_quit()
507 spin_lock(&priv->lock); in __rsnd_src_interrupt()
519 spin_unlock(&priv->lock); in __rsnd_src_interrupt()
522 snd_pcm_stop_xrun(io->substream); in __rsnd_src_interrupt()
540 int irq = src->irq; in rsnd_src_probe_()
545 * IRQ is not supported on non-DT in rsnd_src_probe_()
557 ret = rsnd_dma_attach(io, mod, &src->dma); in rsnd_src_probe_()
570 * enable SRC sync convert if possible in rsnd_src_pcm_new()
574 * It can't use SRC Synchronous convert in rsnd_src_pcm_new()
581 * enable sync convert in rsnd_src_pcm_new()
585 "SRC Out Rate Switch" : in rsnd_src_pcm_new()
586 "SRC In Rate Switch", in rsnd_src_pcm_new()
589 &src->sen, 1); in rsnd_src_pcm_new()
595 "SRC Out Rate" : in rsnd_src_pcm_new()
596 "SRC In Rate", in rsnd_src_pcm_new()
599 &src->sync, 192000); in rsnd_src_pcm_new()
661 ret = -EINVAL; in rsnd_src_probe()
667 ret = -ENOMEM; in rsnd_src_probe()
671 priv->src_nr = nr; in rsnd_src_probe()
672 priv->src = src; in rsnd_src_probe()
681 ret = -EINVAL; in rsnd_src_probe()
691 src->irq = irq_of_parse_and_map(np, 0); in rsnd_src_probe()
692 if (!src->irq) { in rsnd_src_probe()
693 ret = -EINVAL; in rsnd_src_probe()